LISServiceImpl.java 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. package com.jyxt.getdatabyrestful.service.impl;
  2. import com.jyxt.getdatabyrestful.service.LISService;
  3. import org.slf4j.Logger;
  4. import org.slf4j.LoggerFactory;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.beans.factory.annotation.Qualifier;
  7. import org.springframework.jdbc.core.JdbcTemplate;
  8. import org.springframework.jdbc.core.SqlOutParameter;
  9. import org.springframework.jdbc.core.SqlParameter;
  10. import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
  11. import org.springframework.jdbc.core.simple.SimpleJdbcCall;
  12. import org.springframework.stereotype.Service;
  13. import org.springframework.util.StringUtils;
  14. import java.sql.Types;
  15. import java.util.*;
  16. @Service
  17. public class LISServiceImpl implements LISService {
  18. private static final Logger log = LoggerFactory.getLogger(LISServiceImpl.class);
  19. @Autowired
  20. @Qualifier("secondJdbcTemplate")
  21. private JdbcTemplate jdbcTemplate;
  22. public static List<Map<String, Object>> testList = new ArrayList<>();
  23. public List<Map<String, Object>> GetGroupConfig() {
  24. // //----------以下为测试用----------
  25. // // 1. 创建最外层的List
  26. // List<Map<String, Object>> list = new ArrayList<>();
  27. // // 2. 创建内层Map
  28. // Map<String, Object> map = new HashMap<>(); // 保持插入顺序
  29. // // 3. 向Map中添加数据
  30. // map.put("SORTID", "001");
  31. // map.put("GROUPCODE", "G002");
  32. // map.put("GROUPNAME", "茂源生化");
  33. // map.put("SAVEDAY", "7");
  34. // map.put("OPRATIONTYPE", "直接转交公司统一焚烧");
  35. // list.add(map);
  36. // Map<String, Object> map2 = new HashMap<>(); // 保持插入顺序
  37. // // 3. 向Map中添加数据
  38. // map2.put("SORTID", "002");
  39. // map2.put("GROUPCODE", "G004");
  40. // map2.put("GROUPNAME", "茂源免疫");
  41. // map2.put("SAVEDAY", "14");
  42. // map2.put("OPRATIONTYPE", "直接转交公司统一焚烧");
  43. // list.add(map2);
  44. //
  45. // Map<String, Object> map3 = new HashMap<>(); // 保持插入顺序
  46. // // 3. 向Map中添加数据
  47. // map3.put("SORTID", "003");
  48. // map3.put("GROUPCODE", "G032");
  49. // map3.put("GROUPNAME", "茂源临检");
  50. // map3.put("SAVEDAY", "7");
  51. // map3.put("OPRATIONTYPE", "灭菌后转交公司统一焚烧");
  52. // list.add(map3);
  53. // return list;
  54. // //----------以上为测试用----------
  55. List<Map<String, Object>> resultList = null;
  56. String SqlQry = "select SORTID,GROUPCODE,GROUPNAME,SAVEDAY,OPRATIONTYPE from v_jt_lisgroupcustom";
  57. log.info("excute sql:"+SqlQry);
  58. resultList = jdbcTemplate.queryForList(SqlQry);
  59. return resultList;
  60. }
  61. public List<Map<String, Object>> GetSampleList(List<Map<String, Object>> inputList){
  62. // //----------以下为测试用----------
  63. // // 1. 创建最外层的List
  64. // List<Map<String, Object>> list = new ArrayList<>();
  65. // // 2. 创建内层Map
  66. // Map<String, Object> map = new HashMap<>(); // 保持插入顺序
  67. // // 3. 向Map中添加数据
  68. // map.put("STATE", "1");
  69. // map.put("SAVE_DATE", "20250720");
  70. // map.put("INSPECTION_ID", "20250720G0364061112");
  71. // map.put("PATIENT_NAME", "赵春香11");
  72. // map.put("TEST_ORDER_NAME", "血常规11");
  73. // map.put("DESTROY_DATE", "20250727");
  74. // list.add(map);
  75. // Map<String, Object> map2 = new HashMap<>(); // 保持插入顺序
  76. // // 3. 向Map中添加数据
  77. // map2.put("STATE", "1");
  78. // map2.put("SAVE_DATE", "20250720");
  79. // map2.put("INSPECTION_ID", "20250720G036123124062");
  80. // map2.put("PATIENT_NAME", "赵春香22");
  81. // map2.put("TEST_ORDER_NAME", "血常规22");
  82. // map2.put("DESTROY_DATE", "20250727");
  83. // list.add(map2);
  84. //
  85. // Map<String, Object> map3 = new HashMap<>(); // 保持插入顺序
  86. // // 3. 向Map中添加数据
  87. // map3.put("STATE", "1");
  88. // map3.put("SAVE_DATE", "20250720");
  89. // map3.put("INSPECTION_ID", "2020G03123312364062");
  90. // map3.put("PATIENT_NAME", "赵春香33");
  91. // map3.put("TEST_ORDER_NAME", "血常规33");
  92. // map3.put("DESTROY_DATE", "20250727");
  93. // list.add(map3);
  94. // return list;
  95. // //----------以上为测试用----------
  96. List<Map<String, Object>> resultList = new ArrayList<>();
  97. for(Map<String, Object> inputMap : inputList) {
  98. if (!inputMap.containsKey("STATE") || inputMap.get("STATE") == null) {
  99. continue;
  100. }
  101. // StringBuilder sql = new StringBuilder(
  102. // "select STATE,SAVE_DATE,DESTROY_DATE,INSPECTION_ID,PATIENT_NAME,TEST_ORDER_NAME from V_JT_SAVEANDDESTROY where ");
  103. //
  104. // // 处理STATE参数(可能为单个值或多个值)
  105. // String stateValue = inputMap.get("STATE").toString();
  106. // if (stateValue.contains(",")) {
  107. // String[] states = stateValue.split(",");
  108. // sql.append("STATE IN (");
  109. // for (int i = 0; i < states.length; i++) {
  110. // sql.append("'").append(states[i].trim()).append("'");
  111. // if (i < states.length - 1) {
  112. // sql.append(",");
  113. // }
  114. // }
  115. // sql.append(")");
  116. // } else {
  117. // sql.append("STATE = '").append(stateValue).append("'");
  118. // }
  119. StringBuilder sql = new StringBuilder("select ");
  120. if (inputMap.get("STATE").equals("1")){
  121. sql.append("STATE,SAVE_DATE,INSPECTION_ID,PATIENT_NAME,TEST_ORDER_NAME from v_jt_inspection_save where STATE=1 and ");
  122. } else if (inputMap.get("STATE").equals("1,2")){
  123. sql.append("STATE,SAVE_DATE,INSPECTION_ID,PATIENT_NAME,TEST_ORDER_NAME from v_jt_inspection_save where ");
  124. } else if (inputMap.get("STATE").equals("2")){
  125. sql.append("STATE,SAVE_DATE,DESTROY_DATE,INSPECTION_ID,PATIENT_NAME,TEST_ORDER_NAME from v_jt_inspection_destroy where STATE=2 and ");
  126. } else if (inputMap.get("STATE").equals("2,4")){
  127. sql.append("STATE,SAVE_DATE,DESTROY_DATE,INSPECTION_ID,PATIENT_NAME,TEST_ORDER_NAME from v_jt_inspection_destroy where ");
  128. }
  129. // 处理其他查询条件
  130. if (inputMap.containsKey("SAVE_DATE") && inputMap.get("SAVE_DATE") != null) {
  131. sql.append("SAVE_DATE = '").append(inputMap.get("SAVE_DATE")).append("'");
  132. }
  133. // if (inputMap.containsKey("DESTROY_DATE") && inputMap.get("DESTROY_DATE") != null) {
  134. // sql.append(" AND DESTROY_DATE = '").append(inputMap.get("DESTROY_DATE")).append("'");
  135. // }
  136. if (inputMap.containsKey("GROUPCODE") && inputMap.get("GROUPCODE") != null) {
  137. sql.append(" AND GROUPCODE = '").append(inputMap.get("GROUPCODE")).append("'");
  138. }
  139. if (inputMap.containsKey("INSPECTION_ID") && inputMap.get("INSPECTION_ID") != null) {
  140. sql.append(" AND INSPECTION_ID like '%").append(inputMap.get("INSPECTION_ID")).append("%'");
  141. }
  142. if (inputMap.containsKey("PATIENT_NAME") && inputMap.get("PATIENT_NAME") != null) {
  143. sql.append(" AND PATIENT_NAME like '%").append(inputMap.get("PATIENT_NAME")).append("%'");
  144. }
  145. if (inputMap.containsKey("TEST_ORDER_NAME") && inputMap.get("TEST_ORDER_NAME") != null) {
  146. sql.append(" AND TEST_ORDER_NAME like '%").append(inputMap.get("TEST_ORDER_NAME")).append("%'");
  147. }
  148. log.info("execute sql: " + sql.toString());
  149. resultList.addAll(jdbcTemplate.queryForList(sql.toString()));
  150. int num = resultList.size();
  151. log.info("get data size: " + String.valueOf(num));
  152. }
  153. return resultList;
  154. }
  155. public List<Map<String, Object>> getSavedSampleList(List<Map<String, Object>> inputList){
  156. List<Map<String, Object>> resultList = new ArrayList<>();
  157. for(Map<String, Object> inputMap : inputList) {
  158. StringBuilder sql = new StringBuilder(
  159. "select SAVE_DATE,INSPECTION_ID,PATIENT_NAME,TEST_ORDER_NAME from V_JT_SAVEANDDESTROY where STATE=2");
  160. MapSqlParameterSource params = new MapSqlParameterSource();
  161. // 处理SAVE_DATE(字符串类型)
  162. if (inputMap.containsKey("OPERATION_DATE") && inputMap.get("OPERATION_DATE") != null) {
  163. sql.append(" AND SAVE_DATE = '"+inputMap.get("OPERATION_DATE")+"'");
  164. // params.addValue("saveDate", inputMap.get("SAVE_DATE"), Types.VARCHAR);
  165. }
  166. // 处理GROUPCODE(字符串类型)
  167. if (inputMap.containsKey("GROUPCODE") && inputMap.get("GROUPCODE") != null) {
  168. sql.append(" AND GROUPCODE = '"+inputMap.get("GROUPCODE")+"'");
  169. // params.addValue("groupCode", inputMap.get("GROUPCODE"), Types.VARCHAR);
  170. }
  171. // INSPECTION_ID(字符串类型)
  172. if (inputMap.containsKey("INSPECTION_ID") && inputMap.get("INSPECTION_ID") != null) {
  173. sql.append(" AND INSPECTION_ID like '%"+inputMap.get("INSPECTION_ID")+"%'");
  174. // params.addValue("INSPECTION_ID", inputMap.get("INSPECTION_ID"), Types.VARCHAR);
  175. }
  176. //PATIENT_NAME(字符串类型)
  177. if (inputMap.containsKey("PATIENT_NAME") && inputMap.get("PATIENT_NAME") != null) {
  178. sql.append(" AND PATIENT_NAME like '%"+inputMap.get("PATIENT_NAME")+"%'");
  179. // params.addValue("PATIENT_NAME", inputMap.get("PATIENT_NAME"), Types.VARCHAR);
  180. }
  181. //TEST_ORDER_NAME(字符串类型)
  182. if (inputMap.containsKey("TEST_ORDER_NAME") && inputMap.get("TEST_ORDER_NAME") != null) {
  183. sql.append(" AND TEST_ORDER_NAME like '%"+inputMap.get("TEST_ORDER_NAME")+"%'");
  184. // params.addValue("TEST_ORDER_NAME", inputMap.get("TEST_ORDER_NAME"), Types.VARCHAR);
  185. }
  186. log.info("execute sql: " + sql.toString());
  187. resultList.addAll(jdbcTemplate.queryForList(sql.toString()));
  188. int num = resultList.size();
  189. log.info("get data size: " + String.valueOf(num));
  190. }
  191. return resultList;
  192. }
  193. public List<Map<String, Object>> getDestorySampleList(List<Map<String, Object>> inputList){
  194. List<Map<String, Object>> resultList = new ArrayList<>();
  195. for(Map<String, Object> inputMap : inputList) {
  196. StringBuilder sql = new StringBuilder(
  197. "select SAVE_DATE,INSPECTION_ID,PATIENT_NAME,TEST_ORDER_NAME from V_JT_SAVEANDDESTROY where STATE=2");
  198. MapSqlParameterSource params = new MapSqlParameterSource();
  199. // 处理SAVE_DATE(字符串类型)
  200. if (inputMap.containsKey("OPERATION_DATE") && inputMap.get("OPERATION_DATE") != null) {
  201. sql.append(" AND DESTROY_DATE = '"+inputMap.get("OPERATION_DATE")+"'");
  202. // params.addValue("saveDate", inputMap.get("SAVE_DATE"), Types.VARCHAR);
  203. }
  204. // 处理GROUPCODE(字符串类型)
  205. if (inputMap.containsKey("GROUPCODE") && inputMap.get("GROUPCODE") != null) {
  206. sql.append(" AND GROUPCODE = '"+inputMap.get("GROUPCODE")+"'");
  207. // params.addValue("groupCode", inputMap.get("GROUPCODE"), Types.VARCHAR);
  208. }
  209. // INSPECTION_ID(字符串类型)
  210. if (inputMap.containsKey("INSPECTION_ID") && inputMap.get("INSPECTION_ID") != null) {
  211. sql.append(" AND INSPECTION_ID like '%"+inputMap.get("INSPECTION_ID")+"%'");
  212. // params.addValue("INSPECTION_ID", inputMap.get("INSPECTION_ID"), Types.VARCHAR);
  213. }
  214. //PATIENT_NAME(字符串类型)
  215. if (inputMap.containsKey("PATIENT_NAME") && inputMap.get("PATIENT_NAME") != null) {
  216. sql.append(" AND PATIENT_NAME like '%"+inputMap.get("PATIENT_NAME")+"%'");
  217. // params.addValue("PATIENT_NAME", inputMap.get("PATIENT_NAME"), Types.VARCHAR);
  218. }
  219. //TEST_ORDER_NAME(字符串类型)
  220. if (inputMap.containsKey("TEST_ORDER_NAME") && inputMap.get("TEST_ORDER_NAME") != null) {
  221. sql.append(" AND TEST_ORDER_NAME like '%"+inputMap.get("TEST_ORDER_NAME")+"%'");
  222. // params.addValue("TEST_ORDER_NAME", inputMap.get("TEST_ORDER_NAME"), Types.VARCHAR);
  223. }
  224. log.info("execute sql: " + sql.toString());
  225. resultList.addAll(jdbcTemplate.queryForList(sql.toString()));
  226. int num = resultList.size();
  227. log.info("get data size: " + String.valueOf(num));
  228. }
  229. return resultList;
  230. }
  231. public List<Map<String, Object>> getDestoryedSampleList(List<Map<String, Object>> inputList){
  232. List<Map<String, Object>> resultList = new ArrayList<>();
  233. for(Map<String, Object> inputMap : inputList) {
  234. StringBuilder sql = new StringBuilder(
  235. "select SAVE_DATE,INSPECTION_ID,PATIENT_NAME,TEST_ORDER_NAME from V_JT_SAVEANDDESTROY where STATE=4");
  236. MapSqlParameterSource params = new MapSqlParameterSource();
  237. // 处理SAVE_DATE(字符串类型)
  238. if (inputMap.containsKey("OPERATION_DATE") && inputMap.get("OPERATION_DATE") != null) {
  239. sql.append(" AND DESTROY_DATE = '"+inputMap.get("OPERATION_DATE")+"'");
  240. // params.addValue("saveDate", inputMap.get("SAVE_DATE"), Types.VARCHAR);
  241. }
  242. // 处理GROUPCODE(字符串类型)
  243. if (inputMap.containsKey("GROUPCODE") && inputMap.get("GROUPCODE") != null) {
  244. sql.append(" AND GROUPCODE = '"+inputMap.get("GROUPCODE")+"'");
  245. // params.addValue("groupCode", inputMap.get("GROUPCODE"), Types.VARCHAR);
  246. }
  247. // INSPECTION_ID(字符串类型)
  248. if (inputMap.containsKey("INSPECTION_ID") && inputMap.get("INSPECTION_ID") != null) {
  249. sql.append(" AND INSPECTION_ID like '%"+inputMap.get("INSPECTION_ID")+"%'");
  250. // params.addValue("INSPECTION_ID", inputMap.get("INSPECTION_ID"), Types.VARCHAR);
  251. }
  252. //PATIENT_NAME(字符串类型)
  253. if (inputMap.containsKey("PATIENT_NAME") && inputMap.get("PATIENT_NAME") != null) {
  254. sql.append(" AND PATIENT_NAME like '%"+inputMap.get("PATIENT_NAME")+"%'");
  255. // params.addValue("PATIENT_NAME", inputMap.get("PATIENT_NAME"), Types.VARCHAR);
  256. }
  257. //TEST_ORDER_NAME(字符串类型)
  258. if (inputMap.containsKey("TEST_ORDER_NAME") && inputMap.get("TEST_ORDER_NAME") != null) {
  259. sql.append(" AND TEST_ORDER_NAME like '%"+inputMap.get("TEST_ORDER_NAME")+"%'");
  260. // params.addValue("TEST_ORDER_NAME", inputMap.get("TEST_ORDER_NAME"), Types.VARCHAR);
  261. }
  262. log.info("execute sql: " + sql.toString());
  263. resultList.addAll(jdbcTemplate.queryForList(sql.toString()));
  264. int num = resultList.size();
  265. log.info("get data size: " + String.valueOf(num));
  266. }
  267. return resultList;
  268. }
  269. public int SaveSample(List<Map<String, Object>> inputList){
  270. log.info("ready to save:"+String.valueOf(inputList));
  271. String OperationDate = null;
  272. String GroupCode = null;
  273. String OperationName = null;
  274. int ret = -1;
  275. // //----------以下为测试用----------
  276. // if(1==1){
  277. // return 0;
  278. // }
  279. // //----------以上为测试用----------
  280. List<String> RemoveSampleList = new ArrayList<>();
  281. for(Map<String, Object> inputMap : inputList) {
  282. if (inputMap.containsKey("OPERATION_DATE")) {
  283. OperationDate = String.valueOf(inputMap.get("OPERATION_DATE"));
  284. }
  285. if (inputMap.containsKey("GROUPCODE")) {
  286. GroupCode = String.valueOf(inputMap.get("GROUPCODE"));
  287. }
  288. if (inputMap.containsKey("OPERATIONNAME")) {
  289. OperationName = String.valueOf(inputMap.get("OPERATIONNAME"));
  290. }
  291. if (inputMap.containsKey("RemoveSampleList")) {
  292. Object obj = inputMap.get("RemoveSampleList");
  293. if (obj instanceof List<?>) {
  294. for (Object item : (List<?>) obj) {
  295. RemoveSampleList.add(String.valueOf(item));
  296. }
  297. }
  298. }
  299. }
  300. String result = "";
  301. if (RemoveSampleList == null || RemoveSampleList.isEmpty()) {
  302. result = "";
  303. }else{
  304. for (String item : RemoveSampleList) {
  305. result += item + ",";
  306. }
  307. }
  308. result = result.substring(0, result.length() - 1);
  309. String xml =
  310. "<OprationDate>" + OperationDate + "</OprationDate>" +
  311. "<GroupCode>" + GroupCode + "</GroupCode>" +
  312. "<RemoveSampleList>" + result + "</RemoveSampleList>" +
  313. "<OprationName>" + OperationName + "</OprationName>";
  314. //准备调用存储过程
  315. String methodCode = "SaveSample";
  316. SimpleJdbcCall jdbcCall = new SimpleJdbcCall(jdbcTemplate)
  317. .withProcedureName("USP_JT_INTERFACE")
  318. .declareParameters(
  319. new SqlParameter("methodCode", Types.VARCHAR),
  320. new SqlParameter("inParamXml", Types.VARCHAR),
  321. new SqlOutParameter("a_result", Types.VARCHAR)
  322. );
  323. Map<String, Object> inParams = new HashMap<>();
  324. inParams.put("methodCode", "SaveSample");
  325. inParams.put("inParamXml", xml);
  326. log.info("call process:Save-> " + xml);
  327. Map<String, Object> out = jdbcCall.execute(inParams);
  328. ret = Integer.parseInt((String) out.get("a_result"));
  329. if(!(ret ==0)){
  330. log.info("---------------call process:Save-> fail!---------------");
  331. }else{
  332. log.info("call process:Save-> success!");
  333. }
  334. return ret;
  335. }
  336. public int DestorySample(List<Map<String, Object>> inputList){
  337. log.info("ready to destory:"+String.valueOf(inputList));
  338. String OperationDate = null;
  339. String GroupCode = null;
  340. String OperationName = null;
  341. int ret = -1;
  342. // //----------以下为测试用----------
  343. // if(1==1){
  344. // return 0;
  345. // }
  346. // //----------以上为测试用----------
  347. List<String> RemoveSampleList = new ArrayList<>();
  348. for(Map<String, Object> inputMap : inputList) {
  349. if (inputMap.containsKey("OPERATION_DATE")) {
  350. OperationDate = String.valueOf(inputMap.get("OPERATION_DATE"));
  351. }
  352. if (inputMap.containsKey("GROUPCODE")) {
  353. GroupCode = String.valueOf(inputMap.get("GROUPCODE"));
  354. }
  355. if (inputMap.containsKey("OPERATIONNAME")) {
  356. OperationName = String.valueOf(inputMap.get("OPERATIONNAME"));
  357. }
  358. if (inputMap.containsKey("RemoveSampleList")) {
  359. Object obj = inputMap.get("RemoveSampleList");
  360. if (obj instanceof List<?>) {
  361. for (Object item : (List<?>) obj) {
  362. RemoveSampleList.add(String.valueOf(item));
  363. }
  364. }
  365. }
  366. }
  367. String result = "";
  368. if (RemoveSampleList == null || RemoveSampleList.isEmpty()) {
  369. result = "";
  370. }else{
  371. for (String item : RemoveSampleList) {
  372. result += item + ",";
  373. }
  374. }
  375. result = result.substring(0, result.length() - 1);
  376. String xml =
  377. "<OprationDate>" + OperationDate + "</OprationDate>" +
  378. "<GroupCode>" + GroupCode + "</GroupCode>" +
  379. "<RemoveSampleList>" + result + "</RemoveSampleList>" +
  380. "<OprationName>" + OperationName + "</OprationName>";
  381. //准备调用存储过程
  382. String methodCode = "DestorySample";
  383. SimpleJdbcCall jdbcCall = new SimpleJdbcCall(jdbcTemplate)
  384. .withProcedureName("USP_JT_INTERFACE")
  385. .declareParameters(
  386. new SqlParameter("methodCode", Types.VARCHAR),
  387. new SqlParameter("inParamXml", Types.VARCHAR),
  388. new SqlOutParameter("a_result", Types.VARCHAR)
  389. );
  390. Map<String, Object> inParams = new HashMap<>();
  391. inParams.put("methodCode", "DestorySample");
  392. inParams.put("inParamXml", xml);
  393. log.info("call process:Destory-> " + xml);
  394. Map<String, Object> out = jdbcCall.execute(inParams);
  395. ret = Integer.parseInt((String) out.get("a_result"));
  396. if(!(ret ==0)){
  397. log.info("---------------call process:Save-> fail!---------------");
  398. }else{
  399. log.info("call process:Save-> success!");
  400. }
  401. return ret;
  402. }
  403. @Override
  404. public List<Map<String, Object>> geteActualCountList(String qryDays) {
  405. //获取LIS指定天数内的实际保存数
  406. String QryActualSql = "select SAVE_DATE,GROUPNAME,count(*) as COUNT from v_jt_inspection_save where TO_DATE(SAVE_DATE, 'YYYYMMDD')>=TRUNC(SYSDATE)-"+Integer.valueOf(qryDays)+" group by GROUPNAME,SAVE_DATE";
  407. log.info("execute sql: " + QryActualSql.toString());
  408. List<Map<String, Object>> actualList = jdbcTemplate.queryForList(QryActualSql);
  409. return actualList;
  410. //以下为测试数据
  411. // 1. 创建最外层的List
  412. // List<Map<String, Object>> list = new ArrayList<>();
  413. // // 2. 创建内层Map
  414. // Map<String, Object> map = new HashMap<>(); // 保持插入顺序
  415. // // 3. 向Map中添加数据
  416. // map.put("SAVE_DATE", "20250807");
  417. // map.put("GROUPNAME", "茂源临检");
  418. // map.put("COUNT", "100");
  419. // list.add(map);
  420. // Map<String, Object> map2 = new HashMap<>(); // 保持插入顺序
  421. // // 3. 向Map中添加数据
  422. // map2.put("SAVE_DATE", "20250807");
  423. // map2.put("GROUPNAME", "茂源生化");
  424. // map2.put("COUNT", "1980");
  425. // list.add(map2);
  426. // return list;
  427. }
  428. }