269 lines
19 KiB
XML
269 lines
19 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.EmisElectronicPagApplyMapper">
|
|
|
|
<resultMap type="EmisElectronicPagApply" id="EmisElectronicPagApplyResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
|
|
<result property="id" column="id" />
|
|
<result property="prefix" column="prefix" />
|
|
<result property="applySeq" column="apply_seq" />
|
|
<result property="applyDate" column="apply_date" />
|
|
<result property="provideType" column="provide_type" />
|
|
<result property="materialCode" column="material_code" />
|
|
<result property="materialName" column="material_name" />
|
|
<result property="applyManCode" column="apply_man_code" />
|
|
<result property="applySiteCode" column="apply_site_code" />
|
|
<result property="applyCount" column="apply_count" />
|
|
<result property="unitMoney" column="unit_money" />
|
|
<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="sendCenterManCode" column="send_center_man_code" />
|
|
<result property="sendCenterSiteCode" column="send_center_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="provideFlag" column="provide_flag" />
|
|
|
|
|
|
<association property="createByName" column="create_by" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectEmpNameByUserId" fetchType="lazy"/>
|
|
<association property="updateByName" column="create_by" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectEmpNameByUserId" fetchType="lazy"/>
|
|
<association property="createSiteName" column="create_site" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectSiteNameByCode" fetchType="lazy"/>
|
|
<association property="updateSiteName" column="update_site" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectSiteNameByCode" fetchType="lazy"/>
|
|
|
|
|
|
<association property="applySiteName" column="apply_site_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectSiteNameByCode"/>
|
|
<association property="sendSiteName" column="send_site_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectSiteNameByCode"/>
|
|
<association property="cancelSiteName" column="cancel_site_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectSiteNameByCode"/>
|
|
<association property="userSiteName" column="user_site_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectSiteNameByCode"/>
|
|
|
|
<association property="applyManName" column="apply_man_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectEmpNameByCode"/>
|
|
<association property="sendManName" column="send_man_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectEmpNameByCode"/>
|
|
<association property="cancelManName" column="cancel_man_code" select="com.xdadan.erp.emis.mapper.EmisBaseMapper.selectEmpNameByCode"/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectEmisElectronicPagApplyVo">
|
|
select id, prefix, apply_seq, apply_date, provide_type, material_code, material_name, apply_man_code, apply_site_code, apply_count, unit_money, sum_money, bl_send, send_date, send_man_code, send_site_code, send_center_man_code, send_center_site_code, bl_cancel, cancel_man_code, cancel_date, cancel_site_code, user_site_code, provide_flag, del_flag, create_by, create_time, update_by, update_time, remark, create_site, update_site from emis_electronic_pag_apply
|
|
</sql>
|
|
|
|
<select id="selectEmisElectronicPagApplyList" parameterType="EmisElectronicPagApply" resultMap="EmisElectronicPagApplyResult">
|
|
<include refid="selectEmisElectronicPagApplyVo"/>
|
|
<where>
|
|
del_flag='0'
|
|
<if test="id != null "> and id = #{id}</if>
|
|
<if test="prefix != null and prefix != ''"> and prefix = #{prefix}</if>
|
|
<if test="applySeq != null and applySeq != ''"> and apply_seq = #{applySeq}</if>
|
|
<if test="applyDate != null "> and apply_date = #{applyDate}</if>
|
|
<if test="provideType != null and provideType != ''"> and provide_type = #{provideType}</if>
|
|
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
|
|
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
|
<if test="applyManCode != null and applyManCode != ''"> and apply_man_code = #{applyManCode}</if>
|
|
<if test="applySiteCode != null and applySiteCode != ''"> and apply_site_code = #{applySiteCode}</if>
|
|
<if test="applyCount != null "> and apply_count = #{applyCount}</if>
|
|
<if test="unitMoney != null "> and unit_money = #{unitMoney}</if>
|
|
<if test="sumMoney != null "> and sum_money = #{sumMoney}</if>
|
|
<if test="blSend != null and blSend != ''"> and bl_send = #{blSend}</if>
|
|
<if test="sendDate != null "> and send_date = #{sendDate}</if>
|
|
<if test="sendManCode != null and sendManCode != ''"> and send_man_code = #{sendManCode}</if>
|
|
<if test="sendSiteCode != null and sendSiteCode != ''"> and send_site_code = #{sendSiteCode}</if>
|
|
<if test="sendCenterManCode != null and sendCenterManCode != ''"> and send_center_man_code = #{sendCenterManCode}</if>
|
|
<if test="sendCenterSiteCode != null and sendCenterSiteCode != ''"> and send_center_site_code = #{sendCenterSiteCode}</if>
|
|
<if test="blCancel != null and blCancel != ''"> and bl_cancel = #{blCancel}</if>
|
|
<if test="cancelManCode != null and cancelManCode != ''"> and cancel_man_code = #{cancelManCode}</if>
|
|
<if test="cancelDate != null "> and cancel_date = #{cancelDate}</if>
|
|
<if test="cancelSiteCode != null and cancelSiteCode != ''"> and cancel_site_code = #{cancelSiteCode}</if>
|
|
<if test="userSiteCode != null and userSiteCode != ''"> and user_site_code = #{userSiteCode}</if>
|
|
<if test="provideFlag != null and provideFlag != ''"> and provide_flag = #{provideFlag}</if>
|
|
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag}</if>
|
|
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
|
|
<if test="createTime != null "> and create_time = #{createTime}</if>
|
|
<if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy}</if>
|
|
<if test="updateTime != null "> and update_time = #{updateTime}</if>
|
|
<if test="remark != null and remark != ''"> and remark = #{remark}</if>
|
|
<if test="createSite != null and createSite != ''"> and create_site = #{createSite}</if>
|
|
<if test="updateSite != null and updateSite != ''"> and update_site = #{updateSite}</if>
|
|
|
|
<if test="params.beginApplyDate != null and params.beginApplyDate != ''">
|
|
and apply_date <![CDATA[ > ]]> #{params.beginApplyDate}
|
|
</if>
|
|
<if test="params.endApplyDate != null and params.endApplyDate != ''">
|
|
and apply_date <![CDATA[ <= ]]> #{params.endApplyDate}
|
|
</if>
|
|
|
|
</where>
|
|
order by create_time desc
|
|
</select>
|
|
|
|
<select id="checkUnique" parameterType="EmisElectronicPagApply" resultType="int">
|
|
select count(1) from emis_electronic_pag_apply
|
|
where del_flag='0'
|
|
and id = #{id}
|
|
and prefix = #{prefix}
|
|
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 apply_count = #{applyCount}
|
|
and unit_money = #{unitMoney}
|
|
and sum_money = #{sumMoney}
|
|
and bl_send = #{blSend}
|
|
and send_date = #{sendDate}
|
|
and send_man_code = #{sendManCode}
|
|
and send_site_code = #{sendSiteCode}
|
|
and send_center_man_code = #{sendCenterManCode}
|
|
and send_center_site_code = #{sendCenterSiteCode}
|
|
and bl_cancel = #{blCancel}
|
|
and cancel_man_code = #{cancelManCode}
|
|
and cancel_date = #{cancelDate}
|
|
and cancel_site_code = #{cancelSiteCode}
|
|
and user_site_code = #{userSiteCode}
|
|
and provide_flag = #{provideFlag}
|
|
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="selectEmisElectronicPagApplyById" parameterType="Long" resultMap="EmisElectronicPagApplyResult">
|
|
select id, prefix, apply_seq, apply_date, provide_type, material_code, material_name, apply_man_code, apply_site_code, apply_count, unit_money, sum_money, bl_send, send_date, send_man_code, send_site_code, send_center_man_code, send_center_site_code, bl_cancel, cancel_man_code, cancel_date, cancel_site_code, user_site_code, provide_flag, del_flag, create_by, create_time, update_by, update_time, remark, create_site, update_site
|
|
from emis_electronic_pag_apply a
|
|
where a.id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertEmisElectronicPagApply" parameterType="EmisElectronicPagApply" useGeneratedKeys="true" keyProperty="id">
|
|
insert into emis_electronic_pag_apply
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">id,</if>
|
|
<if test="prefix != null and prefix != ''">prefix,</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>
|
|
<if test="materialCode != null and materialCode != ''">material_code,</if>
|
|
<if test="materialName != null and materialName != ''">material_name,</if>
|
|
<if test="applyManCode != null and applyManCode != ''">apply_man_code,</if>
|
|
<if test="applySiteCode != null and applySiteCode != ''">apply_site_code,</if>
|
|
<if test="applyCount != null">apply_count,</if>
|
|
<if test="unitMoney != null">unit_money,</if>
|
|
<if test="sumMoney != null">sum_money,</if>
|
|
<if test="blSend != null and blSend != ''">bl_send,</if>
|
|
<if test="sendDate != null">send_date,</if>
|
|
<if test="sendManCode != null and sendManCode != ''">send_man_code,</if>
|
|
<if test="sendSiteCode != null and sendSiteCode != ''">send_site_code,</if>
|
|
<if test="sendCenterManCode != null and sendCenterManCode != ''">send_center_man_code,</if>
|
|
<if test="sendCenterSiteCode != null and sendCenterSiteCode != ''">send_center_site_code,</if>
|
|
<if test="blCancel != null and blCancel != ''">bl_cancel,</if>
|
|
<if test="cancelManCode != null and cancelManCode != ''">cancel_man_code,</if>
|
|
<if test="cancelDate != null">cancel_date,</if>
|
|
<if test="cancelSiteCode != null and cancelSiteCode != ''">cancel_site_code,</if>
|
|
<if test="userSiteCode != null and userSiteCode != ''">user_site_code,</if>
|
|
<if test="provideFlag != null and provideFlag != ''">provide_flag,</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="applySeq != null and applySeq != ''">#{applySeq},</if>
|
|
<if test="applyDate != null">#{applyDate},</if>
|
|
<if test="provideType != null and provideType != ''">#{provideType},</if>
|
|
<if test="materialCode != null and materialCode != ''">#{materialCode},</if>
|
|
<if test="materialName != null and materialName != ''">#{materialName},</if>
|
|
<if test="applyManCode != null and applyManCode != ''">#{applyManCode},</if>
|
|
<if test="applySiteCode != null and applySiteCode != ''">#{applySiteCode},</if>
|
|
<if test="applyCount != null">#{applyCount},</if>
|
|
<if test="unitMoney != null">#{unitMoney},</if>
|
|
<if test="sumMoney != null">#{sumMoney},</if>
|
|
<if test="blSend != null and blSend != ''">#{blSend},</if>
|
|
<if test="sendDate != null">#{sendDate},</if>
|
|
<if test="sendManCode != null and sendManCode != ''">#{sendManCode},</if>
|
|
<if test="sendSiteCode != null and sendSiteCode != ''">#{sendSiteCode},</if>
|
|
<if test="sendCenterManCode != null and sendCenterManCode != ''">#{sendCenterManCode},</if>
|
|
<if test="sendCenterSiteCode != null and sendCenterSiteCode != ''">#{sendCenterSiteCode},</if>
|
|
<if test="blCancel != null and blCancel != ''">#{blCancel},</if>
|
|
<if test="cancelManCode != null and cancelManCode != ''">#{cancelManCode},</if>
|
|
<if test="cancelDate != null">#{cancelDate},</if>
|
|
<if test="cancelSiteCode != null and cancelSiteCode != ''">#{cancelSiteCode},</if>
|
|
<if test="userSiteCode != null and userSiteCode != ''">#{userSiteCode},</if>
|
|
<if test="provideFlag != null and provideFlag != ''">#{provideFlag},</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="updateEmisElectronicPagApply" parameterType="EmisElectronicPagApply">
|
|
update emis_electronic_pag_apply
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="prefix != null and prefix != ''">prefix = #{prefix},</if>
|
|
<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>
|
|
<if test="materialCode != null and materialCode != ''">material_code = #{materialCode},</if>
|
|
<if test="materialName != null and materialName != ''">material_name = #{materialName},</if>
|
|
<if test="applyManCode != null and applyManCode != ''">apply_man_code = #{applyManCode},</if>
|
|
<if test="applySiteCode != null and applySiteCode != ''">apply_site_code = #{applySiteCode},</if>
|
|
<if test="applyCount != null">apply_count = #{applyCount},</if>
|
|
<if test="unitMoney != null">unit_money = #{unitMoney},</if>
|
|
<if test="sumMoney != null">sum_money = #{sumMoney},</if>
|
|
<if test="blSend != null and blSend != ''">bl_send = #{blSend},</if>
|
|
<if test="sendDate != null">send_date = #{sendDate},</if>
|
|
<if test="sendManCode != null and sendManCode != ''">send_man_code = #{sendManCode},</if>
|
|
<if test="sendSiteCode != null and sendSiteCode != ''">send_site_code = #{sendSiteCode},</if>
|
|
<if test="sendCenterManCode != null and sendCenterManCode != ''">send_center_man_code = #{sendCenterManCode},</if>
|
|
<if test="sendCenterSiteCode != null and sendCenterSiteCode != ''">send_center_site_code = #{sendCenterSiteCode},</if>
|
|
<if test="blCancel != null and blCancel != ''">bl_cancel = #{blCancel},</if>
|
|
<if test="cancelManCode != null and cancelManCode != ''">cancel_man_code = #{cancelManCode},</if>
|
|
<if test="cancelDate != null">cancel_date = #{cancelDate},</if>
|
|
<if test="cancelSiteCode != null and cancelSiteCode != ''">cancel_site_code = #{cancelSiteCode},</if>
|
|
<if test="userSiteCode != null and userSiteCode != ''">user_site_code = #{userSiteCode},</if>
|
|
<if test="provideFlag != null and provideFlag != ''">provide_flag = #{provideFlag},</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="deleteEmisElectronicPagApplyById" parameterType="Long">
|
|
update emis_electronic_pag_apply set del_flag='1' where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteEmisElectronicPagApplyByIds" parameterType="String">
|
|
update emis_electronic_pag_apply set del_flag='1' where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
|
|
</mapper> |