|
|
|
@ -29,7 +29,8 @@
|
|
|
|
|
insert INTO stock_order(id, billNo, billdate, corpId, corpName, billType, billFlag,
|
|
|
|
|
thirdSysFk, status, statusInfo, type, sourceType,
|
|
|
|
|
printStatus, unitIdFk, customerId, thirdOrderFk, orderIdFk,
|
|
|
|
|
totalPrice, locStorageCode, supplementNo, createUser, reviewUser, entrustEnd,auditTime,updateTime,invWarehouseCode)
|
|
|
|
|
totalPrice, locStorageCode, supplementNo, createUser, reviewUser, entrustEnd, auditTime,
|
|
|
|
|
updateTime, invWarehouseCode)
|
|
|
|
|
values (#{id},
|
|
|
|
|
#{billNo},
|
|
|
|
|
#{billdate},
|
|
|
|
@ -43,7 +44,8 @@
|
|
|
|
|
#{type},
|
|
|
|
|
#{sourceType},
|
|
|
|
|
#{printStatus}, #{unitIdFk}, #{customerId}, #{thirdOrderFk}, #{orderIdFk}, #{totalPrice},
|
|
|
|
|
#{locStorageCode}, #{supplementNo}, #{createUser}, #{reviewUser}, #{entrustEnd},#{auditTime},#{updateTime},#{invWarehouseCode})
|
|
|
|
|
#{locStorageCode}, #{supplementNo}, #{createUser}, #{reviewUser}, #{entrustEnd}, #{auditTime},
|
|
|
|
|
#{updateTime}, #{invWarehouseCode})
|
|
|
|
|
</insert>
|
|
|
|
|
<update id="updateById" parameterType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
|
|
|
|
|
UPDATE stock_order
|
|
|
|
@ -103,7 +105,7 @@
|
|
|
|
|
<select id="filterListOr" parameterType="com.glxp.sale.admin.req.inout.StockOrderFilterRequest"
|
|
|
|
|
resultType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
|
|
|
|
|
SELECT stock_order.* FROM stock_order
|
|
|
|
|
LEFT JOIN inv_warehouse ON stock_order.locStorageCode = inv_warehouse.`code`
|
|
|
|
|
LEFT JOIN inv_warehouse ON stock_order.locStorageCode = inv_warehouse.`code`
|
|
|
|
|
LEFT JOIN inv_warehouse_sub ON inv_warehouse_sub.parentId = inv_warehouse.`code`
|
|
|
|
|
LEFT JOIN inv_warehouse_user on inv_warehouse_sub.code = inv_warehouse_user.`code`
|
|
|
|
|
<where>
|
|
|
|
@ -149,6 +151,12 @@
|
|
|
|
|
<if test="unitIdFk != '' and unitIdFk!=null">
|
|
|
|
|
and unitIdFk = #{unitIdFk}
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="userId!=null">
|
|
|
|
|
and (invWarehouseCode in (select code from inv_warehouse_user WHERE userId =#{userId}) or
|
|
|
|
|
invWarehouseCode is null)
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="customerId != '' and customerId!=null">
|
|
|
|
|
and customerId = #{customerId}
|
|
|
|
|
</if>
|
|
|
|
@ -164,9 +172,8 @@
|
|
|
|
|
<if test="locStorageCode != '' and locStorageCode!=null">
|
|
|
|
|
and locStorageCode = #{locStorageCode}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="unionUser != '' and unionUser!=null">
|
|
|
|
|
and ((createUser =#{unionUser} or reviewUser =#{unionUser}) or (reviewUser is null and createUser is
|
|
|
|
|
null) )
|
|
|
|
|
<if test="invWarehouseCode != '' and invWarehouseCode!=null">
|
|
|
|
|
and invWarehouseCode = #{invWarehouseCode}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createUser!=null">
|
|
|
|
|
and createUser = #{createUser}
|
|
|
|
@ -183,7 +190,6 @@
|
|
|
|
|
<if test="userId!=null">
|
|
|
|
|
and inv_warehouse_user.userId =#{userId}
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
</where>
|
|
|
|
|
group by stock_order.id
|
|
|
|
|
ORDER BY id DESC
|
|
|
|
@ -242,7 +248,9 @@
|
|
|
|
|
<if test="reviewUser!=null">
|
|
|
|
|
and reviewUser = #{reviewUser}
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="invWarehouseCode != '' and invWarehouseCode!=null">
|
|
|
|
|
and invWarehouseCode = #{invWarehouseCode}
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
limit 1
|
|
|
|
|
</select>
|
|
|
|
@ -257,7 +265,7 @@
|
|
|
|
|
stock_order_detail on
|
|
|
|
|
stock_order.id =
|
|
|
|
|
stock_order_detail.orderIdFk
|
|
|
|
|
LEFT JOIN inv_warehouse ON stock_order.locStorageCode = inv_warehouse.`code`
|
|
|
|
|
LEFT JOIN inv_warehouse ON stock_order.locStorageCode = inv_warehouse.`code`
|
|
|
|
|
LEFT JOIN inv_warehouse_sub ON inv_warehouse_sub.parentId = inv_warehouse.`code`
|
|
|
|
|
LEFT JOIN inv_warehouse_user on inv_warehouse_sub.code = inv_warehouse_user.`code`
|
|
|
|
|
<where>
|
|
|
|
@ -273,6 +281,13 @@
|
|
|
|
|
<if test="customerId != '' and customerId !=null">
|
|
|
|
|
and stock_order.customerId =#{customerId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="invWarehouseCode != '' and invWarehouseCode!=null">
|
|
|
|
|
and invWarehouseCode = #{invWarehouseCode}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="userId!=null">
|
|
|
|
|
and (invWarehouseCode in (select code from inv_warehouse_user WHERE userId =#{userId}) or
|
|
|
|
|
invWarehouseCode is null)
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
</where>
|
|
|
|
|
group by stock_order_detail.id
|
|
|
|
|