emis-service/emis-biz/src/main/resources/mapper/EmisElectronicPagApplyMapper.xml

284 lines
19 KiB
XML
Raw Normal View History

2024-03-01 11:13:28 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
2024-05-27 05:43:31 +00:00
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
2024-03-01 11:13:28 +00:00
<mapper namespace="com.xdadan.erp.emis.mapper.EmisElectronicPagApplyMapper">
2024-05-27 05:43:31 +00:00
2024-03-01 11:13:28 +00:00
<resultMap type="EmisElectronicPagApply" id="EmisElectronicPagApplyResult">
<result property="id" column="id" />
<result property="applySeq" column="apply_seq" />
<result property="applyDate" column="apply_date" />
<result property="provideType" column="provide_type" />
2024-05-27 05:43:31 +00:00
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
2024-03-01 11:13:28 +00:00
<result property="applyManCode" column="apply_man_code" />
<result property="applySiteCode" column="apply_site_code" />
<result property="unitMoney" column="unit_money" />
<result property="applyCount" column="apply_count" />
<result property="sumMoney" column="sum_money" />
<result property="blSend" column="bl_send" />
<result property="sendDate" column="send_date" />
<result property="sendManCode" column="send_man_code" />
<result property="sendSiteCode" column="send_site_code" />
<result property="blCancel" column="bl_cancel" />
<result property="cancelManCode" column="cancel_man_code" />
<result property="cancelDate" column="cancel_date" />
<result property="cancelSiteCode" column="cancel_site_code" />
<result property="userSiteCode" column="user_site_code" />
<result property="startNo" column="start_no" />
<result property="endNo" column="end_no" />
<result property="curStartNo" column="cur_start_no" />
<result property="hasBillCount" column="has_bill_count" />
<result property="blAllowAllocate" column="bl_allow_allocate" />
2024-05-27 07:49:37 +00:00
2024-03-01 11:13:28 +00:00
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
2024-05-27 05:43:31 +00:00
<result property="createSite" column="create_site" />
<result property="updateSite" column="update_site" />
2024-05-27 07:49:37 +00:00
2024-05-27 08:29:44 +00:00
<association property="createByName" column="create_by" select="selectEmpNameByUserId"/>
<association property="updateByName" column="update_by" select="selectEmpNameByUserId"/>
2024-05-27 07:53:57 +00:00
<association property="createSiteName" column="create_site" select="selectSiteNameByCode"/>
<association property="updateSiteName" column="update_site" select="selectSiteNameByCode"/>
2024-05-27 07:49:37 +00:00
<association property="applySiteName" column="apply_site_code" select="selectSiteNameByCode"/>
<association property="sendSiteName" column="send_site_code" select="selectSiteNameByCode"/>
<association property="cancelSiteName" column="cancel_site_code" select="selectSiteNameByCode"/>
<association property="userSiteName" column="user_site_code" select="selectSiteNameByCode"/>
<association property="applyManName" column="apply_man_code" select="selectEmpNameByCode"/>
<association property="sendManName" column="send_man_code" select="selectEmpNameByCode"/>
<association property="cancelManName" column="cancel_man_code" select="selectEmpNameByCode"/>
2024-03-01 11:13:28 +00:00
</resultMap>
2024-05-27 07:49:37 +00:00
<select id="selectSiteNameByCode" parameterType="String" resultType="string">
select a.site_name from emis_site a where a.site_code = #{code} limit 1
</select>
2024-05-27 08:29:44 +00:00
<select id="selectEmpNameByUserId" parameterType="String" resultType="string">
select a.emp_name from sys_user a where a.user_id = #{id} limit 1
2024-05-27 07:49:37 +00:00
</select>
2024-03-01 11:13:28 +00:00
<sql id="selectEmisElectronicPagApplyVo">
2024-05-27 05:43:31 +00:00
select id, apply_seq, apply_date, provide_type, material_code, material_name, apply_man_code, apply_site_code, unit_money, apply_count, sum_money, bl_send, send_date, send_man_code, send_site_code, bl_cancel, cancel_man_code, cancel_date, cancel_site_code, user_site_code, start_no, end_no, cur_start_no, has_bill_count, bl_allow_allocate, del_flag, create_by, create_time, update_by, update_time, remark, create_site, update_site from emis_electronic_pag_apply
2024-03-01 11:13:28 +00:00
</sql>
<select id="selectEmisElectronicPagApplyList" parameterType="EmisElectronicPagApply" resultMap="EmisElectronicPagApplyResult">
<include refid="selectEmisElectronicPagApplyVo"/>
2024-05-27 05:43:31 +00:00
<where>
del_flag='0'
2024-03-01 11:13:28 +00:00
<if test="id != null "> and id = #{id}</if>
<if test="applySeq != null and applySeq != ''"> and apply_seq like concat('%', #{applySeq}, '%')</if>
<if test="applyDate != null "> and apply_date = #{applyDate}</if>
<if test="provideType != null and provideType != ''"> and provide_type like concat('%', #{provideType}, '%')</if>
2024-05-27 05:43:31 +00:00
<if test="materialCode != null and materialCode != ''"> and material_code like concat('%', #{materialCode}, '%')</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
2024-03-01 11:13:28 +00:00
<if test="applyManCode != null and applyManCode != ''"> and apply_man_code like concat('%', #{applyManCode}, '%')</if>
<if test="applySiteCode != null and applySiteCode != ''"> and apply_site_code like concat('%', #{applySiteCode}, '%')</if>
2024-05-27 05:43:31 +00:00
<if test="unitMoney != null "> and unit_money = #{unitMoney}</if>
<if test="applyCount != null "> and apply_count = #{applyCount}</if>
<if test="sumMoney != null "> and sum_money = #{sumMoney}</if>
2024-03-01 11:13:28 +00:00
<if test="blSend != null and blSend != ''"> and bl_send like concat('%', #{blSend}, '%')</if>
2024-05-27 05:43:31 +00:00
<if test="sendDate != null "> and send_date = #{sendDate}</if>
2024-03-01 11:13:28 +00:00
<if test="sendManCode != null and sendManCode != ''"> and send_man_code like concat('%', #{sendManCode}, '%')</if>
<if test="sendSiteCode != null and sendSiteCode != ''"> and send_site_code like concat('%', #{sendSiteCode}, '%')</if>
<if test="blCancel != null and blCancel != ''"> and bl_cancel like concat('%', #{blCancel}, '%')</if>
<if test="cancelManCode != null and cancelManCode != ''"> and cancel_man_code like concat('%', #{cancelManCode}, '%')</if>
2024-05-27 05:43:31 +00:00
<if test="cancelDate != null "> and cancel_date = #{cancelDate}</if>
2024-03-01 11:13:28 +00:00
<if test="cancelSiteCode != null and cancelSiteCode != ''"> and cancel_site_code like concat('%', #{cancelSiteCode}, '%')</if>
<if test="userSiteCode != null and userSiteCode != ''"> and user_site_code like concat('%', #{userSiteCode}, '%')</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="curStartNo != null and curStartNo != ''"> and cur_start_no like concat('%', #{curStartNo}, '%')</if>
<if test="hasBillCount != null and hasBillCount != ''"> and has_bill_count like concat('%', #{hasBillCount}, '%')</if>
<if test="blAllowAllocate != null and blAllowAllocate != ''"> and bl_allow_allocate like concat('%', #{blAllowAllocate}, '%')</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>
2024-05-27 05:43:31 +00:00
<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>
2024-03-01 11:13:28 +00:00
</where>
order by create_time desc
</select>
2024-05-27 05:43:31 +00:00
<select id="checkUnique" parameterType="EmisElectronicPagApply" resultType="int">
select count(1) from emis_electronic_pag_apply
where del_flag='0'
and id = #{id}
and apply_seq = #{applySeq}
and apply_date = #{applyDate}
and provide_type = #{provideType}
and material_code = #{materialCode}
and material_name = #{materialName}
and apply_man_code = #{applyManCode}
and apply_site_code = #{applySiteCode}
and unit_money = #{unitMoney}
and apply_count = #{applyCount}
and sum_money = #{sumMoney}
and bl_send = #{blSend}
and send_date = #{sendDate}
and send_man_code = #{sendManCode}
and send_site_code = #{sendSiteCode}
and bl_cancel = #{blCancel}
and cancel_man_code = #{cancelManCode}
and cancel_date = #{cancelDate}
and cancel_site_code = #{cancelSiteCode}
and user_site_code = #{userSiteCode}
and start_no = #{startNo}
and end_no = #{endNo}
and cur_start_no = #{curStartNo}
and has_bill_count = #{hasBillCount}
and bl_allow_allocate = #{blAllowAllocate}
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>
2024-03-01 11:13:28 +00:00
<select id="selectEmisElectronicPagApplyById" parameterType="Long" resultMap="EmisElectronicPagApplyResult">
2024-05-27 05:43:31 +00:00
select id, apply_seq, apply_date, provide_type, material_code, material_name, apply_man_code, apply_site_code, unit_money, apply_count, sum_money, bl_send, send_date, send_man_code, send_site_code, bl_cancel, cancel_man_code, cancel_date, cancel_site_code, user_site_code, start_no, end_no, cur_start_no, has_bill_count, bl_allow_allocate, del_flag, create_by, create_time, update_by, update_time, remark, create_site, update_site
2024-03-01 11:13:28 +00:00
from emis_electronic_pag_apply a
where a.id = #{id}
</select>
2024-05-27 05:43:31 +00:00
<insert id="insertEmisElectronicPagApply" parameterType="EmisElectronicPagApply" useGeneratedKeys="true" keyProperty="id">
2024-03-01 11:13:28 +00:00
insert into emis_electronic_pag_apply
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="applySeq != null and applySeq != ''">apply_seq,</if>
<if test="applyDate != null">apply_date,</if>
<if test="provideType != null and provideType != ''">provide_type,</if>
2024-05-27 05:43:31 +00:00
<if test="materialCode != null and materialCode != ''">material_code,</if>
<if test="materialName != null and materialName != ''">material_name,</if>
2024-03-01 11:13:28 +00:00
<if test="applyManCode != null and applyManCode != ''">apply_man_code,</if>
<if test="applySiteCode != null and applySiteCode != ''">apply_site_code,</if>
2024-05-27 05:43:31 +00:00
<if test="unitMoney != null">unit_money,</if>
<if test="applyCount != null">apply_count,</if>
<if test="sumMoney != null">sum_money,</if>
2024-03-01 11:13:28 +00:00
<if test="blSend != null and blSend != ''">bl_send,</if>
2024-05-27 05:43:31 +00:00
<if test="sendDate != null">send_date,</if>
2024-03-01 11:13:28 +00:00
<if test="sendManCode != null and sendManCode != ''">send_man_code,</if>
<if test="sendSiteCode != null and sendSiteCode != ''">send_site_code,</if>
<if test="blCancel != null and blCancel != ''">bl_cancel,</if>
<if test="cancelManCode != null and cancelManCode != ''">cancel_man_code,</if>
2024-05-27 05:43:31 +00:00
<if test="cancelDate != null">cancel_date,</if>
2024-03-01 11:13:28 +00:00
<if test="cancelSiteCode != null and cancelSiteCode != ''">cancel_site_code,</if>
<if test="userSiteCode != null and userSiteCode != ''">user_site_code,</if>
<if test="startNo != null and startNo != ''">start_no,</if>
<if test="endNo != null and endNo != ''">end_no,</if>
<if test="curStartNo != null and curStartNo != ''">cur_start_no,</if>
<if test="hasBillCount != null and hasBillCount != ''">has_bill_count,</if>
<if test="blAllowAllocate != null and blAllowAllocate != ''">bl_allow_allocate,</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>
2024-05-27 05:43:31 +00:00
<if test="createSite != null and createSite != ''">create_site,</if>
<if test="updateSite != null and updateSite != ''">update_site,</if>
</trim>
2024-03-01 11:13:28 +00:00
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="applySeq != null and applySeq != ''">#{applySeq},</if>
<if test="applyDate != null">#{applyDate},</if>
<if test="provideType != null and provideType != ''">#{provideType},</if>
2024-05-27 05:43:31 +00:00
<if test="materialCode != null and materialCode != ''">#{materialCode},</if>
<if test="materialName != null and materialName != ''">#{materialName},</if>
2024-03-01 11:13:28 +00:00
<if test="applyManCode != null and applyManCode != ''">#{applyManCode},</if>
<if test="applySiteCode != null and applySiteCode != ''">#{applySiteCode},</if>
2024-05-27 05:43:31 +00:00
<if test="unitMoney != null">#{unitMoney},</if>
<if test="applyCount != null">#{applyCount},</if>
<if test="sumMoney != null">#{sumMoney},</if>
2024-03-01 11:13:28 +00:00
<if test="blSend != null and blSend != ''">#{blSend},</if>
2024-05-27 05:43:31 +00:00
<if test="sendDate != null">#{sendDate},</if>
2024-03-01 11:13:28 +00:00
<if test="sendManCode != null and sendManCode != ''">#{sendManCode},</if>
<if test="sendSiteCode != null and sendSiteCode != ''">#{sendSiteCode},</if>
<if test="blCancel != null and blCancel != ''">#{blCancel},</if>
<if test="cancelManCode != null and cancelManCode != ''">#{cancelManCode},</if>
2024-05-27 05:43:31 +00:00
<if test="cancelDate != null">#{cancelDate},</if>
2024-03-01 11:13:28 +00:00
<if test="cancelSiteCode != null and cancelSiteCode != ''">#{cancelSiteCode},</if>
<if test="userSiteCode != null and userSiteCode != ''">#{userSiteCode},</if>
<if test="startNo != null and startNo != ''">#{startNo},</if>
<if test="endNo != null and endNo != ''">#{endNo},</if>
<if test="curStartNo != null and curStartNo != ''">#{curStartNo},</if>
<if test="hasBillCount != null and hasBillCount != ''">#{hasBillCount},</if>
<if test="blAllowAllocate != null and blAllowAllocate != ''">#{blAllowAllocate},</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>
2024-05-27 05:43:31 +00:00
<if test="createSite != null and createSite != ''">#{createSite},</if>
<if test="updateSite != null and updateSite != ''">#{updateSite},</if>
</trim>
2024-03-01 11:13:28 +00:00
</insert>
<update id="updateEmisElectronicPagApply" parameterType="EmisElectronicPagApply">
update emis_electronic_pag_apply
<trim prefix="SET" suffixOverrides=",">
<if test="applySeq != null and applySeq != ''">apply_seq = #{applySeq},</if>
<if test="applyDate != null">apply_date = #{applyDate},</if>
<if test="provideType != null and provideType != ''">provide_type = #{provideType},</if>
2024-05-27 05:43:31 +00:00
<if test="materialCode != null and materialCode != ''">material_code = #{materialCode},</if>
<if test="materialName != null and materialName != ''">material_name = #{materialName},</if>
2024-03-01 11:13:28 +00:00
<if test="applyManCode != null and applyManCode != ''">apply_man_code = #{applyManCode},</if>
<if test="applySiteCode != null and applySiteCode != ''">apply_site_code = #{applySiteCode},</if>
2024-05-27 05:43:31 +00:00
<if test="unitMoney != null">unit_money = #{unitMoney},</if>
<if test="applyCount != null">apply_count = #{applyCount},</if>
<if test="sumMoney != null">sum_money = #{sumMoney},</if>
2024-03-01 11:13:28 +00:00
<if test="blSend != null and blSend != ''">bl_send = #{blSend},</if>
2024-05-27 05:43:31 +00:00
<if test="sendDate != null">send_date = #{sendDate},</if>
2024-03-01 11:13:28 +00:00
<if test="sendManCode != null and sendManCode != ''">send_man_code = #{sendManCode},</if>
<if test="sendSiteCode != null and sendSiteCode != ''">send_site_code = #{sendSiteCode},</if>
<if test="blCancel != null and blCancel != ''">bl_cancel = #{blCancel},</if>
<if test="cancelManCode != null and cancelManCode != ''">cancel_man_code = #{cancelManCode},</if>
2024-05-27 05:43:31 +00:00
<if test="cancelDate != null">cancel_date = #{cancelDate},</if>
2024-03-01 11:13:28 +00:00
<if test="cancelSiteCode != null and cancelSiteCode != ''">cancel_site_code = #{cancelSiteCode},</if>
<if test="userSiteCode != null and userSiteCode != ''">user_site_code = #{userSiteCode},</if>
<if test="startNo != null and startNo != ''">start_no = #{startNo},</if>
<if test="endNo != null and endNo != ''">end_no = #{endNo},</if>
<if test="curStartNo != null and curStartNo != ''">cur_start_no = #{curStartNo},</if>
<if test="hasBillCount != null and hasBillCount != ''">has_bill_count = #{hasBillCount},</if>
<if test="blAllowAllocate != null and blAllowAllocate != ''">bl_allow_allocate = #{blAllowAllocate},</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>
2024-05-27 05:43:31 +00:00
<if test="createSite != null and createSite != ''">create_site = #{createSite},</if>
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
2024-03-01 11:13:28 +00:00
</trim>
where id = #{id}
</update>
<delete id="deleteEmisElectronicPagApplyById" parameterType="Long">
delete from emis_electronic_pag_apply where id = #{id}
</delete>
<delete id="deleteEmisElectronicPagApplyByIds" parameterType="String">
2024-05-27 05:43:31 +00:00
delete from emis_electronic_pag_apply where id in
2024-03-01 11:13:28 +00:00
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>