Commit dea7726b authored by zhangyingbin's avatar zhangyingbin

气瓶总览页面-地图接口修改

parent d658de41
...@@ -86,4 +86,18 @@ public class CylinderUnitDto extends BaseDto { ...@@ -86,4 +86,18 @@ public class CylinderUnitDto extends BaseDto {
@ApiModelProperty(value = "所属区域") @ApiModelProperty(value = "所属区域")
private String regionName; private String regionName;
/**
* 气瓶数量
*/
private String cylinderNumber;
/**
* 检验过期气瓶数
*/
private String cylinderOutOfDate;
/**
* 许可有限期
*/
private String fillingPermitDate;
} }
...@@ -22,7 +22,7 @@ public interface CylinderInfoMapper extends BaseMapper<CylinderInfo> { ...@@ -22,7 +22,7 @@ public interface CylinderInfoMapper extends BaseMapper<CylinderInfo> {
* @param sequenceNbr * @param sequenceNbr
* @return * @return
*/ */
Map<String, Long> queryNumAndOutOfDateNum(@Param("sequenceNbr") Long sequenceNbr); Map<String, String> queryNumAndOutOfDateNum(@Param("sequenceNbr") Long sequenceNbr);
/** /**
* 获取上个月气瓶总量 * 获取上个月气瓶总量
......
...@@ -16,5 +16,5 @@ public interface ICylinderInfoService { ...@@ -16,5 +16,5 @@ public interface ICylinderInfoService {
* @param unitId * @param unitId
* @return * @return
*/ */
Map<String, Long> queryNumAndOutOfDateNum(Long unitId); Map<String, String> queryNumAndOutOfDateNum(Long unitId);
} }
...@@ -4,21 +4,18 @@ ...@@ -4,21 +4,18 @@
<select id="queryNumAndOutOfDateNum" resultType="java.util.Map"> <select id="queryNumAndOutOfDateNum" resultType="java.util.Map">
SELECT SELECT
count( t.sequence_nbr ) AS cylinderNum, count( t.sequence_nbr ) AS cylinderNum,
count( CASE WHEN i.next_inspection_date <![CDATA[ < ]]> now() THEN 1 ELSE 0 END ) AS outOfDateNum l.expiry_date AS fillingPermitDate,
count( CASE WHEN i.next_inspection_date <![CDATA[ < ]]> now() THEN 1 ELSE 0 END ) AS outOfDateNum
FROM FROM
tz_cylinder_info t tz_cylinder_unit U
LEFT JOIN tz_cylinder_inspection AS i ON i.sequence_code=t.sequence_code LEFT JOIN tz_cylinder_info AS t ON u.credit_code = t.credit_code
LEFT JOIN tz_cylinder_inspection AS i ON i.sequence_code = t.sequence_code and t.app_id = u.app_id
LEFT JOIN tz_base_unit_licence AS l ON l.unit_code = u.credit_code
WHERE WHERE
t.sequence_nbr IN ( SELECT max( tt.sequence_nbr ) FROM tz_cylinder_info tt GROUP BY tt.sequence_code ) t.sequence_nbr IN ( SELECT max( tt.sequence_nbr ) FROM tz_cylinder_info tt GROUP BY tt.sequence_code )
AND t.app_id = ( AND u.sequence_nbr = #{sequenceNbr}
SELECT GROUP BY t.sequence_nbr
u.app_id
FROM
tz_cylinder_unit u
WHERE
u.sequence_nbr = #{sequenceNbr}
)
</select> </select>
<sql id="selectAPPIdByRegionCode"> <sql id="selectAPPIdByRegionCode">
......
...@@ -79,13 +79,16 @@ public class CylinderUnitController extends BaseController { ...@@ -79,13 +79,16 @@ public class CylinderUnitController extends BaseController {
public ResponseModel<CylinderUnitDto> selectOne(@RequestParam Long id) { public ResponseModel<CylinderUnitDto> selectOne(@RequestParam Long id) {
CylinderUnitDto unit = cylinderUnitServiceImpl.queryBySeq(id); CylinderUnitDto unit = cylinderUnitServiceImpl.queryBySeq(id);
// 查询气瓶数量以及过期数量 // 查询气瓶数量以及过期数量
Map<String, Long> cylinderInfo = iCylinderInfoService.queryNumAndOutOfDateNum(unit.getSequenceNbr()); Map<String, String> cylinderInfo = iCylinderInfoService.queryNumAndOutOfDateNum(unit.getSequenceNbr());
if(cylinderInfo != null) { if(cylinderInfo != null) {
if(cylinderInfo.get("cylinderNum") != null) { if(cylinderInfo.get("cylinderNum") != null) {
// unit.setCylinderNumber(cylinderInfo.get("cylinderNum")); unit.setCylinderNumber(String.valueOf(cylinderInfo.get("cylinderNum")));
} }
if(cylinderInfo.get("outOfDateNum") != null) { if(cylinderInfo.get("outOfDateNum") != null) {
// unit.setCylinderOutOfDate(cylinderInfo.get("outOfDateNum")); unit.setCylinderOutOfDate(String.valueOf(cylinderInfo.get("outOfDateNum")));
}
if(cylinderInfo.get("fillingPermitDate") != null){
unit.setFillingPermitDate(String.valueOf(cylinderInfo.get("fillingPermitDate")));
} }
} }
return ResponseHelper.buildResponse(unit); return ResponseHelper.buildResponse(unit);
......
...@@ -126,7 +126,7 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind ...@@ -126,7 +126,7 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
} }
@Override @Override
public Map<String, Long> queryNumAndOutOfDateNum(Long unitId) { public Map<String, String> queryNumAndOutOfDateNum(Long unitId) {
return baseMapper.queryNumAndOutOfDateNum(unitId); return baseMapper.queryNumAndOutOfDateNum(unitId);
} }
......
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