emis-service/emis-biz/src/main/resources/mapper/EmisElectronicPagMapper.xml
2024-06-02 15:34:21 +08:00

178 lines
11 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.EmisElectronicPagMapper">
<resultMap type="EmisElectronicPag" id="EmisElectronicPagResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
<result property="id" column="id" />
<result property="prefix" column="prefix" />
<result property="startNo" column="start_no" />
<result property="endNo" column="end_no" />
<result property="billCount" column="bill_count" />
<result property="unitMoney" column="unit_money" />
<result property="billFee" column="bill_fee" />
<result property="curStartNo" column="cur_start_no" />
<result property="hasBillCount" column="has_bill_count" />
<result property="provideDate" column="provide_date" />
<result property="provideMan" column="provide_man" />
<result property="provideSite" column="provide_site" />
<result property="status" column="status" />
</resultMap>
<sql id="selectEmisElectronicPagVo">
select id, prefix, start_no, end_no, bill_count, unit_money, bill_fee, cur_start_no, has_bill_count, provide_date, provide_man, provide_site, status, del_flag, create_by, create_time, update_by, update_time, remark, create_site, update_site from emis_electronic_pag
</sql>
<select id="selectEmisElectronicPagList" parameterType="EmisElectronicPag" resultMap="EmisElectronicPagResult">
<include refid="selectEmisElectronicPagVo"/>
<where>
del_flag='0'
<if test="id != null "> and id = #{id}</if>
<if test="prefix != null and prefix != ''"> and prefix like concat('%', #{prefix}, '%')</if>
<if test="startNo != null and startNo != ''"> and start_no like concat('%', #{startNo}, '%')</if>
<if test="endNo != null and endNo != ''"> and end_no like concat('%', #{endNo}, '%')</if>
<if test="billCount != null "> and bill_count = #{billCount}</if>
<if test="unitMoney != null "> and unit_money = #{unitMoney}</if>
<if test="billFee != null "> and bill_fee = #{billFee}</if>
<if test="curStartNo != null and curStartNo != ''"> and cur_start_no like concat('%', #{curStartNo}, '%')</if>
<if test="hasBillCount != null "> and has_bill_count = #{hasBillCount}</if>
<if test="provideDate != null "> and provide_date = #{provideDate}</if>
<if test="provideMan != null and provideMan != ''"> and provide_man like concat('%', #{provideMan}, '%')</if>
<if test="provideSite != null and provideSite != ''"> and provide_site like concat('%', #{provideSite}, '%')</if>
<if test="status != null "> and status = #{status}</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="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</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="EmisElectronicPag" resultType="int">
select count(1) from emis_electronic_pag
where del_flag='0'
and id = #{id}
and prefix = #{prefix}
and start_no = #{startNo}
and end_no = #{endNo}
and bill_count = #{billCount}
and unit_money = #{unitMoney}
and bill_fee = #{billFee}
and cur_start_no = #{curStartNo}
and has_bill_count = #{hasBillCount}
and provide_date = #{provideDate}
and provide_man = #{provideMan}
and provide_site = #{provideSite}
and status = #{status}
and del_flag = #{delFlag}
and create_by = #{createBy}
and create_time = #{createTime}
and update_by = #{updateBy}
and update_time = #{updateTime}
and remark = #{remark}
and create_site = #{createSite}
and update_site = #{updateSite}
limit 1
</select>
<select id="selectEmisElectronicPagById" parameterType="Long" resultMap="EmisElectronicPagResult">
select id, prefix, start_no, end_no, bill_count, unit_money, bill_fee, cur_start_no, has_bill_count, provide_date, provide_man, provide_site, status, del_flag, create_by, create_time, update_by, update_time, remark, create_site, update_site
from emis_electronic_pag a
where a.id = #{id}
</select>
<insert id="insertEmisElectronicPag" parameterType="EmisElectronicPag" useGeneratedKeys="true" keyProperty="id">
insert into emis_electronic_pag
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="prefix != null and prefix != ''">prefix,</if>
<if test="startNo != null and startNo != ''">start_no,</if>
<if test="endNo != null and endNo != ''">end_no,</if>
<if test="billCount != null">bill_count,</if>
<if test="unitMoney != null">unit_money,</if>
<if test="billFee != null">bill_fee,</if>
<if test="curStartNo != null and curStartNo != ''">cur_start_no,</if>
<if test="hasBillCount != null">has_bill_count,</if>
<if test="provideDate != null">provide_date,</if>
<if test="provideMan != null and provideMan != ''">provide_man,</if>
<if test="provideSite != null and provideSite != ''">provide_site,</if>
<if test="status != null">status,</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="remark != null and remark != ''">remark,</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="prefix != null and prefix != ''">#{prefix},</if>
<if test="startNo != null and startNo != ''">#{startNo},</if>
<if test="endNo != null and endNo != ''">#{endNo},</if>
<if test="billCount != null">#{billCount},</if>
<if test="unitMoney != null">#{unitMoney},</if>
<if test="billFee != null">#{billFee},</if>
<if test="curStartNo != null and curStartNo != ''">#{curStartNo},</if>
<if test="hasBillCount != null">#{hasBillCount},</if>
<if test="provideDate != null">#{provideDate},</if>
<if test="provideMan != null and provideMan != ''">#{provideMan},</if>
<if test="provideSite != null and provideSite != ''">#{provideSite},</if>
<if test="status != null">#{status},</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="remark != null and remark != ''">#{remark},</if>
<if test="createSite != null and createSite != ''">#{createSite},</if>
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
</trim>
</insert>
<update id="updateEmisElectronicPag" parameterType="EmisElectronicPag">
update emis_electronic_pag
<trim prefix="SET" suffixOverrides=",">
<if test="prefix != null and prefix != ''">prefix = #{prefix},</if>
<if test="startNo != null and startNo != ''">start_no = #{startNo},</if>
<if test="endNo != null and endNo != ''">end_no = #{endNo},</if>
<if test="billCount != null">bill_count = #{billCount},</if>
<if test="unitMoney != null">unit_money = #{unitMoney},</if>
<if test="billFee != null">bill_fee = #{billFee},</if>
<if test="curStartNo != null and curStartNo != ''">cur_start_no = #{curStartNo},</if>
<if test="hasBillCount != null">has_bill_count = #{hasBillCount},</if>
<if test="provideDate != null">provide_date = #{provideDate},</if>
<if test="provideMan != null and provideMan != ''">provide_man = #{provideMan},</if>
<if test="provideSite != null and provideSite != ''">provide_site = #{provideSite},</if>
<if test="status != null">status = #{status},</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="remark != null and remark != ''">remark = #{remark},</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="deleteEmisElectronicPagById" parameterType="Long">
delete from emis_electronic_pag where id = #{id}
</delete>
<delete id="deleteEmisElectronicPagByIds" parameterType="String">
delete from emis_electronic_pag where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>