You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
spms-java/api-admin/src/main/resources/mybatis/mapper/basic/EntrustReceDao.xml

145 lines
5.7 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.glxp.sale.admin.dao.basic.EntrustReceDao">
<select id="filterEntrustRec" parameterType="com.glxp.sale.admin.req.basic.BasicEntrustRecRequest"
resultType="com.glxp.sale.admin.entity.basic.EntrustReceEntity">
select * from basic_entrust_accept
<where>
<if test="id != '' and id!=null">
and id = #{id}
</if>
<if test="action!=null">
and action = #{action}
</if>
<if test="entrustInv!=null">
and entrustInv = #{entrustInv}
</if>
<if test="entrustUser != '' and entrustUser!=null">
and entrustUser = #{entrustUser}
</if>
<if test="userId!=null">
and userId = #{userId}
</if>
<if test="curInv!=null">
and curInv = #{curInv}
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if>
</where>
order by updateTime desc
</select>
<select id="downloadEntrustRec" parameterType="com.glxp.sale.admin.req.basic.BasicEntrustRecRequest"
resultType="com.glxp.sale.admin.entity.basic.DlEntrustReceEntity">
select
basic_entrust_accept.id,b.name,b.action,b.mainAction
from basic_entrust_accept
INNER JOIN basic_bustype_local a on basic_entrust_accept.action = a.action
INNER JOIN basic_bussiness_type b on a.action = b.localAction
LEFT JOIN auth_user on basic_entrust_accept.entrustUser = auth_user.id
<where>
<if test="id != '' and id!=null">
and id = #{id}
</if>
<if test="action!=null">
and basic_entrust_accept.action = #{action}
</if>
<if test="entrustInv!=null">
and basic_entrust_accept.entrustInv = #{entrustInv}
</if>
<if test="entrustUser != '' and entrustUser!=null">
and basic_entrust_accept.entrustUser = #{entrustUser}
</if>
<if test="userId!=null">
and basic_entrust_accept.userId = #{userId}
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if>
</where>
</select>
<select id="filterJoinEntrustRec" parameterType="com.glxp.sale.admin.req.basic.BasicEntrustRecRequest"
resultType="com.glxp.sale.admin.res.basic.EntrustReceRespose">
select basic_entrust_accept.* ,
a.name curName, b.name entrustName,auth_user.employeeName
,c.name entrustInvName,d.name curInvName
from basic_entrust_accept
LEFT JOIN basic_bustype_local a on basic_entrust_accept.action = a.action
LEFT JOIN basic_bussiness_type b on basic_entrust_accept.entrustAction = b.action
LEFT JOIN auth_user on basic_entrust_accept.entrustUser = auth_user.id
LEFT JOIN inv_warehouse c on basic_entrust_accept.entrustInv = c.`code`
LEFT JOIN inv_warehouse d on basic_entrust_accept.curInv = d.`code`
<where>
<if test="id != '' and id!=null">
and id = #{id}
</if>
<if test="action!=null">
and action = #{action}
</if>
<if test="entrustInv!=null">
and entrustInv = #{entrustInv}
</if>
<if test="entrustUser != '' and entrustUser!=null">
and entrustUser = #{entrustUser}
</if>
<if test="userId!=null">
and userId = #{userId}
</if>
<if test="curInv!=null">
and curInv = #{curInv}
</if>
</where>
order by updateTime desc
</select>
<insert id="insertEntrustRec" keyProperty="id"
parameterType="com.glxp.sale.admin.entity.basic.EntrustReceEntity">
replace
INTO basic_entrust_accept(`action`, entrustInv, `entrustUser`, userId, updateTime, remark,entrustAction,finishRece,curInv)
values (
#{action},
#{entrustInv},
#{entrustUser},
#{userId},
#{updateTime},
#{remark},
#{entrustAction},
#{finishRece},
#{curInv}
)
</insert>
<update id="updateEntrustRec" parameterType="com.glxp.sale.admin.entity.basic.EntrustReceEntity">
UPDATE basic_entrust_accept
<trim prefix="set" suffixOverrides=",">
<if test="action != null">action=#{action},</if>
<if test="entrustInv != null">entrustInv=#{entrustInv},</if>
<if test="entrustUser != null">entrustUser=#{entrustUser},</if>
<if test="userId != null">userId=#{userId},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="curInv != null">curInv=#{curInv},</if>
<if test="remark != null">remark=#{remark},</if>
<if test="finishRece != null">finishRece=#{finishRece},</if>
<if test="entrustAction != null">entrustAction=#{entrustAction},</if>
</trim>
WHERE id = #{id}
</update>
<delete id="deleteById" parameterType="Map">
DELETE
FROM basic_entrust_accept
WHERE id = #{id}
</delete>
<delete id="deleteAll" parameterType="Map">
DELETE
FROM basic_entrust_accept
</delete>
</mapper>