出库
This commit is contained in:
@@ -92,44 +92,42 @@
|
|||||||
<sql id="selectRkRecordVo">
|
<sql id="selectRkRecordVo">
|
||||||
SELECT
|
SELECT
|
||||||
rr.*,
|
rr.*,
|
||||||
|
COALESCE(rr.real_qty, 0) * COALESCE(rr.ht_dj, 0) AS total_amount,
|
||||||
/* 总金额 */
|
|
||||||
COALESCE(rr.real_qty,0) * COALESCE(rr.ht_dj,0) AS total_amount,
|
|
||||||
|
|
||||||
su.nick_name AS operator_name,
|
su.nick_name AS operator_name,
|
||||||
mt.type_name AS wl_type_name,
|
mt.type_name AS wl_type_name,
|
||||||
COALESCE(sit.type_name, sot.type_name) AS operation_type_name,
|
COALESCE(sit.type_name, sot.type_name) AS operation_type_name,
|
||||||
|
|
||||||
-- 小仓
|
|
||||||
wh.warehouse_name AS warehouse_name,
|
wh.warehouse_name AS warehouse_name,
|
||||||
|
|
||||||
-- 大仓
|
|
||||||
wh.parent_warehouse_code AS parent_warehouse_code,
|
wh.parent_warehouse_code AS parent_warehouse_code,
|
||||||
wh.parent_warehouse_name AS parent_warehouse_name,
|
wh.parent_warehouse_name AS parent_warehouse_name,
|
||||||
|
|
||||||
ct.team_name AS team_name,
|
ct.team_name AS team_name,
|
||||||
|
gj.gys_jh_id AS gys_jh_id
|
||||||
-- 新增 gys_jh 主键
|
|
||||||
gj.id AS gys_jh_id
|
|
||||||
|
|
||||||
FROM rk_record rr
|
FROM rk_record rr
|
||||||
LEFT JOIN sys_user su ON rr.operator = su.user_id
|
LEFT JOIN sys_user su
|
||||||
LEFT JOIN material_type mt ON rr.wl_type = mt.type_code
|
ON rr.operator = su.user_id
|
||||||
LEFT JOIN stock_in_type sit ON rr.operation_type = sit.type_code
|
LEFT JOIN material_type mt
|
||||||
LEFT JOIN stock_out_type sot ON rr.operation_type = sot.type_code
|
ON rr.wl_type = mt.type_code
|
||||||
|
LEFT JOIN stock_in_type sit
|
||||||
LEFT JOIN warehouse_info wh ON rr.cangku = wh.warehouse_code
|
ON rr.operation_type = sit.type_code
|
||||||
|
LEFT JOIN stock_out_type sot
|
||||||
|
ON rr.operation_type = sot.type_code
|
||||||
|
LEFT JOIN warehouse_info wh
|
||||||
|
ON rr.cangku = wh.warehouse_code
|
||||||
LEFT JOIN construction_team ct
|
LEFT JOIN construction_team ct
|
||||||
ON rr.team_code = ct.team_code
|
ON rr.team_code = ct.team_code
|
||||||
AND ct.is_delete = '0'
|
AND ct.is_delete = '0'
|
||||||
/* 新增关联 */
|
LEFT JOIN (
|
||||||
LEFT JOIN gys_jh gj
|
SELECT
|
||||||
|
sap_no,
|
||||||
|
wl_no,
|
||||||
|
xm_no,
|
||||||
|
MIN(id) AS gys_jh_id
|
||||||
|
FROM gys_jh
|
||||||
|
WHERE is_delete = '0'
|
||||||
|
GROUP BY sap_no, wl_no, xm_no
|
||||||
|
) gj
|
||||||
ON rr.sap_no = gj.sap_no
|
ON rr.sap_no = gj.sap_no
|
||||||
AND rr.wl_no = gj.wl_no
|
AND rr.wl_no = gj.wl_no
|
||||||
AND rr.xm_no = gj.xm_no
|
AND rr.xm_no = gj.xm_no
|
||||||
AND gj.is_delete = '0'
|
|
||||||
|
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- ===================== 查询列表 ===================== -->
|
<!-- ===================== 查询列表 ===================== -->
|
||||||
@@ -296,7 +294,7 @@
|
|||||||
ORDER BY
|
ORDER BY
|
||||||
rr.exec_status = '0' DESC,
|
rr.exec_status = '0' DESC,
|
||||||
rr.create_time ASC,
|
rr.create_time ASC,
|
||||||
gj.id ASC
|
gj.gys_jh_id ASC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectRkRecordByIds" resultMap="RkRecordResult">
|
<select id="selectRkRecordByIds" resultMap="RkRecordResult">
|
||||||
|
|||||||
Reference in New Issue
Block a user