入库相关功能
This commit is contained in:
@@ -6,30 +6,30 @@
|
||||
|
||||
<!-- ==================== ResultMap ==================== -->
|
||||
<resultMap type="RkBill" id="RkBillResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="wlType" column="wl_type"/>
|
||||
<result property="wlTypeName" column="wl_type_name"/>
|
||||
<result property="id" column="id"/>
|
||||
<result property="wlType" column="wl_type"/>
|
||||
<result property="wlTypeName" column="wl_type_name"/>
|
||||
|
||||
<result property="cangku" column="cangku"/>
|
||||
<result property="warehouseName" column="warehouse_name"/>
|
||||
<result property="parentWarehouseName" column="parent_warehouse_name"/>
|
||||
<result property="cangku" column="cangku"/>
|
||||
<result property="warehouseName" column="warehouse_name"/>
|
||||
<result property="parentWarehouseName" column="parent_warehouse_name"/>
|
||||
|
||||
<result property="billNo" column="bill_no"/>
|
||||
<result property="billNo" column="bill_no"/>
|
||||
|
||||
<result property="operationType" column="operation_type"/>
|
||||
<result property="operationTypeName" column="operation_type_name"/>
|
||||
<result property="operationType" column="operation_type"/>
|
||||
<result property="operationTypeName" column="operation_type_name"/>
|
||||
|
||||
<result property="bizType" column="biz_type"/>
|
||||
<result property="operationTime" column="operation_time"/>
|
||||
<result property="execStatus" column="exec_status"/>
|
||||
<result property="bizType" column="biz_type"/>
|
||||
<result property="operationTime" column="operation_time"/>
|
||||
<result property="execStatus" column="exec_status"/>
|
||||
|
||||
<result property="operator" column="operator"/>
|
||||
<result property="operatorName" column="operator_name"/>
|
||||
<result property="operator" column="operator"/>
|
||||
<result property="operatorName" column="operator_name"/>
|
||||
|
||||
<result property="teamCode" column="team_code"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="isDelivery" column="is_delivery"/>
|
||||
<result property="isDelete" column="is_delete"/>
|
||||
<result property="teamCode" column="team_code"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="isDelivery" column="is_delivery"/>
|
||||
<result property="isDelete" column="is_delete"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- ==================== Base Select ==================== -->
|
||||
@@ -49,44 +49,25 @@
|
||||
rb.is_delivery,
|
||||
rb.is_delete,
|
||||
|
||||
-- 物资类型
|
||||
mt.type_name AS wl_type_name,
|
||||
|
||||
-- 出 / 入库类型名称
|
||||
COALESCE(sit.type_name, sot.type_name) AS operation_type_name,
|
||||
|
||||
-- 操作人
|
||||
su.nick_name AS operator_name,
|
||||
|
||||
-- 小仓
|
||||
wh.warehouse_name AS warehouse_name,
|
||||
|
||||
-- 大仓(冗余字段)
|
||||
wh.parent_warehouse_name AS parent_warehouse_name
|
||||
|
||||
FROM rk_bill rb
|
||||
|
||||
-- 仓库(小仓)
|
||||
LEFT JOIN warehouse_info wh
|
||||
ON rb.cangku = wh.warehouse_code
|
||||
AND wh.status = 1
|
||||
|
||||
-- 物资类型
|
||||
LEFT JOIN material_type mt
|
||||
ON rb.wl_type = mt.type_code
|
||||
AND mt.status = 1
|
||||
|
||||
-- 入库类型
|
||||
LEFT JOIN stock_in_type sit
|
||||
ON rb.operation_type = sit.type_code
|
||||
AND sit.status = 1
|
||||
|
||||
-- 出库类型
|
||||
LEFT JOIN stock_out_type sot
|
||||
ON rb.operation_type = sot.type_code
|
||||
AND (sot.is_delete = '0' OR sot.is_delete IS NULL)
|
||||
|
||||
-- 操作人
|
||||
LEFT JOIN sys_user su
|
||||
ON rb.operator = su.user_id
|
||||
</sql>
|
||||
@@ -95,24 +76,67 @@
|
||||
<select id="selectRkBillList" parameterType="RkBill" resultMap="RkBillResult">
|
||||
<include refid="selectRkBillVo"/>
|
||||
<where>
|
||||
<if test="wlType != null">AND rb.wl_type = #{wlType}</if>
|
||||
<if test="cangku != null and cangku != ''">AND rb.cangku = #{cangku}</if>
|
||||
<if test="billNo != null and billNo != ''">AND rb.bill_no = #{billNo}</if>
|
||||
<if test="operationType != null">AND rb.operation_type = #{operationType}</if>
|
||||
<if test="bizType != null">AND rb.biz_type = #{bizType}</if>
|
||||
<if test="operationTime != null">AND rb.operation_time = #{operationTime}</if>
|
||||
<!-- 时间区间(新增) -->
|
||||
|
||||
<if test="wlType != null and wlType != ''">
|
||||
AND rb.wl_type = #{wlType}
|
||||
</if>
|
||||
|
||||
<if test="cangku != null and cangku != ''">
|
||||
AND rb.cangku = #{cangku}
|
||||
</if>
|
||||
|
||||
<if test="billNo != null and billNo != ''">
|
||||
AND rb.bill_no = #{billNo}
|
||||
</if>
|
||||
|
||||
<if test="operationType != null and operationType != ''">
|
||||
AND rb.operation_type = #{operationType}
|
||||
</if>
|
||||
|
||||
<!-- 多 bizType -->
|
||||
<if test="bizTypeList != null and bizTypeList.size > 0">
|
||||
AND rb.biz_type IN
|
||||
<foreach collection="bizTypeList"
|
||||
item="bt"
|
||||
open="("
|
||||
separator=","
|
||||
close=")">
|
||||
#{bt}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="operationTime != null">
|
||||
AND rb.operation_time = #{operationTime}
|
||||
</if>
|
||||
|
||||
<if test="startDate != null">
|
||||
AND rb.operation_time >= #{startDate}
|
||||
</if>
|
||||
|
||||
<if test="endDate != null">
|
||||
AND rb.operation_time <= #{endDate}
|
||||
</if>
|
||||
<if test="execStatus != null">AND rb.exec_status = #{execStatus}</if>
|
||||
<if test="operator != null">AND rb.operator = #{operator}</if>
|
||||
<if test="teamCode != null and teamCode != ''">AND rb.team_code = #{teamCode}</if>
|
||||
<if test="isDelivery != null">AND rb.is_delivery = #{isDelivery}</if>
|
||||
<if test="isDelete != null">AND rb.is_delete = #{isDelete}</if>
|
||||
|
||||
<if test="execStatus != null and execStatus != ''">
|
||||
AND rb.exec_status = #{execStatus}
|
||||
</if>
|
||||
|
||||
<if test="operator != null">
|
||||
AND rb.operator = #{operator}
|
||||
</if>
|
||||
|
||||
<if test="teamCode != null and teamCode != ''">
|
||||
AND rb.team_code = #{teamCode}
|
||||
</if>
|
||||
|
||||
<if test="isDelivery != null and isDelivery != ''">
|
||||
AND rb.is_delivery = #{isDelivery}
|
||||
</if>
|
||||
|
||||
<if test="isDelete != null and isDelete != ''">
|
||||
AND rb.is_delete = #{isDelete}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
ORDER BY rb.exec_status ASC, rb.operation_time DESC
|
||||
</select>
|
||||
@@ -150,7 +174,6 @@
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
|
||||
<!-- ==================== Insert ==================== -->
|
||||
<insert id="insertRkBill"
|
||||
parameterType="com.zg.project.wisdom.domain.RkBill"
|
||||
@@ -191,22 +214,28 @@
|
||||
<update id="updateRkBill" parameterType="RkBill">
|
||||
UPDATE rk_bill
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="wlType != null">wl_type = #{wlType},</if>
|
||||
<if test="cangku != null">cangku = #{cangku},</if>
|
||||
<if test="wlType != null and wlType != ''">wl_type = #{wlType},</if>
|
||||
<if test="cangku != null and cangku != ''">cangku = #{cangku},</if>
|
||||
<if test="billNo != null and billNo != ''">bill_no = #{billNo},</if>
|
||||
<if test="operationType != null">operation_type = #{operationType},</if>
|
||||
<if test="bizType != null">biz_type = #{bizType},</if>
|
||||
<if test="operationType != null and operationType != ''">operation_type = #{operationType},</if>
|
||||
<if test="bizType != null and bizType != ''">biz_type = #{bizType},</if>
|
||||
<if test="operationTime != null">operation_time = #{operationTime},</if>
|
||||
<if test="execStatus != null">exec_status = #{execStatus},</if>
|
||||
<if test="execStatus != null and execStatus != ''">exec_status = #{execStatus},</if>
|
||||
<if test="operator != null">operator = #{operator},</if>
|
||||
<if test="teamCode != null">team_code = #{teamCode},</if>
|
||||
<if test="teamCode != null and teamCode != ''">team_code = #{teamCode},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="isDelivery != null">is_delivery = #{isDelivery},</if>
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
<if test="isDelivery != null and isDelivery != ''">is_delivery = #{isDelivery},</if>
|
||||
<if test="isDelete != null and isDelete != ''">is_delete = #{isDelete},</if>
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateExecStatusByBillNo">
|
||||
UPDATE rk_bill
|
||||
SET exec_status = #{execStatus}
|
||||
WHERE bill_no = #{billNo}
|
||||
</update>
|
||||
|
||||
<!-- ==================== Delete ==================== -->
|
||||
<delete id="deleteRkBillById" parameterType="Long">
|
||||
DELETE FROM rk_bill WHERE id = #{id}
|
||||
|
||||
Reference in New Issue
Block a user