emis-service/emis-biz/src/main/resources/mapper/EmisSettlePayBillRelMapper.xml
2025-05-05 08:34:08 +08:00

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.EmisSettlePayBillRelMapper">
<resultMap type="EmisSettlePayBillRel" id="EmisSettlePayBillRelResult">
<result property="id" column="id" />
<result property="payId" column="pay_id" />
<result property="settleBillNo" column="settle_bill_no" />
</resultMap>
<sql id="selectEmisSettlePayBillRelVo">
select id, pay_id, settle_bill_no, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_settle_pay_bill_rel
</sql>
<select id="selectEmisSettlePayBillRelList" parameterType="EmisSettlePayBillRel" resultMap="EmisSettlePayBillRelResult">
<include refid="selectEmisSettlePayBillRelVo"/>
<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="settleBillNo != null and settleBillNo != ''"> and settle_bill_no like concat('%', #{settleBillNo}, '%')</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="EmisSettlePayBillRel" resultType="int">
select count(1) from emis_settle_pay_bill_rel
where del_flag='0'
and id = #{id}
and pay_id = #{payId}
and settle_bill_no = #{settleBillNo}
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="selectEmisSettlePayBillRelById" parameterType="Long" resultMap="EmisSettlePayBillRelResult">
select id, pay_id, settle_bill_no, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
from emis_settle_pay_bill_rel a
where a.id = #{id}
</select>
<insert id="insertEmisSettlePayBillRel" parameterType="EmisSettlePayBillRel" useGeneratedKeys="true" keyProperty="id">
insert into emis_settle_pay_bill_rel
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="payId != null and payId != ''">pay_id,</if>
<if test="settleBillNo != null and settleBillNo != ''">settle_bill_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="settleBillNo != null and settleBillNo != ''">#{settleBillNo},</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="updateEmisSettlePayBillRel" parameterType="EmisSettlePayBillRel">
update emis_settle_pay_bill_rel
<trim prefix="SET" suffixOverrides=",">
<if test="payId != null and payId != ''">pay_id = #{payId},</if>
<if test="settleBillNo != null and settleBillNo != ''">settle_bill_no = #{settleBillNo},</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="deleteEmisSettlePayBillRelById" parameterType="Long">
delete from emis_settle_pay_bill_rel where id = #{id}
</delete>
<delete id="deleteEmisSettlePayBillRelByIds" parameterType="String">
delete from emis_settle_pay_bill_rel where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>