Commit 9c7f6a51 authored by zhangyingbin's avatar zhangyingbin

适配数据库

parent 76a3c6e3
...@@ -81,4 +81,6 @@ public interface CylinderInfoMapper extends BaseMapper<CylinderInfo> { ...@@ -81,4 +81,6 @@ public interface CylinderInfoMapper extends BaseMapper<CylinderInfo> {
List<CylinderInfoDto> listWithRegionCode(Integer regionCode); List<CylinderInfoDto> listWithRegionCode(Integer regionCode);
Page<CylinderInfoDto> cyinderInfoList(Page<CylinderInfoDto> page, CylinderInfoDto cylinderInfoDto, String sort, List<String> appids); Page<CylinderInfoDto> cyinderInfoList(Page<CylinderInfoDto> page, CylinderInfoDto cylinderInfoDto, String sort, List<String> appids);
Page<CylinderInfoDto> cyinderOutInfoList(Page<CylinderInfoDto> page, CylinderInfoDto cylinderInfoDto, String sort, List<String> appids);
} }
...@@ -83,9 +83,9 @@ ...@@ -83,9 +83,9 @@
tz_cylinder_filling_record r tz_cylinder_filling_record r
left join tz_cylinder_unit u on u.app_id = r.app_id left join tz_cylinder_unit u on u.app_id = r.app_id
left join tz_cylinder_filling b on b.filling_before_id = r.filling_before_id AND left join tz_cylinder_filling b on b.filling_before_id = r.filling_before_id AND
date_format(`b`.`inspection_date`,'%Y-%m-%d') = date_format(`r`.`filling_startTime`,'%Y-%m-%d') date_format(b.inspection_date,'%Y-%m-%d') = date_format(r.filling_startTime,'%Y-%m-%d')
left join tz_cylinder_filling_check af on af.filling_check_id = r.filling_check_id AND left join tz_cylinder_filling_check af on af.filling_check_id = r.filling_check_id AND
date_format(`af`.`inspection_date`,'%Y-%m-%d') = date_format(`r`.`filling_startTime`,'%Y-%m-%d') date_format(af.inspection_date,'%Y-%m-%d') = date_format(r.filling_startTime,'%Y-%m-%d')
left join tz_cylinder_info i on b.sequence_code = i.sequence_code left join tz_cylinder_info i on b.sequence_code = i.sequence_code
WHERE WHERE
1= 1 1= 1
......
...@@ -186,9 +186,7 @@ ...@@ -186,9 +186,7 @@
<select id="getTzCylinderCheckItem" resultType="com.yeejoin.amos.boot.module.tzs.flc.api.dto.TzCylinderCheckDto"> <select id="getTzCylinderCheckItem" resultType="com.yeejoin.amos.boot.module.tzs.flc.api.dto.TzCylinderCheckDto">
SELECT SELECT
item, *
`explain`,
`result`
FROM FROM
tz_cylinder_check_item tz_cylinder_check_item
WHERE item!='' WHERE item!=''
...@@ -208,8 +206,8 @@ ...@@ -208,8 +206,8 @@
<select id="getTzCylinderAfterCheckItem" resultType="com.yeejoin.amos.boot.module.tzs.flc.api.dto.TzCylinderCheckDto"> <select id="getTzCylinderAfterCheckItem" resultType="com.yeejoin.amos.boot.module.tzs.flc.api.dto.TzCylinderCheckDto">
SELECT SELECT
after_item AS item, after_item AS item,
after_explain AS `explain`, after_explain AS "explain",
after_result AS `result` after_result AS "result"
FROM FROM
tz_cylinder_check_item tz_cylinder_check_item
WHERE after_item!='' WHERE after_item!=''
......
...@@ -182,7 +182,7 @@ public class InspectionServiceImpl implements InspectionService { ...@@ -182,7 +182,7 @@ public class InspectionServiceImpl implements InspectionService {
@Override @Override
public JSONObject getSafetySupervisionCodeMap(String bizTable, String mapKey, String mapValue) { public JSONObject getSafetySupervisionCodeMap(String bizTable, String mapKey, String mapValue) {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
String sql = String.format("SELECT `%s`, `%s` FROM %s", mapKey, mapValue, bizTable); String sql = String.format("SELECT %s, %s FROM %s", mapKey, mapValue, bizTable);
List<Map<String, Object>> list = bizJdbcTemplate.queryForList(sql); List<Map<String, Object>> list = bizJdbcTemplate.queryForList(sql);
list.forEach(x -> { list.forEach(x -> {
jsonObject.put(x.get(mapKey).toString(), x.get(mapValue)); jsonObject.put(x.get(mapKey).toString(), x.get(mapValue));
......
...@@ -516,7 +516,7 @@ public class CylinderInfoController extends BaseController { ...@@ -516,7 +516,7 @@ public class CylinderInfoController extends BaseController {
} }
} }
} }
if(ValidationUtil.isEmpty(cylinderInfoDto.getRegionCode()) && ValidationUtil.isEmpty(cylinderInfoDto.getCreditCode())){ if(ValidationUtil.isEmpty(cylinderInfoDto.getRegionCode()) && ValidationUtil.isEmpty(cylinderInfoDto.getCreditCode()) && cylinderInfoDto.getIsWarn()==0){
return ResponseHelper.buildResponse(new Page<CylinderInfoDto>(Long.valueOf(pageNum),Long.valueOf(pageSize))); return ResponseHelper.buildResponse(new Page<CylinderInfoDto>(Long.valueOf(pageNum),Long.valueOf(pageSize)));
} }
QueryWrapper<CylinderInfo> cylinderInfoQueryWrapper = new QueryWrapper<>(); QueryWrapper<CylinderInfo> cylinderInfoQueryWrapper = new QueryWrapper<>();
...@@ -541,7 +541,11 @@ public class CylinderInfoController extends BaseController { ...@@ -541,7 +541,11 @@ public class CylinderInfoController extends BaseController {
} else { } else {
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize)); pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
} }
pageBean = cylinderInfoServiceImpl.cyinderInfoList(pageBean,cylinderInfoDto,sort,appids); if(cylinderInfoDto.getIsWarn()!=0){
pageBean = cylinderInfoServiceImpl.cyinderOutInfoList(pageBean,cylinderInfoDto,sort,appids);
} else {
pageBean = cylinderInfoServiceImpl.cyinderInfoList(pageBean,cylinderInfoDto,sort,appids);
}
return ResponseHelper.buildResponse(pageBean); return ResponseHelper.buildResponse(pageBean);
// IPage<CylinderInfo> page; // IPage<CylinderInfo> page;
// if (cylinderInfoDto.getIsWarn() == 0) { // if (cylinderInfoDto.getIsWarn() == 0) {
......
...@@ -847,4 +847,8 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -847,4 +847,8 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
public Page<CylinderInfoDto> cyinderInfoList(Page<CylinderInfoDto> page, CylinderInfoDto cylinderInfoDto, String sort,List<String> appids){ public Page<CylinderInfoDto> cyinderInfoList(Page<CylinderInfoDto> page, CylinderInfoDto cylinderInfoDto, String sort,List<String> appids){
return cylinderInfoMapper.cyinderInfoList(page,cylinderInfoDto,sort,appids); return cylinderInfoMapper.cyinderInfoList(page,cylinderInfoDto,sort,appids);
} }
public Page<CylinderInfoDto> cyinderOutInfoList(Page<CylinderInfoDto> page, CylinderInfoDto cylinderInfoDto, String sort,List<String> appids){
return cylinderInfoMapper.cyinderOutInfoList(page,cylinderInfoDto,sort,appids);
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment