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.
128 lines
5.1 KiB
XML
128 lines
5.1 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.api.admin.dao.purchase.PurPlanDao">
|
|
|
|
<select id="queryPageList" parameterType="com.glxp.api.admin.req.purchase.PurPlanRequest"
|
|
resultType="com.glxp.api.admin.res.purchase.PurPlanResponse">
|
|
|
|
select pur_plan.* ,
|
|
cb.employeeName createByName,ab.employeeName auditByName,
|
|
inv_warehouse.name invName,inv_warehouse_sub.`name` subInvName FROM pur_plan
|
|
left JOIN auth_user cb on pur_plan.createBy = cb.id
|
|
LEFT JOIN auth_user ab on pur_plan.auditBy = ab.id
|
|
LEFT JOIN inv_warehouse on pur_plan.locStorageCode = inv_warehouse.`code`
|
|
LEFT JOIN inv_warehouse_sub on inv_warehouse_sub.code = pur_plan.invWarehouseCode
|
|
<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_plan.status = #{status}
|
|
</if>
|
|
<if test="status ==10">
|
|
and ( pur_plan.status = 3 or pur_plan.status=2 or pur_plan.status=4)
|
|
</if>
|
|
<if test="status ==11">
|
|
and ( pur_plan.status = 1 or pur_plan.status=2 or pur_plan.status=4)
|
|
</if>
|
|
|
|
<if test="deptCode != '' and deptCode != null">
|
|
AND deptCode = #{deptCode}
|
|
</if>
|
|
<if test="locStorageCode != '' and locStorageCode != null">
|
|
AND locStorageCode = #{locStorageCode}
|
|
</if>
|
|
<if test="invWarehouseCode != '' and invWarehouseCode != null">
|
|
AND invWarehouseCode = #{invWarehouseCode}
|
|
</if>
|
|
<if test="auditBy != '' and auditBy != null">
|
|
AND auditBy = #{auditBy}
|
|
</if>
|
|
<if test="createBy != '' and createBy != null">
|
|
AND createBy = #{createBy}
|
|
</if>
|
|
</where>
|
|
|
|
</select>
|
|
|
|
<insert id="insert" keyProperty="id"
|
|
parameterType="com.glxp.api.admin.entity.purchase.PurPlanEntity" useGeneratedKeys="true">
|
|
replace
|
|
INTO pur_plan
|
|
(
|
|
billNo,billDate,status,billType,remark,locStorageCode,invWarehouseCode,
|
|
deptCode,createBy,createTime,auditBy,auditTime,updateTime,auditRemark
|
|
,applyCreateBy,applyAuditBy,applyRemark,applyBillNo,stockOrderNo
|
|
)
|
|
values (
|
|
#{billNo},
|
|
#{billDate},
|
|
#{status},
|
|
#{billType},
|
|
#{remark},
|
|
#{locStorageCode},
|
|
#{invWarehouseCode},
|
|
#{deptCode},
|
|
#{createBy},
|
|
#{createTime},
|
|
#{auditBy},
|
|
#{auditTime},
|
|
#{updateTime},
|
|
#{auditRemark},
|
|
#{applyCreateBy},
|
|
#{applyAuditBy},
|
|
#{applyRemark},
|
|
#{applyBillNo},
|
|
#{stockOrderNo}
|
|
)
|
|
</insert>
|
|
|
|
|
|
<delete id="deleteByIds" parameterType="java.util.List">
|
|
DELETE FROM pur_plan WHERE id in
|
|
<foreach collection="ids" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteById" parameterType="Map">
|
|
DELETE
|
|
FROM pur_plan
|
|
WHERE id = #{id}
|
|
</delete>
|
|
|
|
<update id="update" parameterType="com.glxp.api.admin.entity.purchase.PurPlanEntity">
|
|
UPDATE pur_plan
|
|
<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="locStorageCode != null">locStorageCode=#{locStorageCode},</if>
|
|
<if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if>
|
|
<if test="deptCode != null">deptCode=#{deptCode},</if>
|
|
<if test="auditBy != null">auditBy=#{auditBy},</if>
|
|
<if test="auditTime != null">auditTime=#{auditTime},</if>
|
|
<if test="createBy != null">createBy=#{createBy},</if>
|
|
<if test="createTime != null">createTime=#{createTime},</if>
|
|
<if test="updateTime != null">updateTime=#{updateTime},</if>
|
|
<if test="auditRemark != null">auditRemark=#{auditRemark},</if>
|
|
<if test="applyCreateBy != null">applyCreateBy=#{applyCreateBy},</if>
|
|
<if test="applyAuditBy != null">applyAuditBy=#{applyAuditBy},</if>
|
|
<if test="applyRemark != null">applyRemark=#{applyRemark},</if>
|
|
<if test="applyBillNo != null">applyBillNo=#{applyBillNo},</if>
|
|
<if test="stockOrderNo != null">stockOrderNo=#{stockOrderNo},</if>
|
|
</trim>
|
|
WHERE id = #{id}
|
|
</update>
|
|
|
|
</mapper> |