<?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.NonCoalPayMapper">
|
|
<resultMap type="NonCoalPay" id="NonCoalPayResult">
|
<result property="id" column="id" />
|
<result property="batchName" column="batch_name" />
|
<result property="deptId" column="dept_id" />
|
<result property="districtCode" column="district_code" />
|
<result property="payType" column="pay_type" />
|
<result property="amount" column="amount" />
|
<result property="year" column="year" />
|
<result property="quarter" column="quarter" />
|
<result property="payPersonType" column="pay_person_type" />
|
<result property="payCompanyName" column="pay_company_name" />
|
<result property="payCompanyCard" column="pay_company_card" />
|
<result property="updateBy" column="update_by" />
|
<result property="updateTime" column="update_time" />
|
<result property="createBy" column="create_by" />
|
<result property="createTime" column="create_time" />
|
<result property="delFlag" column="del_flag" />
|
</resultMap>
|
|
<sql id="selectNonCoalPayVo">
|
select id, batch_name, dept_id, district_code, pay_type, amount, year, quarter, pay_person_type, pay_company_name, pay_company_card, update_by, update_time, create_by, create_time, del_flag from non_coal_pay
|
</sql>
|
|
<select id="selectNonCoalPayList" parameterType="NonCoalPay" resultMap="NonCoalPayResult">
|
<include refid="selectNonCoalPayVo"/>
|
<where>
|
<if test="batchName != null and batchName != ''"> and batch_name like concat('%', #{batchName}, '%')</if>
|
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
<if test="districtCode != null and districtCode != ''"> and district_code = #{districtCode}</if>
|
<if test="payType != null "> and pay_type = #{payType}</if>
|
<if test="amount != null "> and amount = #{amount}</if>
|
<if test="year != null and year != ''"> and year = #{year}</if>
|
<if test="quarter != null "> and quarter = #{quarter}</if>
|
<if test="payPersonType != null "> and pay_person_type = #{payPersonType}</if>
|
<if test="payCompanyName != null and payCompanyName != ''"> and pay_company_name like concat('%', #{payCompanyName}, '%')</if>
|
<if test="payCompanyCard != null and payCompanyCard != ''"> and pay_company_card = #{payCompanyCard}</if>
|
</where>
|
</select>
|
|
<select id="selectNonCoalPayById" parameterType="Long" resultMap="NonCoalPayResult">
|
<include refid="selectNonCoalPayVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertNonCoalPay" parameterType="NonCoalPay" useGeneratedKeys="true" keyProperty="id">
|
insert into non_coal_pay
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="batchName != null and batchName != ''">batch_name,</if>
|
<if test="deptId != null">dept_id,</if>
|
<if test="districtCode != null and districtCode != ''">district_code,</if>
|
<if test="payType != null">pay_type,</if>
|
<if test="amount != null">amount,</if>
|
<if test="year != null and year != ''">year,</if>
|
<if test="quarter != null">quarter,</if>
|
<if test="payPersonType != null">pay_person_type,</if>
|
<if test="payCompanyName != null">pay_company_name,</if>
|
<if test="payCompanyCard != null">pay_company_card,</if>
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
<if test="updateTime != null">update_time,</if>
|
<if test="createBy != null">create_by,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="delFlag != null">del_flag,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="batchName != null and batchName != ''">#{batchName},</if>
|
<if test="deptId != null">#{deptId},</if>
|
<if test="districtCode != null and districtCode != ''">#{districtCode},</if>
|
<if test="payType != null">#{payType},</if>
|
<if test="amount != null">#{amount},</if>
|
<if test="year != null and year != ''">#{year},</if>
|
<if test="quarter != null">#{quarter},</if>
|
<if test="payPersonType != null">#{payPersonType},</if>
|
<if test="payCompanyName != null">#{payCompanyName},</if>
|
<if test="payCompanyCard != null">#{payCompanyCard},</if>
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
<if test="createBy != null">#{createBy},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="delFlag != null">#{delFlag},</if>
|
</trim>
|
</insert>
|
|
<update id="updateNonCoalPay" parameterType="NonCoalPay">
|
update non_coal_pay
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="batchName != null and batchName != ''">batch_name = #{batchName},</if>
|
<if test="deptId != null">dept_id = #{deptId},</if>
|
<if test="districtCode != null and districtCode != ''">district_code = #{districtCode},</if>
|
<if test="payType != null">pay_type = #{payType},</if>
|
<if test="amount != null">amount = #{amount},</if>
|
<if test="year != null and year != ''">year = #{year},</if>
|
<if test="quarter != null">quarter = #{quarter},</if>
|
<if test="payPersonType != null">pay_person_type = #{payPersonType},</if>
|
<if test="payCompanyName != null">pay_company_name = #{payCompanyName},</if>
|
<if test="payCompanyCard != null">pay_company_card = #{payCompanyCard},</if>
|
<if test="updateBy != null and updateBy != ''">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>
|
|
<delete id="deleteNonCoalPayById" parameterType="Long">
|
delete from non_coal_pay where id = #{id}
|
</delete>
|
|
<delete id="deleteNonCoalPayByIds" parameterType="String">
|
delete from non_coal_pay where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|