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

94 lines
3.5 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>
</where>
order by updateTime desc
</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
,inv_warehouse.name entrustInvName
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 inv_warehouse on basic_entrust_accept.entrustInv = inv_warehouse.`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>
</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)
values (
#{action},
#{entrustInv},
#{entrustUser},
#{userId},
#{updateTime},
#{remark},
#{entrustAction},
#{finishRece}
)
</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="remark != null">remark=#{remark},</if>
</trim>
WHERE id = #{id}
</update>
<delete id="deleteById" parameterType="Map">
DELETE
FROM basic_entrust_accept
WHERE id = #{id}
</delete>
</mapper>