Commit 62347008 authored by KeYong's avatar KeYong

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

parent 1b6ac106
......@@ -140,9 +140,14 @@ public class FireFightingSystemController extends AbstractBaseController {
public Page<EquipCountBySystemVO> getEquipCountPageBySystemId(
@RequestParam(value = "systemId", required = false) Long systemId,
@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)
......
......@@ -53,7 +53,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
*/
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
* @param systemId
* @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
}
@Override
public Page<EquipCountBySystemVO> getEquipCountPageBySystemId(Long systemId, Integer pageNumber, Integer pageSize) {
return this.baseMapper.getEquipCountPageBySystemId(new Page(pageNumber, pageSize), systemId);
public Page<EquipCountBySystemVO> getEquipCountPageBySystemId(Long systemId, Integer pageNumber, Integer pageSize, String bizOrgCode) {
return this.baseMapper.getEquipCountPageBySystemId(new Page(pageNumber, pageSize), systemId, bizOrgCode);
}
......
......@@ -124,16 +124,18 @@
cate.NAME AS equipmentCateGoryName
FROM
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.id = det.equipment_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_equipment AS wle ON wle.`code` = spe.equipment_code
LEFT JOIN wl_equipment_category cate ON cate.id = wle.category_id
LEFT JOIN wl_unit as unit ON wle.unit_id = unit.id
<where>
<if test="systemId != null and systemId != ''">
find_in_set(#{systemId},spe.system_id) and spe.single = true
</if>
<if test="bizOrgCode != null and bizOrgCode != ''">
AND spe.biz_org_code like concat (#{bizOrgCode},'%')
</if>
</where>
group by wle.id
wle.`code`
</select>
<insert id="save">
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