| | |
| | | @ApiOperation("查询sop信息") |
| | | @PostMapping("getSopInfo") |
| | | public Response getSopInfo(@RequestBody(required = false) List<SopDto> list |
| | | , @RequestParam(required = false) String code, @RequestParam(required = false) String model |
| | | , @RequestParam(required = false) String code, @RequestParam(required = false) String model, @RequestParam(required = false) Integer status |
| | | , @RequestParam int pageCurr, @RequestParam int pageSize) { |
| | | return service.getSopInfo(list,code,model,pageCurr,pageSize); |
| | | return service.getSopInfo(list,code,model,status,pageCurr,pageSize); |
| | | } |
| | | |
| | | @ApiOperation("查询sop历史") |
| | |
| | | } |
| | | |
| | | //查询sop信息 |
| | | public Response getSopInfo(List<SopDto> sqlList, String code, String model,int pageCurr,int pageSize) { |
| | | public Response getSopInfo(List<SopDto> sqlList, String code, String model, Integer status, int pageCurr, int pageSize) { |
| | | String sqlStr=" "; |
| | | if(sqlList!=null&&sqlList.size()>0){ |
| | | for (SopDto dto:sqlList) { |
| | |
| | | for (int i=0;i<dto.getChileType().size();i++){ |
| | | sqlStr+=" and file_type like "+"'%"+dto.getParentType()+"-"+dto.getChileType().get(i)+"%' "; |
| | | } |
| | | }else{ |
| | | sqlStr+=" and file_type like "+"'%"+dto.getParentType()+"%' "; |
| | | } |
| | | } |
| | | } |
| | | //排序 |
| | | sqlStr+=" order by create_time desc "; |
| | | if(status!=null) { |
| | | sqlStr += " and status = "+status; |
| | | } |
| | | List<SOP> list=mapper.getSopInfo(sqlStr,code,model); |
| | | PageInfo pageInfo= PageInfoUtils.list2PageInfo(list,pageCurr,pageSize); |
| | | |
| | |
| | | </collection> |
| | | </resultMap> |
| | | <select id="getSopInfo" resultMap="sopList"> |
| | | select tb_sop.*,tb_sop_product.id as pId,code,model,sop_id from tb_sop LEFT JOIN tb_sop_product on tb_sop.id=tb_sop_product.sop_id where tb_sop.current_flag=1 |
| | | select tb_sop.*,tb_sop_product.id as pId,code,model,sop_id from tb_sop LEFT JOIN tb_sop_product on tb_sop.id=tb_sop_product.sop_id where tb_sop.current_flag=1 ${sqlStr} |
| | | union all |
| | | select tb_sop.*,tb_sop_product.id as pId ,code,model,sop_id from tb_sop |
| | | LEFT JOIN tb_sop_product on tb_sop.id=tb_sop_product.sop_id |
| | | <where> |
| | | 1=1 and tb_sop.current_flag=0 |
| | | tb_sop.current_flag=0 |
| | | <if test="code!=null"> |
| | | and code LIKE '%${code}%' |
| | | </if> |
| | |
| | | </if> |
| | | ${sqlStr} |
| | | </where> |
| | | order by create_time desc |
| | | </select> |
| | | <select id="getSopHis" resultMap="sopList"> |
| | | select tb_sop.*,tb_sop_product.id as pId ,code,model,sop_id from tb_sop |