From f0a432d2c5918740dd6c7c428ef29ed9f2e55fb0 Mon Sep 17 00:00:00 2001 From: ZY <zc857179121@qq.com> Date: 星期六, 20 七月 2024 17:03:53 +0800 Subject: [PATCH] 视图sql提交 --- src/main/webapp/views/locDetlStatis/locDetlStatis.html | 5 +++-- src/main/resources/mapper/LocDetlMapper.xml | 8 ++++++-- src/main/resources/application.yml | 2 +- src/main/java/asr_show_diff.sql | 44 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 54 insertions(+), 5 deletions(-) diff --git a/src/main/java/asr_show_diff.sql b/src/main/java/asr_show_diff.sql new file mode 100644 index 0000000..6b1df35 --- /dev/null +++ b/src/main/java/asr_show_diff.sql @@ -0,0 +1,44 @@ +SELECT SUM + ( asrsQty ) asrsQty, + SUM ( erpQty ) erpQty, + matnr, + specs, + maktx +FROM + ( + SELECT CAST + ( SUM ( qty ) AS INT ) asrsQty, + 0 AS erpQty, + matnr, + specs, + maktx + FROM + asr_loc_detl + GROUP BY + matnr, + specs, + maktx UNION ALL + SELECT + 0, + CAST ( SUM ( numis ) AS INT ), + itemid, + itemcode, + itemname + FROM + ( + SELECT + * + FROM + OPENROWSET ( 'SQLOLEDB', '192.168.1.147,1800'; 'XGMLK'; 'xunda0413', XDLinkLK.dbo.vwErpLKStorage ) + WHERE + LKName = '涓壃' + ) a + GROUP BY + itemid, + itemcode, + itemname + ) b WHERE 1=1 and matnr not in (select matnr from man_order_detl) +GROUP BY + matnr, + specs, + maktx \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 2295b25..f1f1d1a 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,3 +1,3 @@ spring: profiles: - active: mac \ No newline at end of file + active: win \ No newline at end of file diff --git a/src/main/resources/mapper/LocDetlMapper.xml b/src/main/resources/mapper/LocDetlMapper.xml index 67a1dcf..b4459a5 100644 --- a/src/main/resources/mapper/LocDetlMapper.xml +++ b/src/main/resources/mapper/LocDetlMapper.xml @@ -419,8 +419,11 @@ SELECT * FROM( SELECT ROW_NUMBER ( ) OVER ( ORDER BY d.matnr ) AS row, * FROM ( SELECT * FROM asr_show_diff WHERE 1 = 1 - <if test="different != null and different "> - and asrsQty = erpQty + <if test="different != null and different == 1 "> + and asrsQty != erpQty + </if> + <if test="different != null and different == 0 "> + and asrsQty == erpQty </if> <if test="matnr != null"> AND matnr like #{matnr} @@ -433,6 +436,7 @@ </if> ) d ) e WHERE 1=1 and e.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) </select> + <select id="asrsAndErpCount" resultType="java.lang.Long"> SELECT count(*) FROM asr_show_diff WHERE 1 = 1 and asrsQty != erpQty <if test="matnr != null"> diff --git a/src/main/webapp/views/locDetlStatis/locDetlStatis.html b/src/main/webapp/views/locDetlStatis/locDetlStatis.html index c2b9f5a..7e34855 100644 --- a/src/main/webapp/views/locDetlStatis/locDetlStatis.html +++ b/src/main/webapp/views/locDetlStatis/locDetlStatis.html @@ -32,7 +32,9 @@ </div> <div class="layui-inline"> <div class="layui-input-inline"> - <input name="different" type="checkbox" lay-skin="switch" value="true" lay-text="鏄剧ず宸紓|鏄剧ず鍏ㄩ儴" lay-filter="different" > + <input name="different" type="radio" value="0" title="鏄剧ず鍏ㄩ儴" checked> + <input name="different" type="radio" value="1" title="鏄剧ず宸紓"> + </div> </div> <!-- 寰呮坊鍔� --> @@ -41,7 +43,6 @@ </button> <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset">閲嶇疆 </button> - </div> <!-- <div class="layui-inline">--> <!-- <fieldset class="layui-elem-field">--> -- Gitblit v1.9.1