|
|
|
@ -2,7 +2,6 @@
|
|
|
|
|
<!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.inout.StockOrderDao">
|
|
|
|
|
|
|
|
|
|
<select id="listStockOrder" parameterType="com.glxp.sale.admin.req.inout.StockOrderQueryRequest"
|
|
|
|
|
resultType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
|
|
|
|
|
SELECT *
|
|
|
|
@ -14,14 +13,12 @@
|
|
|
|
|
|
|
|
|
|
<select id="listStockOrderNoDealWith" parameterType="com.glxp.sale.admin.req.inout.StockOrderQueryRequest"
|
|
|
|
|
resultType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
|
|
|
|
|
|
|
|
|
|
select *
|
|
|
|
|
from stock_order
|
|
|
|
|
INNER JOIN inv_warehouse_user on stock_order.locStorageCode = inv_warehouse_user.`code`
|
|
|
|
|
where `status` = '101'
|
|
|
|
|
group by stock_order.id
|
|
|
|
|
ORDER BY id DESC
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertStockOrder" useGeneratedKeys="true" keyProperty="id"
|
|
|
|
@ -30,7 +27,7 @@
|
|
|
|
|
thirdSysFk, status, statusInfo, `type`, sourceType,
|
|
|
|
|
printStatus, unitIdFk, customerId, thirdOrderFk, orderIdFk,
|
|
|
|
|
totalPrice, locStorageCode, supplementNo, createUser, reviewUser, entrustEnd, auditTime,
|
|
|
|
|
updateTime, invWarehouseCode, fromSubInvCode, dept ,noInvOut)
|
|
|
|
|
updateTime, invWarehouseCode, fromSubInvCode, dept, noInvOut)
|
|
|
|
|
values (#{id},
|
|
|
|
|
#{billNo},
|
|
|
|
|
#{billdate},
|
|
|
|
@ -45,39 +42,92 @@
|
|
|
|
|
#{sourceType},
|
|
|
|
|
#{printStatus}, #{unitIdFk}, #{customerId}, #{thirdOrderFk}, #{orderIdFk}, #{totalPrice},
|
|
|
|
|
#{locStorageCode}, #{supplementNo}, #{createUser}, #{reviewUser}, #{entrustEnd}, #{auditTime},
|
|
|
|
|
#{updateTime}, #{invWarehouseCode}, #{fromSubInvCode}, #{dept},#{noInvOut})
|
|
|
|
|
#{updateTime}, #{invWarehouseCode}, #{fromSubInvCode}, #{dept}, #{noInvOut})
|
|
|
|
|
</insert>
|
|
|
|
|
<update id="updateById" parameterType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
|
|
|
|
|
UPDATE stock_order
|
|
|
|
|
<trim prefix="set" suffixOverrides=",">
|
|
|
|
|
<if test="billNo != null">billNo=#{billNo},</if>
|
|
|
|
|
<if test="billdate != null">billdate=#{billdate},</if>
|
|
|
|
|
<if test="corpId != null">corpId=#{corpId},</if>
|
|
|
|
|
<if test="corpName != null">corpName=#{corpName},</if>
|
|
|
|
|
<if test="billType != null">billType=#{billType},</if>
|
|
|
|
|
<if test="billFlag != null">billFlag=#{billFlag},</if>
|
|
|
|
|
<if test="thirdSysFk != null">thirdSysFk=#{thirdSysFk},</if>
|
|
|
|
|
<if test="status != null">status=#{status},</if>
|
|
|
|
|
<if test="statusInfo != null">statusInfo=#{statusInfo},</if>
|
|
|
|
|
<if test="type != null">type=#{type},</if>
|
|
|
|
|
<if test="sourceType != null">sourceType=#{sourceType},</if>
|
|
|
|
|
<if test="printStatus != null">printStatus=#{printStatus},</if>
|
|
|
|
|
<if test="unitIdFk != null">unitIdFk=#{unitIdFk},</if>
|
|
|
|
|
<if test="customerId != null">customerId=#{customerId},</if>
|
|
|
|
|
<if test="thirdOrderFk != null">thirdOrderFk=#{thirdOrderFk},</if>
|
|
|
|
|
<if test="orderIdFk != null">orderIdFk=#{orderIdFk},</if>
|
|
|
|
|
<if test="totalPrice != null">totalPrice=#{totalPrice},</if>
|
|
|
|
|
<if test="locStorageCode != null">locStorageCode=#{locStorageCode},</if>
|
|
|
|
|
<if test="supplementNo != null">supplementNo=#{supplementNo},</if>
|
|
|
|
|
<if test="createUser != null">createUser=#{createUser},</if>
|
|
|
|
|
<if test="reviewUser != null">reviewUser=#{reviewUser},</if>
|
|
|
|
|
<if test="entrustEnd != null">entrustEnd=#{entrustEnd},</if>
|
|
|
|
|
<if test="auditTime != null">auditTime=#{auditTime},</if>
|
|
|
|
|
<if test="updateTime != null">updateTime=#{updateTime},</if>
|
|
|
|
|
<if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if>
|
|
|
|
|
<if test="fromSubInvCode != null">fromSubInvCode=#{fromSubInvCode},</if>
|
|
|
|
|
<if test="dept != null">dept=#{dept},</if>
|
|
|
|
|
|
|
|
|
|
<if test="billNo != null">
|
|
|
|
|
billNo=#{billNo},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="billdate != null">
|
|
|
|
|
billdate=#{billdate},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="corpId != null">
|
|
|
|
|
corpId=#{corpId},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="corpName != null">
|
|
|
|
|
corpName=#{corpName},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="billType != null">
|
|
|
|
|
billType=#{billType},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="billFlag != null">
|
|
|
|
|
billFlag=#{billFlag},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="thirdSysFk != null">
|
|
|
|
|
thirdSysFk=#{thirdSysFk},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="status != null">
|
|
|
|
|
status=#{status},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="statusInfo != null">
|
|
|
|
|
statusInfo=#{statusInfo},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="type != null">
|
|
|
|
|
type=#{type},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="sourceType != null">
|
|
|
|
|
sourceType=#{sourceType},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="printStatus != null">
|
|
|
|
|
printStatus=#{printStatus},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="unitIdFk != null">
|
|
|
|
|
unitIdFk=#{unitIdFk},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="customerId != null">
|
|
|
|
|
customerId=#{customerId},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="thirdOrderFk != null">
|
|
|
|
|
thirdOrderFk=#{thirdOrderFk},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="orderIdFk != null">
|
|
|
|
|
orderIdFk=#{orderIdFk},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="totalPrice != null">
|
|
|
|
|
totalPrice=#{totalPrice},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="locStorageCode != null">
|
|
|
|
|
locStorageCode=#{locStorageCode},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="supplementNo != null">
|
|
|
|
|
supplementNo=#{supplementNo},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createUser != null">
|
|
|
|
|
createUser=#{createUser},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="reviewUser != null">
|
|
|
|
|
reviewUser=#{reviewUser},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="entrustEnd != null">
|
|
|
|
|
entrustEnd=#{entrustEnd},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="auditTime != null">
|
|
|
|
|
auditTime=#{auditTime},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateTime != null">
|
|
|
|
|
updateTime=#{updateTime},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="invWarehouseCode != null">
|
|
|
|
|
invWarehouseCode=#{invWarehouseCode},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="fromSubInvCode != null">
|
|
|
|
|
fromSubInvCode=#{fromSubInvCode},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="dept != null">
|
|
|
|
|
dept=#{dept},
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
WHERE id = #{id}
|
|
|
|
|
</update>
|
|
|
|
@ -106,138 +156,154 @@
|
|
|
|
|
</update>
|
|
|
|
|
<select id="filterListOr" parameterType="com.glxp.sale.admin.req.inout.StockOrderFilterRequest"
|
|
|
|
|
resultType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
|
|
|
|
|
SELECT stock_order.* ,inv_warehouse.name invName, iws.name subInvName ,basic_bustype_local.name
|
|
|
|
|
billTypeName,iws2.name fromSubInvName,auth_dept.name deptName,auth_user.employeeName reviewUserName FROM
|
|
|
|
|
stock_order
|
|
|
|
|
SELECT stock_order.*,
|
|
|
|
|
inv_warehouse.name invName,
|
|
|
|
|
iws.name subInvName,
|
|
|
|
|
basic_bustype_local.name
|
|
|
|
|
billTypeName,
|
|
|
|
|
iws2.name fromSubInvName,
|
|
|
|
|
auth_dept.name deptName,
|
|
|
|
|
auth_user.employeeName reviewUserName
|
|
|
|
|
FROM stock_order
|
|
|
|
|
left join basic_bustype_local on stock_order.billType = basic_bustype_local.action
|
|
|
|
|
LEFT JOIN inv_warehouse ON stock_order.locStorageCode = inv_warehouse.`code`
|
|
|
|
|
LEFT JOIN inv_warehouse_sub ON stock_order.locStorageCode = inv_warehouse.`code`
|
|
|
|
|
LEFT JOIN inv_warehouse_sub iws ON stock_order.invWarehouseCode = iws.`code`
|
|
|
|
|
LEFT JOIN inv_warehouse_sub iws2 ON stock_order.fromSubInvCode = iws2.`code`
|
|
|
|
|
LEFT JOIN inv_warehouse_user on inv_warehouse_sub.code = inv_warehouse_user.`code`
|
|
|
|
|
left join auth_dept on stock_order.dept =auth_dept.code
|
|
|
|
|
left join auth_dept on stock_order.dept = auth_dept.code
|
|
|
|
|
left join auth_user on stock_order.reviewUser = auth_user.id
|
|
|
|
|
<where>
|
|
|
|
|
<if test="id != '' and id!=null">
|
|
|
|
|
and stock_order.id =#{id}
|
|
|
|
|
<if test="id != '' and id != null">
|
|
|
|
|
and stock_order.id = #{id}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="billNo != '' and billNo!=null">
|
|
|
|
|
and billNo LIKE concat('%',#{billNo},'%')
|
|
|
|
|
<if test="billNo != '' and billNo != null">
|
|
|
|
|
and billNo LIKE concat('%', #{billNo}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="billdate != '' and billdate!=null">
|
|
|
|
|
<if test="billdate != '' and billdate != null">
|
|
|
|
|
and billdate = #{billdate}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="corpId != '' and corpId!=null">
|
|
|
|
|
<if test="corpId != '' and corpId != null">
|
|
|
|
|
and corpId = #{corpId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="corpName != '' and corpName!=null">
|
|
|
|
|
and corpName LIKE concat('%',#{corpName},'%')
|
|
|
|
|
<if test="corpName != '' and corpName != null">
|
|
|
|
|
and corpName LIKE concat('%', #{corpName}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="billType != '' and billType!=null">
|
|
|
|
|
<if test="billType != '' and billType != null">
|
|
|
|
|
and billType = #{billType}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="billFlag != '' and billFlag!=null">
|
|
|
|
|
<if test="billFlag != '' and billFlag != null">
|
|
|
|
|
and billFlag = #{billFlag}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="thirdSysFk != '' and thirdSysFk!=null">
|
|
|
|
|
<if test="thirdSysFk != '' and thirdSysFk != null">
|
|
|
|
|
and thirdSysFk = #{thirdSysFk}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="status != '' and status!=null">
|
|
|
|
|
<if test="status != '' and status != null">
|
|
|
|
|
and stock_order.status = #{status}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="statusInfo != '' and statusInfo!=null">
|
|
|
|
|
<if test="statusInfo != '' and statusInfo != null">
|
|
|
|
|
and statusInfo = #{statusInfo}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="type != '' and type!=null">
|
|
|
|
|
<if test="type != '' and type != null">
|
|
|
|
|
and stock_order.type = #{type}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="sourceType != '' and sourceType!=null">
|
|
|
|
|
<if test="sourceType != '' and sourceType != null">
|
|
|
|
|
and sourceType = #{sourceType}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="printStatus != '' and printStatus!=null">
|
|
|
|
|
<if test="printStatus != '' and printStatus != null">
|
|
|
|
|
and printStatus = #{printStatus}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="unitIdFk != '' and unitIdFk!=null">
|
|
|
|
|
<if test="unitIdFk != '' and unitIdFk != null">
|
|
|
|
|
and unitIdFk = #{unitIdFk}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="localAction != '' and localAction!=null">
|
|
|
|
|
<if test="localAction != '' and localAction != null">
|
|
|
|
|
and billType = #{localAction}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="userId != '' and userId!=null">
|
|
|
|
|
and (invWarehouseCode in (select code from inv_warehouse_user WHERE userId =#{userId}) or
|
|
|
|
|
invWarehouseCode is null or invWarehouseCode='')
|
|
|
|
|
<if test="userId != '' and userId != null">
|
|
|
|
|
and (invWarehouseCode in (select code from inv_warehouse_user WHERE userId = #{userId}) or
|
|
|
|
|
invWarehouseCode is null or invWarehouseCode = '')
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="customerId != '' and customerId!=null">
|
|
|
|
|
<if test="customerId != '' and customerId != null">
|
|
|
|
|
and customerId = #{customerId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="thirdOrderFk != '' and thirdOrderFk!=null">
|
|
|
|
|
<if test="thirdOrderFk != '' and thirdOrderFk != null">
|
|
|
|
|
and thirdOrderFk = #{thirdOrderFk}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="orderIdFk != '' and orderIdFk!=null">
|
|
|
|
|
<if test="orderIdFk != '' and orderIdFk != null">
|
|
|
|
|
and orderIdFk = #{orderIdFk}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="totalPrice != '' and totalPrice!=null">
|
|
|
|
|
<if test="totalPrice != '' and totalPrice != null">
|
|
|
|
|
and totalPrice = #{totalPrice}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="locStorageCode != '' and locStorageCode!=null">
|
|
|
|
|
<if test="locStorageCode != '' and locStorageCode != null">
|
|
|
|
|
and locStorageCode = #{locStorageCode}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="invWarehouseCode != '' and invWarehouseCode!=null">
|
|
|
|
|
<if test="invWarehouseCode != '' and invWarehouseCode != null">
|
|
|
|
|
and invWarehouseCode = #{invWarehouseCode}
|
|
|
|
|
|
|
|
|
|
<if test="userId != '' and userId!=null">
|
|
|
|
|
and
|
|
|
|
|
stock_order.billType in
|
|
|
|
|
(select basic_bussiness_type.localAction from inv_bustype_user INNER JOIN basic_bussiness_type on
|
|
|
|
|
<if test="userId != '' and userId != null">
|
|
|
|
|
and stock_order.billType in
|
|
|
|
|
(select basic_bussiness_type.localAction
|
|
|
|
|
from inv_bustype_user
|
|
|
|
|
INNER JOIN basic_bussiness_type on
|
|
|
|
|
inv_bustype_user.scAction = basic_bussiness_type.action
|
|
|
|
|
WHERE userId =#{userId} and invWarehouseCode =#{invWarehouseCode}
|
|
|
|
|
WHERE userId = #{userId}
|
|
|
|
|
and invWarehouseCode = #{invWarehouseCode}
|
|
|
|
|
GROUP BY inv_bustype_user.id)
|
|
|
|
|
</if>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createUser!=null">
|
|
|
|
|
<if test="createUser != null">
|
|
|
|
|
and createUser = #{createUser}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="reviewUser!=null">
|
|
|
|
|
<if test="reviewUser != null">
|
|
|
|
|
and reviewUser = #{reviewUser}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="startTime!=null and startTime!=''">
|
|
|
|
|
<![CDATA[ and DATE_FORMAT(billdate, '%Y-%m-%d')>= DATE_FORMAT(#{startTime}, '%Y-%m-%d') ]]>
|
|
|
|
|
<if test="startTime != null and startTime != ''">
|
|
|
|
|
<![CDATA[
|
|
|
|
|
and DATE_FORMAT(billdate, '%Y-%m-%d') >= DATE_FORMAT(#{startTime}, '%Y-%m-%d')
|
|
|
|
|
]]>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="endTime!=null and endTime!=''">
|
|
|
|
|
<![CDATA[ and DATE_FORMAT(billdate, '%Y-%m-%d') <= DATE_FORMAT(#{endTime}, '%Y-%m-%d') ]]>
|
|
|
|
|
<if test="endTime != null and endTime != ''">
|
|
|
|
|
<![CDATA[
|
|
|
|
|
and DATE_FORMAT(billdate, '%Y-%m-%d') <= DATE_FORMAT(#{endTime}, '%Y-%m-%d')
|
|
|
|
|
]]>
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="startDate!=null and startDate!=''">
|
|
|
|
|
<![CDATA[ and DATE_FORMAT(billdate, '%Y-%m-%d')>= DATE_FORMAT(#{startDate}, '%Y-%m-%d') ]]>
|
|
|
|
|
<if test="startDate != null and startDate != ''">
|
|
|
|
|
<![CDATA[
|
|
|
|
|
and DATE_FORMAT(billdate, '%Y-%m-%d') >= DATE_FORMAT(#{startDate}, '%Y-%m-%d')
|
|
|
|
|
]]>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="endDate!=null and endDate!=''">
|
|
|
|
|
<![CDATA[ and DATE_FORMAT(billdate, '%Y-%m-%d') <= DATE_FORMAT(#{endDate}, '%Y-%m-%d') ]]>
|
|
|
|
|
<if test="endDate != null and endDate != ''">
|
|
|
|
|
<![CDATA[
|
|
|
|
|
and DATE_FORMAT(billdate, '%Y-%m-%d') <= DATE_FORMAT(#{endDate}, '%Y-%m-%d')
|
|
|
|
|
]]>
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<if test="userId!=null">
|
|
|
|
|
and inv_warehouse_user.userId =#{userId}
|
|
|
|
|
<if test="userId != null">
|
|
|
|
|
and inv_warehouse_user.userId = #{userId}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
group by stock_order.id
|
|
|
|
|
ORDER BY stock_order.updateTime DESC,id DESC
|
|
|
|
|
|
|
|
|
|
ORDER BY stock_order.updateTime DESC, id DESC
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="filterEntrust" parameterType="com.glxp.sale.admin.req.inout.StockOrderFilterRequest"
|
|
|
|
|
resultType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
|
|
|
|
|
SELECT stock_order.* FROM stock_order
|
|
|
|
|
SELECT stock_order.*
|
|
|
|
|
FROM stock_order
|
|
|
|
|
INNER JOIN basic_entrust_accept on locStorageCode = basic_entrust_accept.curInv
|
|
|
|
|
<where>
|
|
|
|
|
<if test="status != '' and status!=null">
|
|
|
|
|
<if test="status != '' and status != null">
|
|
|
|
|
and status = #{status}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="locStorageCode != '' and locStorageCode!=null">
|
|
|
|
|
<if test="locStorageCode != '' and locStorageCode != null">
|
|
|
|
|
and locStorageCode = #{locStorageCode}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="entrustUser != '' and entrustUser!=null">
|
|
|
|
|
<if test="entrustUser != '' and entrustUser != null">
|
|
|
|
|
and basic_entrust_accept.entrustUser = #{entrustUser}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
@ -248,37 +314,38 @@
|
|
|
|
|
|
|
|
|
|
<select id="findOne" parameterType="com.glxp.sale.admin.req.inout.StockOrderFilterRequest"
|
|
|
|
|
resultType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
|
|
|
|
|
select stock_order.*, auth_dept.name deptName FROM stock_order
|
|
|
|
|
select stock_order.*, auth_dept.name deptName
|
|
|
|
|
FROM stock_order
|
|
|
|
|
left join auth_dept on stock_order.dept = auth_dept.code
|
|
|
|
|
<where>
|
|
|
|
|
<if test="id != '' and id!=null">
|
|
|
|
|
and stock_order.id =#{id}
|
|
|
|
|
<if test="id != '' and id != null">
|
|
|
|
|
and stock_order.id = #{id}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="corpId != '' and corpId !=null">
|
|
|
|
|
and corpId =#{corpId}
|
|
|
|
|
<if test="corpId != '' and corpId != null">
|
|
|
|
|
and corpId = #{corpId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="billNo != '' and billNo !=null">
|
|
|
|
|
and billNo =#{billNo}
|
|
|
|
|
<if test="billNo != '' and billNo != null">
|
|
|
|
|
and billNo = #{billNo}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="billType != '' and billType !=null">
|
|
|
|
|
and billType =#{billType}
|
|
|
|
|
<if test="billType != '' and billType != null">
|
|
|
|
|
and billType = #{billType}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="customerId != '' and customerId !=null">
|
|
|
|
|
and customerId =#{customerId}
|
|
|
|
|
<if test="customerId != '' and customerId != null">
|
|
|
|
|
and customerId = #{customerId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="thirdOrderFk != '' and thirdOrderFk !=null">
|
|
|
|
|
and thirdOrderFk =#{thirdOrderFk}
|
|
|
|
|
<if test="thirdOrderFk != '' and thirdOrderFk != null">
|
|
|
|
|
and thirdOrderFk = #{thirdOrderFk}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="orderIdFk != '' and orderIdFk !=null">
|
|
|
|
|
and orderIdFk =#{orderIdFk}
|
|
|
|
|
<if test="orderIdFk != '' and orderIdFk != null">
|
|
|
|
|
and orderIdFk = #{orderIdFk}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createUser!=null">
|
|
|
|
|
<if test="createUser != null">
|
|
|
|
|
and createUser = #{createUser}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="reviewUser!=null">
|
|
|
|
|
<if test="reviewUser != null">
|
|
|
|
|
and reviewUser = #{reviewUser}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="invWarehouseCode != '' and invWarehouseCode!=null">
|
|
|
|
|
<if test="invWarehouseCode != '' and invWarehouseCode != null">
|
|
|
|
|
and invWarehouseCode = #{invWarehouseCode}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
@ -287,18 +354,44 @@
|
|
|
|
|
|
|
|
|
|
<select id="listOrderPrint" parameterType="com.glxp.sale.admin.req.inout.StockOrderFilterRequest"
|
|
|
|
|
resultType="com.glxp.sale.admin.entity.inout.StockOrderPrintEntity">
|
|
|
|
|
SELECT stock_order.*, stock_order.remark orderRemark,stock_order_detail.productId,
|
|
|
|
|
stock_order_detail.productName,auth_user.employeeName reviewUserName,
|
|
|
|
|
stock_order_detail.spec, stock_order_detail.batchNo, stock_order_detail.productDate,
|
|
|
|
|
stock_order_detail.expireDate, stock_order_detail.count, stock_order_detail.sweepCount,
|
|
|
|
|
stock_order_detail.ylqxzcrbarmc,stock_order_detail.manufactory, stock_order_detail.zczbhhzbapzbh,
|
|
|
|
|
stock_order_detail.price,inv_warehouse.name locInv,inv_warehouse_sub.name subInv,basic_products.spmc,
|
|
|
|
|
basic_products.cpms,basic_udirel.measname,auth_dept.`name`
|
|
|
|
|
deptName,basic_products.basicPrductRemak1
|
|
|
|
|
,basic_products.basicPrductRemak2,basic_products.basicPrductRemak3,basic_products.basicPrductRemak4,basic_products.basicPrductRemak5,basic_products.basicPrductRemak6
|
|
|
|
|
,basic_products.basicPrductRemak7,basic_products.basicPrductRemak8,
|
|
|
|
|
thr_products.code thrCode,thr_products.name thrName,thr_products.measname thrMeasname,thr_products.spec thrSpec,
|
|
|
|
|
thr_products.registerNo thrRegisterNo,thr_products.manufactory thrManufactory
|
|
|
|
|
SELECT stock_order.*,
|
|
|
|
|
stock_order.remark orderRemark,
|
|
|
|
|
stock_order_detail.productId,
|
|
|
|
|
stock_order_detail.productName,
|
|
|
|
|
auth_user.employeeName reviewUserName,
|
|
|
|
|
stock_order_detail.spec,
|
|
|
|
|
stock_order_detail.batchNo,
|
|
|
|
|
stock_order_detail.productDate,
|
|
|
|
|
stock_order_detail.expireDate,
|
|
|
|
|
stock_order_detail.count,
|
|
|
|
|
stock_order_detail.sweepCount,
|
|
|
|
|
stock_order_detail.ylqxzcrbarmc,
|
|
|
|
|
stock_order_detail.manufactory,
|
|
|
|
|
stock_order_detail.zczbhhzbapzbh,
|
|
|
|
|
stock_order_detail.price,
|
|
|
|
|
inv_warehouse.name locInv,
|
|
|
|
|
inv_warehouse_sub.name subInv,
|
|
|
|
|
basic_products.spmc,
|
|
|
|
|
basic_products.cpms,
|
|
|
|
|
basic_udirel.measname,
|
|
|
|
|
auth_dept.`name`
|
|
|
|
|
deptName,
|
|
|
|
|
basic_products.basicPrductRemak1
|
|
|
|
|
,
|
|
|
|
|
basic_products.basicPrductRemak2,
|
|
|
|
|
basic_products.basicPrductRemak3,
|
|
|
|
|
basic_products.basicPrductRemak4,
|
|
|
|
|
basic_products.basicPrductRemak5,
|
|
|
|
|
basic_products.basicPrductRemak6
|
|
|
|
|
,
|
|
|
|
|
basic_products.basicPrductRemak7,
|
|
|
|
|
basic_products.basicPrductRemak8,
|
|
|
|
|
thr_products.code thrCode,
|
|
|
|
|
thr_products.name thrName,
|
|
|
|
|
thr_products.measname thrMeasname,
|
|
|
|
|
thr_products.spec thrSpec,
|
|
|
|
|
thr_products.registerNo thrRegisterNo,
|
|
|
|
|
thr_products.manufactory thrManufactory
|
|
|
|
|
FROM stock_order
|
|
|
|
|
INNER JOIN stock_order_detail on stock_order.id = stock_order_detail.orderIdFk
|
|
|
|
|
LEFT JOIN inv_warehouse ON stock_order.locStorageCode = inv_warehouse.`code`
|
|
|
|
@ -310,38 +403,64 @@
|
|
|
|
|
left join thr_products on basic_udirel.mainId = thr_products.`code`
|
|
|
|
|
left join auth_user on stock_order.reviewUser = auth_user.id
|
|
|
|
|
<where>
|
|
|
|
|
<if test="id != '' and id!=null">
|
|
|
|
|
and stock_order.id =#{id}
|
|
|
|
|
<if test="id != '' and id != null">
|
|
|
|
|
and stock_order.id = #{id}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="corpId != '' and corpId !=null">
|
|
|
|
|
and stock_order.corpId =#{corpId}
|
|
|
|
|
<if test="corpId != '' and corpId != null">
|
|
|
|
|
and stock_order.corpId = #{corpId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="billNo != '' and billNo !=null">
|
|
|
|
|
and stock_order.billNo =#{billNo}
|
|
|
|
|
<if test="billNo != '' and billNo != null">
|
|
|
|
|
and stock_order.billNo = #{billNo}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="customerId != '' and customerId !=null">
|
|
|
|
|
and stock_order.customerId =#{customerId}
|
|
|
|
|
<if test="customerId != '' and customerId != null">
|
|
|
|
|
and stock_order.customerId = #{customerId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="invWarehouseCode != '' and invWarehouseCode!=null">
|
|
|
|
|
<if test="invWarehouseCode != '' and invWarehouseCode != null">
|
|
|
|
|
and invWarehouseCode = #{invWarehouseCode}
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
</where>
|
|
|
|
|
group by stock_order_detail.id
|
|
|
|
|
ORDER BY id DESC
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="listCodePrint" parameterType="com.glxp.sale.admin.req.inout.StockOrderFilterRequest"
|
|
|
|
|
resultType="com.glxp.sale.admin.entity.inout.StockOrderPrintEntity">
|
|
|
|
|
select io_codes.code udiCode,basic_udirel.id productId,basic_products.cpmctymc productName,basic_products.ggxh
|
|
|
|
|
spec,io_codes.batchNo,io_codes.produceDate productDate,io_codes.expireDate ,io_codes.serialNo,io_codes.count,
|
|
|
|
|
basic_products.ylqxzcrbarmc,basic_udirel.manufactory,basic_udirel.measname,
|
|
|
|
|
inv_warehouse.name locInv, inv_warehouse_sub.name subInv, basic_products.spmc,
|
|
|
|
|
basic_products.cpms,io_codes.nameCode,io_codes.relId,basic_products.basicPrductRemak1
|
|
|
|
|
,basic_products.basicPrductRemak2,basic_products.basicPrductRemak3,basic_products.basicPrductRemak4,basic_products.basicPrductRemak5,basic_products.basicPrductRemak6
|
|
|
|
|
,basic_products.basicPrductRemak7,basic_products.basicPrductRemak8,
|
|
|
|
|
thr_products.code thrCode,thr_products.name thrName,thr_products.measname thrMeasname,thr_products.spec thrSpec,
|
|
|
|
|
thr_products.registerNo thrRegisterNo,thr_products.manufactory thrManufactory
|
|
|
|
|
select io_codes.code udiCode,
|
|
|
|
|
basic_udirel.id productId,
|
|
|
|
|
basic_products.cpmctymc productName,
|
|
|
|
|
basic_products.ggxh
|
|
|
|
|
spec,
|
|
|
|
|
io_codes.batchNo,
|
|
|
|
|
io_codes.produceDate productDate,
|
|
|
|
|
io_codes.expireDate,
|
|
|
|
|
io_codes.serialNo,
|
|
|
|
|
io_codes.count,
|
|
|
|
|
basic_products.ylqxzcrbarmc,
|
|
|
|
|
basic_udirel.manufactory,
|
|
|
|
|
basic_udirel.measname,
|
|
|
|
|
inv_warehouse.name locInv,
|
|
|
|
|
inv_warehouse_sub.name subInv,
|
|
|
|
|
basic_products.spmc,
|
|
|
|
|
basic_products.cpms,
|
|
|
|
|
io_codes.nameCode,
|
|
|
|
|
io_codes.relId,
|
|
|
|
|
basic_products.basicPrductRemak1
|
|
|
|
|
,
|
|
|
|
|
basic_products.basicPrductRemak2,
|
|
|
|
|
basic_products.basicPrductRemak3,
|
|
|
|
|
basic_products.basicPrductRemak4,
|
|
|
|
|
basic_products.basicPrductRemak5,
|
|
|
|
|
basic_products.basicPrductRemak6
|
|
|
|
|
,
|
|
|
|
|
basic_products.basicPrductRemak7,
|
|
|
|
|
basic_products.basicPrductRemak8,
|
|
|
|
|
thr_products.code thrCode,
|
|
|
|
|
thr_products.name thrName,
|
|
|
|
|
thr_products.measname thrMeasname,
|
|
|
|
|
thr_products.spec thrSpec,
|
|
|
|
|
thr_products.registerNo thrRegisterNo,
|
|
|
|
|
thr_products.manufactory thrManufactory
|
|
|
|
|
from io_codes
|
|
|
|
|
INNER JOIN basic_udirel on io_codes.relId = basic_udirel.id
|
|
|
|
|
INNER JOIN basic_products on basic_products.uuid = basic_udirel.uuid
|
|
|
|
@ -349,13 +468,11 @@
|
|
|
|
|
left join inv_warehouse_sub on io_codes.invWarehouseCode = inv_warehouse_sub.code
|
|
|
|
|
left join thr_products on basic_udirel.mainId = thr_products.`code`
|
|
|
|
|
<where>
|
|
|
|
|
<if test="orderId != '' and orderId !=null">
|
|
|
|
|
and io_codes.orderId =#{orderId}
|
|
|
|
|
<if test="orderId != '' and orderId != null">
|
|
|
|
|
and io_codes.orderId = #{orderId}
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
</where>
|
|
|
|
|
group by io_codes.id
|
|
|
|
|
order by io_codes.id
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectSupplementOrderList" resultType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
|
|
|
|
@ -395,5 +512,4 @@
|
|
|
|
|
from stock_order
|
|
|
|
|
where billNo = #{billNo}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|