<?xml version="1.0" encoding="UTF-8" ?>
|
<!DOCTYPE mapper
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.gkhy.exam.pay.mapper.CoalPayStudentMapper">
|
<sql id="selectCoalPayStudentVo">
|
select id, coal_pay_id, name, id_card, phone, sex, pay_code, pay_status,pay_type,order_id,file_data,gov_pay_status, update_by, update_time, create_by, create_time, del_flag from coal_pay_student
|
</sql>
|
<insert id="insertCoalPayStudent">
|
insert into coal_pay_student
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,</if>
|
<if test="coalPayId != null">coal_pay_id,</if>
|
<if test="name != null and name != ''">name,</if>
|
<if test="idCard != null and idCard != ''">id_card,</if>
|
<if test="phone != null and phone != ''">phone,</if>
|
<if test="sex != null">sex,</if>
|
<if test="payCode != null">pay_code,</if>
|
<if test="payStatus != null">pay_status,</if>
|
<if test="payType != null">pay_type,</if>
|
<if test="orderId!=null">order_id,</if>
|
<if test="fileData!=null">file_data,</if>
|
<if test="govPayStatus!=null">gov_pay_status,</if>
|
<if test="createBy != null">create_by,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="updateBy != null">update_by,</if>
|
<if test="updateTime != null">update_time,</if>
|
<if test="delFlag != null">del_flag,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id},</if>
|
<if test="coalPayId != null">#{coalPayId},</if>
|
<if test="name != null and name != ''">#{name},</if>
|
<if test="idCard != null and idCard != ''">#{idCard},</if>
|
<if test="phone != null and phone != ''">#{phone},</if>
|
<if test="sex != null">#{sex},</if>
|
<if test="payCode != null">#{payCode},</if>
|
<if test="payStatus != null">#{payStatus},</if>
|
<if test="payType != null">#{payType},</if>
|
<if test="orderId!=null">#{orderId},</if>
|
<if test="fileData!=null">#{fileData},</if>
|
<if test="govPayStatus!=null">#{govPayStatus},</if>
|
<if test="createBy != null">#{createBy},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
<if test="delFlag != null">#{delFlag},</if>
|
</trim>
|
</insert>
|
|
<update id="updateByIds">
|
update coal_pay_student set del_flag = 2 where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</update>
|
<update id="updateCoalPayStudentById">
|
update coal_pay_student
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="coalPayId != null">coal_pay_id = #{coalPayId},</if>
|
<if test="name != null and name != ''">name = #{name},</if>
|
<if test="idCard != null and idCard != ''">id_card = #{idCard},</if>
|
<if test="phone != null and phone != ''">phone = #{phone},</if>
|
<if test="sex != null">sex = #{sex},</if>
|
<if test="payType != null">pay_type = #{payType},</if>
|
<if test="payCode != null">pay_code = #{payCode},</if>
|
<if test="payStatus != null">pay_status = #{payStatus},</if>
|
<if test="orderId!=null">order_id=#{orderId},</if>
|
<if test="fileData!=null">file_data=#{fileData},</if>
|
<if test="govPayStatus!=null">gov_pay_status=#{govPayStatus},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<select id="selectByCoalPayId" resultType="com.gkhy.exam.pay.entity.CoalPayStudent">
|
<include refid="selectCoalPayStudentVo"></include>
|
where coal_pay_id = #{coalPayId}
|
and del_flag =0
|
</select>
|
|
<select id="selectByCoalPayIdAndPayStatus" resultType="com.gkhy.exam.pay.entity.CoalPayStudent">
|
<include refid="selectCoalPayStudentVo"></include>
|
where coal_pay_id = #{id} and pay_status = #{status}
|
and del_flag =0
|
</select>
|
|
<select id="selectByIds" resultType="com.gkhy.exam.pay.entity.CoalPayStudent">
|
<include refid="selectCoalPayStudentVo"></include>
|
where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</select>
|
|
<select id="selectByIdcard" resultType="com.gkhy.exam.pay.entity.CoalPayStudent">
|
<include refid="selectCoalPayStudentVo"></include>
|
where id_card=#{idCard} and phone=#{phone} and del_flag = 0
|
</select>
|
</mapper>
|