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.
166 lines
6.1 KiB
XML
166 lines
6.1 KiB
XML
2 years ago
|
<?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.api.dao.basic.EntrustReceDao">
|
||
|
<select id="filterEntrustRec" parameterType="com.glxp.api.req.basic.BasicEntrustRecRequest"
|
||
|
resultType="com.glxp.api.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="entrustDept != null">
|
||
|
and entrustDept = #{entrustDept}
|
||
|
</if>
|
||
|
<if test="curDept != null">
|
||
|
and curDept = #{curDept}
|
||
|
</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="findByUnique" parameterType="com.glxp.api.req.basic.BasicEntrustRecRequest"
|
||
|
resultType="com.glxp.api.entity.basic.EntrustReceEntity">
|
||
|
select *
|
||
|
from basic_entrust_accept
|
||
|
where `action` = #{action}
|
||
|
and `entrustUser` = #{entrustUser}
|
||
|
limit 1
|
||
|
</select>
|
||
|
|
||
|
|
||
|
<select id="downloadEntrustRec" parameterType="com.glxp.api.req.basic.BasicEntrustRecRequest"
|
||
|
resultType="com.glxp.api.entity.basic.DlEntrustReceEntity">
|
||
|
select basic_entrust_accept.id,
|
||
|
b.name,
|
||
|
b.action,
|
||
|
b.mainAction
|
||
|
from basic_entrust_accept
|
||
|
INNER JOIN basic_bussiness_type b on basic_entrust_accept.action = b.action
|
||
|
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.api.req.basic.BasicEntrustRecRequest"
|
||
|
resultType="com.glxp.api.res.basic.EntrustReceResponse">
|
||
|
select basic_entrust_accept.*,
|
||
|
a.name as curName,
|
||
|
b.name as entrustName,
|
||
|
auth_user.employeeName,
|
||
|
c.name as entrustInvName,
|
||
|
d.name as curInvName
|
||
|
from basic_entrust_accept
|
||
|
LEFT JOIN basic_bussiness_type 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 auth_warehouse c on basic_entrust_accept.entrustInv = c.`code`
|
||
|
LEFT JOIN auth_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>
|
||
|
<if test="name != null and name != ''">
|
||
|
and a.name like concat('%'
|
||
|
, #{name}
|
||
|
, '%')
|
||
|
</if>
|
||
|
</where>
|
||
|
group by basic_entrust_accept.id
|
||
|
order by updateTime desc
|
||
|
</select>
|
||
|
|
||
|
|
||
|
<insert id="insertEntrustRec" keyProperty="id"
|
||
|
parameterType="com.glxp.api.entity.basic.EntrustReceEntity">
|
||
|
replace
|
||
|
INTO basic_entrust_accept(`action`, curDept, entrustInv, `entrustUser`, userId,
|
||
|
updateTime, remark, entrustAction, finishRece, curInv, entrustDept, entrustInv,
|
||
|
entrustEnd)
|
||
|
values (#{action},
|
||
|
#{entrustInv},
|
||
|
#{entrustUser},
|
||
|
#{userId},
|
||
|
#{updateTime},
|
||
|
#{remark},
|
||
|
#{entrustAction},
|
||
|
#{finishRece},
|
||
|
#{curInv},
|
||
|
#{entrustDept},
|
||
|
#{entrustInv},
|
||
|
#{entrustEnd})
|
||
|
</insert>
|
||
|
|
||
|
|
||
|
<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>
|