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);