111 lines
6.0 KiB
XML
111 lines
6.0 KiB
XML
<?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.xdadan.erp.emis.mapper.EmisSettlePayInvoiceRelMapper">
|
|
|
|
<resultMap type="EmisSettlePayInvoiceRel" id="EmisSettlePayInvoiceRelResult">
|
|
<result property="id" column="id" />
|
|
<result property="payId" column="pay_id" />
|
|
<result property="applySeqNo" column="apply_seq_no" />
|
|
</resultMap>
|
|
|
|
<sql id="selectEmisSettlePayInvoiceRelVo">
|
|
select id, pay_id, apply_seq_no, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_settle_pay_invoice_rel
|
|
</sql>
|
|
|
|
<select id="selectEmisSettlePayInvoiceRelList" parameterType="EmisSettlePayInvoiceRel" resultMap="EmisSettlePayInvoiceRelResult">
|
|
<include refid="selectEmisSettlePayInvoiceRelVo"/>
|
|
<where>
|
|
del_flag='0'
|
|
<if test="id != null "> and id = #{id}</if>
|
|
<if test="payId != null and payId != ''"> and pay_id like concat('%', #{payId}, '%')</if>
|
|
<if test="applySeqNo != null and applySeqNo != ''"> and apply_seq_no like concat('%', #{applySeqNo}, '%')</if>
|
|
<if test="delFlag != null and delFlag != ''"> and del_flag like concat('%', #{delFlag}, '%')</if>
|
|
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
|
|
<if test="createTime != null "> and create_time = #{createTime}</if>
|
|
<if test="updateBy != null and updateBy != ''"> and update_by like concat('%', #{updateBy}, '%')</if>
|
|
<if test="updateTime != null "> and update_time = #{updateTime}</if>
|
|
<if test="createSite != null and createSite != ''"> and create_site like concat('%', #{createSite}, '%')</if>
|
|
<if test="updateSite != null and updateSite != ''"> and update_site like concat('%', #{updateSite}, '%')</if>
|
|
</where>
|
|
order by create_time desc
|
|
</select>
|
|
|
|
<select id="checkUnique" parameterType="EmisSettlePayInvoiceRel" resultType="int">
|
|
select count(1) from emis_settle_pay_invoice_rel
|
|
where del_flag='0'
|
|
and id = #{id}
|
|
and pay_id = #{payId}
|
|
and apply_seq_no = #{applySeqNo}
|
|
and del_flag = #{delFlag}
|
|
and create_by = #{createBy}
|
|
and create_time = #{createTime}
|
|
and update_by = #{updateBy}
|
|
and update_time = #{updateTime}
|
|
and create_site = #{createSite}
|
|
and update_site = #{updateSite}
|
|
limit 1
|
|
</select>
|
|
|
|
<select id="selectEmisSettlePayInvoiceRelById" parameterType="Long" resultMap="EmisSettlePayInvoiceRelResult">
|
|
select id, pay_id, apply_seq_no, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
|
|
from emis_settle_pay_invoice_rel a
|
|
where a.id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertEmisSettlePayInvoiceRel" parameterType="EmisSettlePayInvoiceRel" useGeneratedKeys="true" keyProperty="id">
|
|
insert into emis_settle_pay_invoice_rel
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">id,</if>
|
|
<if test="payId != null and payId != ''">pay_id,</if>
|
|
<if test="applySeqNo != null and applySeqNo != ''">apply_seq_no,</if>
|
|
<if test="delFlag != null and delFlag != ''">del_flag,</if>
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="createSite != null and createSite != ''">create_site,</if>
|
|
<if test="updateSite != null and updateSite != ''">update_site,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">#{id},</if>
|
|
<if test="payId != null and payId != ''">#{payId},</if>
|
|
<if test="applySeqNo != null and applySeqNo != ''">#{applySeqNo},</if>
|
|
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="createSite != null and createSite != ''">#{createSite},</if>
|
|
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateEmisSettlePayInvoiceRel" parameterType="EmisSettlePayInvoiceRel">
|
|
update emis_settle_pay_invoice_rel
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="payId != null and payId != ''">pay_id = #{payId},</if>
|
|
<if test="applySeqNo != null and applySeqNo != ''">apply_seq_no = #{applySeqNo},</if>
|
|
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
|
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="createSite != null and createSite != ''">create_site = #{createSite},</if>
|
|
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteEmisSettlePayInvoiceRelById" parameterType="Long">
|
|
delete from emis_settle_pay_invoice_rel where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteEmisSettlePayInvoiceRelByIds" parameterType="String">
|
|
delete from emis_settle_pay_invoice_rel where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |