From f14c50cb0036d3ddd655ce4e34732ba396a836c4 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期二, 30 五月 2023 12:42:03 +0800
Subject: [PATCH] optimize 统计
---
java110-db/src/main/resources/mapper/store/AllocationUserStorehouseServiceDaoImplMapper.xml | 20 +++++++++++++++++++-
1 files changed, 19 insertions(+), 1 deletions(-)
diff --git a/java110-db/src/main/resources/mapper/store/AllocationUserStorehouseServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/store/AllocationUserStorehouseServiceDaoImplMapper.xml
index db61ce1..aa72afa 100644
--- a/java110-db/src/main/resources/mapper/store/AllocationUserStorehouseServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/store/AllocationUserStorehouseServiceDaoImplMapper.xml
@@ -119,11 +119,15 @@
resId,t.res_name,t.res_name resName,t.start_user_id,t.start_user_id startUserId,t.start_user_name,
t.start_user_name startUserName,t.aus_id,t.aus_id ausId,t.b_id,t.b_id
bId,t.stock,t.give_quantity,t.give_quantity giveQuantity,t.create_time createTime,rst.name rstName,rss.spec_name
- specName
+ specName,td1.name unitCodeName,td2.name miniUnitCodeName,rst1.name parentRstName,rs.is_fixed isFixed,rs.res_code resCode,td3.name isFixedName
from allocation_user_storehouse t
left join resource_store rs on t.res_id = rs.res_id and rs.status_cd = '0'
left join resource_store_type rst on rs.rst_id = rst.rst_id and rst.status_cd = '0'
+ left join resource_store_type rst1 on rs.parent_rst_id = rst1.rst_id and rst1.status_cd = '0'
left join resource_store_specification rss on rs.rss_id=rss.rss_id and rss.status_cd = '0'
+ left join t_dict td1 on rs.unit_code = td1.status_cd and td1.table_name = 'resource_store' and td1.table_columns = 'unit_code'
+ left join t_dict td2 on rs.mini_unit_code = td2.status_cd and td2.table_name = 'resource_store' and td2.table_columns = 'unit_code'
+ left join t_dict td3 on rs.is_fixed = td3.status_cd and td3.table_name = 'resource_store' and td3.table_columns = 'is_fixed'
where 1 = 1
<if test="acceptUserId !=null and acceptUserId != ''">
and t.accept_user_id= #{acceptUserId}
@@ -167,8 +171,14 @@
<if test="rstId !=null and rstId != ''">
and rs.rst_id= #{rstId}
</if>
+ <if test="parentRstId !=null and parentRstId != ''">
+ and rs.parent_rst_id= #{parentRstId}
+ </if>
<if test="rssId !=null and rssId != ''">
and rs.rss_id= #{rssId}
+ </if>
+ <if test="isFixed !=null and isFixed != ''">
+ and rs.is_fixed= #{isFixed}
</if>
order by t.create_time desc
<if test="page != -1 and page != null ">
@@ -229,6 +239,8 @@
left join resource_store rs on t.res_id = rs.res_id and rs.status_cd = '0'
left join resource_store_type rst on rs.rst_id = rst.rst_id and rst.status_cd = '0'
left join resource_store_specification rss on rs.rss_id=rss.rss_id and rss.status_cd = '0'
+ left join t_dict td1 on rs.unit_code = td1.status_cd and td1.table_name = 'resource_store' and td1.table_columns = 'unit_code'
+ left join t_dict td2 on rs.mini_unit_code = td2.status_cd and td2.table_name = 'resource_store' and td2.table_columns = 'unit_code'
where 1 =1
<if test="acceptUserId !=null and acceptUserId != ''">
and t.accept_user_id= #{acceptUserId}
@@ -272,6 +284,12 @@
<if test="rstId !=null and rstId != ''">
and rs.rst_id= #{rstId}
</if>
+ <if test="isFixed !=null and isFixed != ''">
+ and rs.is_fixed= #{isFixed}
+ </if>
+ <if test="parentRstId !=null and parentRstId != ''">
+ and rs.parent_rst_id= #{parentRstId}
+ </if>
<if test="rssId !=null and rssId != ''">
and rs.rss_id= #{rssId}
</if>
--
Gitblit v1.8.0