Commit 62347008 authored by KeYong's avatar KeYong

统一消防资源-消防器材设备统计逻辑

parent 1b6ac106
...@@ -140,9 +140,14 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -140,9 +140,14 @@ public class FireFightingSystemController extends AbstractBaseController {
public Page<EquipCountBySystemVO> getEquipCountPageBySystemId( public Page<EquipCountBySystemVO> getEquipCountPageBySystemId(
@RequestParam(value = "systemId", required = false) Long systemId, @RequestParam(value = "systemId", required = false) Long systemId,
@RequestParam(value = "pageNumber", required = false) Integer pageNumber, @RequestParam(value = "pageNumber", required = false) Integer pageNumber,
@RequestParam(value = "pageSize", required = false) Integer pageSize @RequestParam(value = "pageSize", required = false) Integer pageSize,
@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode
) { ) {
return fireFightingSystemService.getEquipCountPageBySystemId(systemId, pageNumber, pageSize); if (org.apache.commons.lang3.StringUtils.isBlank(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && org.apache.commons.lang3.StringUtils.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null;
}
return fireFightingSystemService.getEquipCountPageBySystemId(systemId, pageNumber, pageSize, bizOrgCode);
} }
@RequestMapping(value = "/getFireEquipConfigInfo", method = RequestMethod.GET) @RequestMapping(value = "/getFireEquipConfigInfo", method = RequestMethod.GET)
......
...@@ -53,7 +53,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -53,7 +53,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
*/ */
List<EquipCountBySystemVO> getEquipCountBySystemId(Long systemId); List<EquipCountBySystemVO> getEquipCountBySystemId(Long systemId);
Page<EquipCountBySystemVO> getEquipCountPageBySystemId(@Param("page") Page<Object> page, @Param("systemId") Long systemId); Page<EquipCountBySystemVO> getEquipCountPageBySystemId(@Param("page") Page<Object> page, @Param("systemId") Long systemId, @Param("bizOrgCode") String bizOrgCode);
/** /**
* 保存 * 保存
......
...@@ -65,7 +65,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -65,7 +65,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
* @param systemId * @param systemId
* @return * @return
*/ */
Page<EquipCountBySystemVO> getEquipCountPageBySystemId(Long systemId, Integer pageNumber, Integer pageSize); Page<EquipCountBySystemVO> getEquipCountPageBySystemId(Long systemId, Integer pageNumber, Integer pageSize, String bizOrgCode);
/** /**
* 保存 * 保存
......
...@@ -201,8 +201,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -201,8 +201,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} }
@Override @Override
public Page<EquipCountBySystemVO> getEquipCountPageBySystemId(Long systemId, Integer pageNumber, Integer pageSize) { public Page<EquipCountBySystemVO> getEquipCountPageBySystemId(Long systemId, Integer pageNumber, Integer pageSize, String bizOrgCode) {
return this.baseMapper.getEquipCountPageBySystemId(new Page(pageNumber, pageSize), systemId); return this.baseMapper.getEquipCountPageBySystemId(new Page(pageNumber, pageSize), systemId, bizOrgCode);
} }
......
...@@ -124,16 +124,18 @@ ...@@ -124,16 +124,18 @@
cate.NAME AS equipmentCateGoryName cate.NAME AS equipmentCateGoryName
FROM FROM
wl_equipment_specific AS spe wl_equipment_specific AS spe
LEFT JOIN wl_equipment_detail AS det ON spe.equipment_detail_id = det.id LEFT JOIN wl_equipment AS wle ON wle.`code` = spe.equipment_code
LEFT JOIN wl_equipment AS wle ON wle.id = det.equipment_id LEFT JOIN wl_equipment_category cate ON cate.id = wle.category_id
LEFT JOIN wl_equipment_category cate ON cate.id = wle.category_id LEFT JOIN wl_unit as unit ON wle.unit_id = unit.id
LEFT JOIN wl_unit as unit ON wle.unit_id = unit.id
<where> <where>
<if test="systemId != null and systemId != ''"> <if test="systemId != null and systemId != ''">
find_in_set(#{systemId},spe.system_id) and spe.single = true find_in_set(#{systemId},spe.system_id) and spe.single = true
</if> </if>
<if test="bizOrgCode != null and bizOrgCode != ''">
AND spe.biz_org_code like concat (#{bizOrgCode},'%')
</if>
</where> </where>
group by wle.id wle.`code`
</select> </select>
<insert id="save"> <insert id="save">
INSERT INTO INSERT INTO
......
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