src/main/java/com/nanometer/smartlab/api/ApiAction.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/nanometer/smartlab/dao/HazardousWasteMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/nanometer/smartlab/dao/HazardousWasteMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/nanometer/smartlab/service/HazardousWasteService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/nanometer/smartlab/service/HazardousWasteServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
智慧实验室接口.docx | 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/nanometer/smartlab/api/ApiAction.java
@@ -1576,7 +1576,7 @@ */ @ResponseBody @RequestMapping("hazardousWaste/getWasteInfo") public Object getLabAndUser(@RequestParam(required=true) int adminFlag,@RequestParam(required=true) String name,@RequestParam(required=false) String status public Object getWasteInfo(@RequestParam(required=true) int adminFlag,@RequestParam(required=true) String name,@RequestParam(required=false) String status ,@RequestParam(required=false) String starttime,@RequestParam(required=false) String endtime){ try { if (StringUtils.isBlank(name)){ @@ -1601,7 +1601,7 @@ */ @ResponseBody @RequestMapping("hazardousWaste/changeStatus") public Object getLabAndUser(@RequestParam(required=true) String tid,@RequestParam(required=true) String status, public Object changeStatus(@RequestParam(required=true) String tid,@RequestParam(required=true) String status, @RequestParam(required=true) String updator){ try { if (StringUtils.isBlank(tid) || StringUtils.isBlank(status)){ @@ -1688,4 +1688,33 @@ } /** * 根据用户名获取危废全年统计列表 * */ @ResponseBody @RequestMapping("hazardousWaste/getWasteStatistics") public Object getWasteStatistics(@RequestParam(required=true) int adminFlag,@RequestParam(required=true) String name){ try { if (StringUtils.isBlank(name)){ return ResponseModel.getErrInstance("姓名不能为空"); } Calendar calendar = Calendar.getInstance(); int year = calendar.get(Calendar.YEAR); String status = "已确认"; String starttime = year+"-01-01 00:00:00"; String endtime = year+"-12-31 23:59:59"; List<HazardousWaste> hazardousWasters = new ArrayList<>(); if (adminFlag == 2){ hazardousWasters = hazardousWasteService.setAllWasterCount(starttime,endtime,status,null); }else if (adminFlag == 1) { hazardousWasters = hazardousWasteService.setAllWasterCount(starttime,endtime,status,name); } return ResponseModel.getOkInstence(hazardousWasters); }catch (Exception e){ e.printStackTrace(); logger.info(e); return ResponseModel.getErrInstance("系统出错"); } } } src/main/java/com/nanometer/smartlab/dao/HazardousWasteMapper.java
@@ -33,4 +33,6 @@ List<HazardousWaste> setAllWasters(@Param("starttime") String starttime,@Param("endtime") String endtime,@Param("status") String status,@Param("applyPerson") String applyPerson); HazardousWaste selectByTid(@Param("tid") String tid); List<HazardousWaste> setAllWasterCount(@Param("starttime") String starttime,@Param("endtime") String endtime,@Param("status") String status,@Param("applyPerson") String applyPerson); } src/main/java/com/nanometer/smartlab/dao/HazardousWasteMapper.xml
@@ -226,17 +226,37 @@ updatetime = #{updatetime,jdbcType=TIMESTAMP} where id = #{id,jdbcType=BIGINT} </update> <select id="setAllWasters" resultMap="BaseResultMap"> <select id="setAllWasterCount" resultType="com.nanometer.smartlab.entity.HazardousWaste"> select sum(acid) as acid,sum(alkali) as alkali, sum(organic) as organic,sum(solid) as solid,sum(medical) as medical from sys_hazardous_waste <where> 1 = 1 <if test="starttime != null and starttime != ''"> and create_time >= #{starttime} </if> <if test="endtime != null and endtime != ''"> and create_time <= #{endtime} </if> <if test="status != null and status != ''"> and status = #{status} </if> <if test="applyPerson != null and applyPerson != ''"> and apply_person = #{applyPerson} </if> </where> </select> <select id="setAllWasters" resultMap="BaseResultMap"> select <include refid="Base_Column_List" /> from sys_hazardous_waste <where> 1 = 1 <if test="starttime != null and starttime != ''"> and create_time > #{starttime} and create_time >= #{starttime} </if> <if test="endtime != null and endtime != ''"> and create_time < #{endtime} and create_time <= #{endtime} </if> <if test="status != null and status != ''"> and status = #{status} @@ -255,10 +275,10 @@ <where> 1 = 1 <if test="startTime != null and startTime != ''"> and create_time > #{startTime} and create_time >= #{startTime} </if> <if test="endTime != null and endTime != ''"> and create_time < #{endTime} and create_time <= #{endTime} </if> <if test="status != null and status != ''"> and status = #{status} @@ -289,10 +309,10 @@ <where> 1 = 1 <if test="startTime != null and startTime != ''"> and create_time > #{startTime} and create_time >= #{startTime} </if> <if test="endTime != null and endTime != ''"> and create_time < #{endTime} and create_time <= #{endTime} </if> <if test="status != null and status != ''"> and status = #{status} @@ -319,10 +339,10 @@ <where> 1 = 1 <if test="startTime != null and startTime != ''"> and create_time > #{startTime} and create_time >= #{startTime} </if> <if test="endTime != null and endTime != ''"> and create_time < #{endTime} and create_time <= #{endTime} </if> <if test="status != null and status != ''"> and status = #{status} @@ -348,10 +368,10 @@ <where> 1 = 1 <if test="startTime != null and startTime != ''"> and create_time > #{startTime} and create_time >= #{startTime} </if> <if test="endTime != null and endTime != ''"> and create_time < #{endTime} and create_time <= #{endTime} </if> <if test="status != null and status != ''"> and status = #{status} @@ -376,10 +396,10 @@ <where> 1 = 1 <if test="startTime != null and startTime != ''"> and create_time > #{startTime} and create_time >= #{startTime} </if> <if test="endTime != null and endTime != ''"> and create_time < #{endTime} and create_time <= #{endTime} </if> <if test="status != null and status != ''"> and status = #{status} @@ -408,10 +428,10 @@ <where> 1 = 1 <if test="startTime != null and startTime != ''"> and create_time > #{startTime} and create_time >= #{startTime} </if> <if test="endTime != null and endTime != ''"> and create_time < #{endTime} and create_time <= #{endTime} </if> <if test="status != null and status != ''"> and status = #{status} src/main/java/com/nanometer/smartlab/service/HazardousWasteService.java
@@ -31,4 +31,6 @@ HazardousWaste selectByTid(String tid); void updateWaste(HazardousWaste hazardousWaste); List<HazardousWaste> setAllWasterCount(String starttime, String endtime, String status, String applyPerson); } src/main/java/com/nanometer/smartlab/service/HazardousWasteServiceImpl.java
@@ -162,4 +162,9 @@ hazardousWasteMapper.updateByPrimaryKeySelective(hazardousWaste); } @Override public List<HazardousWaste> setAllWasterCount(String starttime, String endtime, String status, String applyPerson) { return hazardousWasteMapper.setAllWasterCount(starttime, endtime, status, applyPerson); } } 智慧实验室接口.docxBinary files differ