From 7a1784f38754af5ac3b2ee7f8e1cf75220f4ade4 Mon Sep 17 00:00:00 2001 From: shilei <798989044@qq.com> Date: Thu, 14 Mar 2024 11:53:41 +0800 Subject: [PATCH] =?UTF-8?q?#E10-04#=20=E4=BC=98=E5=8C=96=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=94=B6=E6=AC=BE=E3=80=81=E9=A1=B9=E7=9B=AE=E5=90=88=E5=90=8C?= =?UTF-8?q?=E6=94=B6=E6=AC=BE=E9=87=91=E9=A2=9D=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/HrmSelfHelpController.java | 120 +++++++++--------- 1 file changed, 59 insertions(+), 61 deletions(-) diff --git a/src/main/java/com/weaver/seconddev/jcldoor/controller/HrmSelfHelpController.java b/src/main/java/com/weaver/seconddev/jcldoor/controller/HrmSelfHelpController.java index dbf40c0..62ad625 100644 --- a/src/main/java/com/weaver/seconddev/jcldoor/controller/HrmSelfHelpController.java +++ b/src/main/java/com/weaver/seconddev/jcldoor/controller/HrmSelfHelpController.java @@ -1525,10 +1525,8 @@ public class HrmSelfHelpController { } - public static String null2String(String s,String def) { return s == null ?(def==null?"":def) : s; - } @@ -1564,26 +1562,26 @@ public class HrmSelfHelpController { String groupId = "weaver-ebuilder-form-service"; String sourceType = "LOGIC"; - String sql =" select sum(cast(t1.htzje as decimal(18,2))) as htzje," + - " sum(cast(t1.htyxje as decimal(18,2))) as htyxje," + - " sum(cast(t1.sumsk as decimal(18,2))) as sumsk " + - " from uf_jxhs_xmys t1 \n" + - " where t1.ysrq>='" +startday+"' and t1.ysrq<='"+endday+"' " + - " and ( t1.qyjl = '"+employeeId+"' "+ - " or t1.qyjl in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= '"+employeeId+"')\n" + - " or t1.ysry = '"+employeeId+"'\n" + - " or t1.ysry in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= '"+employeeId+"')\n" + - " or t1.dqfzr = '"+employeeId+"'\n" + - " or t1.dqfzr in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= '"+employeeId+"')\n" + - " or t1.tdjl = '"+employeeId+"'\n" + - " or t1.tdjl in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= '"+employeeId+"')\n" + - " or t1.tdfzr = '"+employeeId+"'\n" + - " or t1.tdfzr in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= '"+employeeId+"')\n" + - " or t1.jgfzr = '"+employeeId+"'\n" + - " or t1.jgfzr in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= '"+employeeId+"')\n" + - " or t1.dqzj = '"+employeeId+"'\n" + - " or t1.dqzj in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= '"+employeeId+"') " + - " ) " ; + String sql =" select CONVERT(sum(cast(t1.htzje as decimal(18,2))),CHAR) as htzje," + + " CONVERT(sum(cast(t1.htyxje as decimal(18,2))),CHAR) as htyxje," + + " CONVERT(sum(cast(t1.sumsk as decimal(18,2))),CHAR) as sumsk " + + " from uf_jxhs_xmys t1 \n" + + " where t1.ysrq>='" +startday+"' and t1.ysrq<='"+endday+"' " + + " and ( t1.qyjl = '"+employeeId+"' "+ + " or t1.qyjl in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= '"+employeeId+"')\n" + + " or t1.ysry = '"+employeeId+"'\n" + + " or t1.ysry in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= '"+employeeId+"')\n" + + " or t1.dqfzr = '"+employeeId+"'\n" + + " or t1.dqfzr in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= '"+employeeId+"')\n" + + " or t1.tdjl = '"+employeeId+"'\n" + + " or t1.tdjl in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= '"+employeeId+"')\n" + + " or t1.tdfzr = '"+employeeId+"'\n" + + " or t1.tdfzr in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= '"+employeeId+"')\n" + + " or t1.jgfzr = '"+employeeId+"'\n" + + " or t1.jgfzr in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= '"+employeeId+"')\n" + + " or t1.dqzj = '"+employeeId+"'\n" + + " or t1.dqzj in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= '"+employeeId+"') " + + " ) " ; Map result = databaseUtils.execute(sourceType, groupId, sql); List> recordList = databaseUtils.getDataSourceList(result); @@ -1632,45 +1630,45 @@ public class HrmSelfHelpController { String sourceType = "LOGIC"; String sql =" SELECT \n" + - " sum(cast(t1.skje as decimal(18,2))) as skje,\n" + //收款金额 - " sum(cast(t1.xmskje as decimal(18,2))) as xmskje,\n" + // 项目收款金额 - " sum(cast(t1.xsyxje as decimal(18,2))) as xsyxje," + // 销售有效金额 - " sum(cast(t1.xsje as decimal(18,2))) as xsje," + // 销售金额 - " sum(cast(t1.xmyxje as decimal(18,2))) as xmyxje," + //项目有效金额 - " sum(cast(t1.xsjxhk as decimal(18,2))) as xsjxhk," + //有效绩效回款 - " sum(cast(t1.sumsk as decimal(18,2))) as sumsk," + //总收款金额 - " sum(cast(t1.sjjsk as decimal(18,2))) as sjjsk," + //实际结算款 - " sum(cast(t1.skjs as decimal(18,2))) as skjs " + //收款结算 - " FROM uf_jxhs_skmx t1\n" + - " LEFT JOIN uf_jxhs_zxhtzb t2 ON t1.hth = t2.hth AND t2.hth != '' AND t2.hth IS NOT NULL \n" + - " JOIN ebdf_physical_data epd on t1.id = epd.form_data_id and epd.delete_type = 0 \n" + - " WHERE t1.skje != 0 \n" + - " and t1.skje IS NOT NULL " + - " and t1.skrq >= '" + startday+"' and skrq <='"+endday+"' "+ - " and (" + - " '"+employeeId+"' IN ( 2, 27, 166, 10285, 11661, 300, 876, 3593, 1416, 1647, 1844,3044480226941419013,794508876297846787 ) \n" + - " or cast(t1.xsjl AS decimal(25,0)) in( \n" + - " SELECT cid AS id FROM eteams.emp_link WHERE pid = '"+employeeId+"' and RELATION in ('othersenior','senior') \n" + - " UNION " + - " SELECT id FROM eteams.employee WHERE id = '"+employeeId+"' " + - " )\n" + - " or cast(t1.kfry AS decimal(25,0)) in(\n" + - " SELECT cid AS id FROM eteams.emp_link WHERE pid = '"+employeeId+"' and RELATION in ('othersenior','senior') \n" + - " UNION " + - " SELECT id FROM eteams.employee WHERE id = '"+employeeId+"' " + - " )\n" + - " or cast(t1.qdjl AS decimal(25,0)) in(\n" + - " SELECT cid AS id FROM eteams.emp_link WHERE pid = '"+employeeId+"' and RELATION in ('othersenior','senior') \n" + - " UNION " + - " SELECT id FROM eteams.employee WHEREHERE id = '"+employeeId+"' " + - " )\n" + - " or cast(t1.xmjl AS decimal(25,0)) in(\n" + - " SELECT cid AS id FROM eteams.emp_link WHERE pid = '"+employeeId+"' and RELATION in ('othersenior','senior') \n" + - " UNION " + - " SELECT id FROM eteams.employee WHERE id = '"+employeeId+"' " + - " )\n" + - " )\n" + - " order by t1.id " ; + " CONVERT(sum(cast(t1.skje as decimal(18,2))),CHAR) as skje,\n" + //收款金额 + " CONVERT(sum(cast(t1.xmskje as decimal(18,2))),CHAR) as xmskje,\n" + // 项目收款金额 + " CONVERT(sum(cast(t1.xsyxje as decimal(18,2))),CHAR) as xsyxje," + // 销售有效金额 + " CONVERT(sum(cast(t1.xsje as decimal(18,2))),CHAR) as xsje," + // 销售金额 + " CONVERT(sum(cast(t1.xmyxje as decimal(18,2))),CHAR) as xmyxje," + //项目有效金额 + " CONVERT(sum(cast(t1.xsjxhk as decimal(18,2))),CHAR) as xsjxhk," + //有效绩效回款 + " CONVERT(sum(cast(t1.sumsk as decimal(18,2))),CHAR) as sumsk," + //总收款金额 + " CONVERT(sum(cast(t1.sjjsk as decimal(18,2))),CHAR) as sjjsk," + //实际结算款 + " CONVERT(sum(cast(t1.skjs as decimal(18,2))),CHAR) as skjs " + //收款结算 + " FROM uf_jxhs_skmx t1\n" + + " LEFT JOIN uf_jxhs_zxhtzb t2 ON t1.hth = t2.hth AND t2.hth != '' AND t2.hth IS NOT NULL \n" + + " JOIN ebdf_physical_data epd on t1.id = epd.form_data_id and epd.delete_type = 0 \n" + + " WHERE t1.skje != 0 \n" + + " and t1.skje IS NOT NULL " + + " and t1.xshsny >= '" + startday+"' and t1.xshsny <='"+endday+"' "+ + " and (" + + " '"+employeeId+"' IN ( 2, 27, 166, 10285, 11661, 300, 876, 3593, 1416, 1647, 1844,3044480226941419013,794508876297846787 ) \n" + + " or cast(t1.xsjl AS decimal(25,0)) in( \n" + + " SELECT cid AS id FROM eteams.emp_link WHERE pid = '"+employeeId+"' and RELATION in ('othersenior','senior') \n" + + " UNION " + + " SELECT id FROM eteams.employee WHERE id = '"+employeeId+"' " + + " )\n" + + " or cast(t1.kfry AS decimal(25,0)) in(\n" + + " SELECT cid AS id FROM eteams.emp_link WHERE pid = '"+employeeId+"' and RELATION in ('othersenior','senior') \n" + + " UNION " + + " SELECT id FROM eteams.employee WHERE id = '"+employeeId+"' " + + " )\n" + + " or cast(t1.qdjl AS decimal(25,0)) in(\n" + + " SELECT cid AS id FROM eteams.emp_link WHERE pid = '"+employeeId+"' and RELATION in ('othersenior','senior') \n" + + " UNION " + + " SELECT id FROM eteams.employee WHEREHERE id = '"+employeeId+"' " + + " )\n" + + " or cast(t1.xmjl AS decimal(25,0)) in(\n" + + " SELECT cid AS id FROM eteams.emp_link WHERE pid = '"+employeeId+"' and RELATION in ('othersenior','senior') \n" + + " UNION " + + " SELECT id FROM eteams.employee WHERE id = '"+employeeId+"' " + + " )\n" + + " )\n" + + " order by t1.id " ; log.error("sql:"+sql); Map result = databaseUtils.execute(sourceType, groupId, sql);