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.
124 lines
4.8 KiB
XML
124 lines
4.8 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.purchase.PurApplyDao">
|
||
|
|
||
|
<select id="queryPageList" parameterType="com.glxp.api.req.purchase.PurApplyRequest"
|
||
|
resultType="com.glxp.api.res.purchase.PurApplyResponse">
|
||
|
SELECT
|
||
|
pur_apply.*,
|
||
|
cb.employeeName createByName,
|
||
|
ab.employeeName auditByName,
|
||
|
auth_warehouse.`name` targetInvName,
|
||
|
auth_dept.`name` targetDeptName
|
||
|
FROM
|
||
|
pur_apply
|
||
|
LEFT JOIN auth_user cb ON pur_apply.createUser = cb.id
|
||
|
LEFT JOIN auth_user ab ON pur_apply.auditUser = ab.id
|
||
|
LEFT JOIN auth_warehouse ON pur_apply.targetInvCode = auth_warehouse.`code`
|
||
|
LEFT JOIN auth_dept ON auth_dept.`code` = pur_apply.targetDeptCode
|
||
|
<where>
|
||
|
<if test="billNo != '' and billNo != null">
|
||
|
AND billNo = #{billNo}
|
||
|
</if>
|
||
|
<if test="startDate != null and startDate !=''">
|
||
|
<![CDATA[ and DATE_FORMAT(billDate,'%Y-%m-%d')>= #{startDate}]]>
|
||
|
</if>
|
||
|
<if test="endDate != null and endDate !=''">
|
||
|
<![CDATA[ and DATE_FORMAT(billDate,'%Y-%m-%d') <= #{endDate}]]>
|
||
|
</if>
|
||
|
<if test="status!=null and status!=10 and status!=11">
|
||
|
and pur_apply.status = #{status}
|
||
|
</if>
|
||
|
<if test="status ==10">
|
||
|
and ( pur_apply.status = 3 or pur_apply.status=2 or pur_apply.status=4)
|
||
|
</if>
|
||
|
<if test="status ==11">
|
||
|
and ( pur_apply.status = 1 or pur_apply.status=2 or pur_apply.status=4)
|
||
|
</if>
|
||
|
|
||
|
<if test="deptCode != '' and deptCode != null">
|
||
|
AND deptCode = #{deptCode}
|
||
|
</if>
|
||
|
<if test="invCode != '' and invCode != null">
|
||
|
AND invCode = #{invCode}
|
||
|
</if>
|
||
|
<if test="auditUser != '' and auditUser != null">
|
||
|
AND auditUser = #{auditUser}
|
||
|
</if>
|
||
|
<if test="createUser != '' and createUser != null">
|
||
|
AND createUser = #{createUser}
|
||
|
</if>
|
||
|
<if test="applyType != null">
|
||
|
AND generatePlan = 1
|
||
|
</if>
|
||
|
</where>
|
||
|
|
||
|
</select>
|
||
|
|
||
|
<insert id="insert" keyProperty="id" keyColumn="id"
|
||
|
parameterType="com.glxp.api.entity.purchase.PurApplyEntity" useGeneratedKeys="true">
|
||
|
replace
|
||
|
INTO pur_apply
|
||
|
(
|
||
|
billNo,billDate,status,billType,remark,invCode,
|
||
|
deptCode,createUser,createTime,auditUser,auditTime,updateTime,updateUser ,auditRemark,targetInvCode,targetDeptCode,planBillNo,generatePlan
|
||
|
)
|
||
|
values (
|
||
|
#{billNo},
|
||
|
#{billDate},
|
||
|
#{status},
|
||
|
#{billType},
|
||
|
#{remark},
|
||
|
#{invCode},
|
||
|
#{deptCode},
|
||
|
#{createUser},
|
||
|
#{createTime},
|
||
|
#{auditUser},
|
||
|
#{auditTime},
|
||
|
#{updateTime},
|
||
|
#{updateUser},
|
||
|
#{auditRemark},
|
||
|
#{targetInvCode},
|
||
|
#{targetDeptCode},
|
||
|
#{planBillNo},#{generatePlan}
|
||
|
)
|
||
|
</insert>
|
||
|
|
||
|
|
||
|
<delete id="deleteByIds" parameterType="java.util.List">
|
||
|
DELETE FROM pur_apply WHERE id in
|
||
|
<foreach collection="ids" item="item" open="(" separator="," close=")">
|
||
|
#{item}
|
||
|
</foreach>
|
||
|
</delete>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<update id="update" parameterType="com.glxp.api.entity.purchase.PurApplyEntity">
|
||
|
UPDATE pur_apply
|
||
|
<trim prefix="set" suffixOverrides=",">
|
||
|
<if test="billNo != null">billNo=#{billNo},</if>
|
||
|
<if test="billDate != null">billDate=#{billDate},</if>
|
||
|
<if test="status != null">status=#{status},</if>
|
||
|
<if test="billType != null">billType=#{billType},</if>
|
||
|
<if test="remark != null">remark=#{remark},</if>
|
||
|
<if test="invCode != null">invCode=#{invCode},</if>
|
||
|
<if test="deptCode != null">deptCode=#{deptCode},</if>
|
||
|
<if test="auditUser != null">auditUser=#{auditUser},</if>
|
||
|
<if test="auditTime != null">auditTime=#{auditTime},</if>
|
||
|
<if test="createUser != null">createUser=#{createUser},</if>
|
||
|
<if test="createTime != null">createTime=#{createTime},</if>
|
||
|
<if test="updateTime != null">updateTime=#{updateTime},</if>
|
||
|
<if test="updateUser != null">updateUser=#{updateUser},</if>
|
||
|
<if test="auditRemark != null">auditRemark=#{auditRemark},</if>
|
||
|
<if test="targetInvCode != null">targetInvCode=#{targetInvCode},</if>
|
||
|
<if test="targetDeptCode != null">targetDeptCode=#{targetDeptCode},</if>
|
||
|
<if test="planBillNo != null">planBillNo=#{planBillNo},</if>
|
||
|
<if test="generatePlan != null">generatePlan=#{generatePlan},</if>
|
||
|
</trim>
|
||
|
WHERE id = #{id}
|
||
|
</update>
|
||
|
|
||
|
</mapper>
|