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.
116 lines
4.4 KiB
XML
116 lines
4.4 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.dao.purchase.PurInquiryMapper">
|
|
<sql id="Base_Column_List">
|
|
<!--@mbg.generated-->
|
|
id, billNo, billDate, `status`, billType, remark, invCode, deptCode, `createUser`,
|
|
createTime, auditUser, auditTime, updateUser, updateTime, auditRemark, targetInvCode,
|
|
targetDeptCode, planBillNo, generatePlan, emergency, arrivalTime, approvalFlowId,
|
|
pageType, validUntil
|
|
</sql>
|
|
|
|
<select id="selectPage" parameterType="com.glxp.api.req.purchase.PurInquiryRequest"
|
|
resultType="com.glxp.api.res.purchase.PurInquiryEntityResponse">
|
|
select
|
|
pc.id, pc.billNo, pc.billDate, pc.billType, pc.remark, pc.invCode, pc.deptCode, pc.createUser, pc.createTime,
|
|
pc.auditUser, pc.auditTime, pc.updateUser, pc.updateTime, pc.auditRemark, pc.targetInvCode, pc.targetDeptCode, pc.planBillNo,
|
|
pc.generatePlan, pc.emergency, pc.arrivalTime, pc.pageType,pc.approvalFlowId,pc.validUntil,IFNULL(pc.status,0) as status,
|
|
saf.status as flowStatus, saf.nextNodeName as nextNodeName , saf.nextApprovalNodeType as nextApprovalNodeType,
|
|
pc.supIds
|
|
from pur_inquiry pc
|
|
left join sys_approval_flow saf ON pc.approvalFlowId = saf.id
|
|
<where>
|
|
pc.billNo is not null
|
|
<if test="!purInquiryRequest.sysApprovalFlow">
|
|
<if test="purInquiryRequest.status != null and purInquiryRequest.status != 2 and purInquiryRequest.status != 1 and purInquiryRequest.status != 3 ">
|
|
and pc.status = #{purInquiryRequest.status}
|
|
</if>
|
|
<if test="purInquiryRequest.status == 2">
|
|
and (pc.status = 2 )
|
|
</if>
|
|
<if test="purInquiryRequest.status == 1">
|
|
and (pc.status = 1 or pc.status is null )
|
|
</if>
|
|
<if test="purInquiryRequest.status == 3">
|
|
and (pc.status = 3 or pc.status = 4)
|
|
</if>
|
|
</if>
|
|
|
|
<if test="purInquiryRequest.sysApprovalFlow">
|
|
<if test="purInquiryRequest.status != null and purInquiryRequest.status != 1 and purInquiryRequest.status != 2 and purInquiryRequest.status != 3 ">
|
|
and saf.status = #{purInquiryRequest.status}
|
|
</if>
|
|
<if test="purInquiryRequest.status == 2">
|
|
and (saf.status = 2)
|
|
</if>
|
|
<if test="purInquiryRequest.status == 1">
|
|
and (saf.status = 1 or saf.status is null or saf.status = 0)
|
|
</if>
|
|
<if test="purInquiryRequest.status == 3">
|
|
and (saf.status = 3 or saf.status = 4)
|
|
</if>
|
|
</if>
|
|
|
|
<if test="purInquiryRequest.billNo != null and purInquiryRequest.billNo != ''" >
|
|
and pc.billNo like concat('%',#{purInquiryRequest.billNo},'%')
|
|
</if>
|
|
<!-- <if test="purInquiryRequest.name != null and purInquiryRequest.name != ''" >-->
|
|
<!-- and pc.name like concat('%',#{purInquiryRequest.name},'%')-->
|
|
<!-- </if>-->
|
|
<if test="purInquiryRequest.generatePlan != null " >
|
|
and pc.generatePlan = #{purInquiryRequest.generatePlan}
|
|
</if>
|
|
<if test="purInquiryRequest.startDate != null and purInquiryRequest.startDate != ''">
|
|
AND pc.billDate <![CDATA[>=]]> #{purInquiryRequest.startDate}
|
|
</if>
|
|
<if test="purInquiryRequest.endDate != null and purInquiryRequest.endDate != ''">
|
|
AND pc.billDate <![CDATA[<=]]> #{purInquiryRequest.endDate}
|
|
</if>
|
|
<if test="purInquiryRequest.pageType != null ">
|
|
AND pc.pageType = #{purInquiryRequest.pageType}
|
|
</if>
|
|
order by id desc
|
|
</where>
|
|
|
|
</select>
|
|
|
|
|
|
<insert id="insert" keyProperty="id"
|
|
parameterType="com.glxp.api.entity.purchase.PurInquiryEntity" useGeneratedKeys="true">
|
|
insert
|
|
INTO pur_inquiry
|
|
(
|
|
billNo, billDate, `status`, billType, remark, invCode, deptCode, `createUser`,
|
|
createTime, auditUser, auditTime, updateUser, updateTime, auditRemark, targetInvCode,
|
|
targetDeptCode, planBillNo, generatePlan, emergency, arrivalTime, approvalFlowId,
|
|
pageType, validUntil
|
|
)
|
|
values (
|
|
#{billNo},
|
|
#{billDate},
|
|
#{status},
|
|
#{billType},
|
|
#{remark},
|
|
#{invCode},
|
|
#{deptCode},
|
|
#{createUser},
|
|
#{createTime},
|
|
#{auditUser},
|
|
#{auditTime},
|
|
#{updateUser},
|
|
#{updateTime},
|
|
#{auditRemark},
|
|
#{targetInvCode},
|
|
#{targetDeptCode},
|
|
#{planBillNo},
|
|
#{generatePlan},
|
|
#{emergency},
|
|
#{arrivalTime},
|
|
#{approvalFlowId},
|
|
#{pageType},
|
|
#{validUntil}
|
|
)
|
|
</insert>
|
|
|
|
</mapper>
|