Commit b9c47c64 authored by KeYong's avatar KeYong

修改消防器材接去掉系统过滤

parent 10f7894d
...@@ -157,6 +157,21 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -157,6 +157,21 @@ public class FireFightingSystemController extends AbstractBaseController {
return fireFightingSystemService.getEquipCountPageBySystemId(systemId, pageNumber, pageSize, bizOrgCode); return fireFightingSystemService.getEquipCountPageBySystemId(systemId, pageNumber, pageSize, bizOrgCode);
} }
@RequestMapping(value = "/getEquipCountPage", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("消防器材查询设备数量列表")
public Page<EquipCountBySystemVO> getEquipCountPage(
@RequestParam(value = "systemId", required = false) Long systemId,
@RequestParam(value = "pageNumber", required = false) Integer pageNumber,
@RequestParam(value = "pageSize", required = false) Integer pageSize,
@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) {
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.getEquipCountPage(systemId, pageNumber, pageSize, bizOrgCode);
}
@RequestMapping(value = "/getFireEquipConfigInfo", method = RequestMethod.GET) @RequestMapping(value = "/getFireEquipConfigInfo", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("根据字典查询相关信息") @ApiOperation("根据字典查询相关信息")
......
...@@ -56,6 +56,8 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -56,6 +56,8 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
Page<EquipCountBySystemVO> getEquipCountPageBySystemId(@Param("page") Page<Object> page, @Param("systemId") Long systemId, @Param("bizOrgCode") String bizOrgCode); Page<EquipCountBySystemVO> getEquipCountPageBySystemId(@Param("page") Page<Object> page, @Param("systemId") Long systemId, @Param("bizOrgCode") String bizOrgCode);
Page<EquipCountBySystemVO> getEquipCountPage(@Param("page") Page<Object> page, @Param("systemId") Long systemId, @Param("bizOrgCode") String bizOrgCode);
/** /**
* 保存 * 保存
* *
......
...@@ -68,6 +68,14 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -68,6 +68,14 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
Page<EquipCountBySystemVO> getEquipCountPageBySystemId(Long systemId, Integer pageNumber, Integer pageSize, String bizOrgCode); Page<EquipCountBySystemVO> getEquipCountPageBySystemId(Long systemId, Integer pageNumber, Integer pageSize, String bizOrgCode);
/** /**
* 消防器材查询设备数量列表
*
* @param systemId
* @return
*/
Page<EquipCountBySystemVO> getEquipCountPage(Long systemId, Integer pageNumber, Integer pageSize, String bizOrgCode);
/**
* 保存 * 保存
* *
* @param vo * @param vo
......
...@@ -205,6 +205,10 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -205,6 +205,10 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
return this.baseMapper.getEquipCountPageBySystemId(new Page(pageNumber, pageSize), systemId, bizOrgCode); return this.baseMapper.getEquipCountPageBySystemId(new Page(pageNumber, pageSize), systemId, bizOrgCode);
} }
@Override
public Page<EquipCountBySystemVO> getEquipCountPage(Long systemId, Integer pageNumber, Integer pageSize, String bizOrgCode) {
return this.baseMapper.getEquipCountPage(new Page(pageNumber, pageSize), systemId, bizOrgCode);
}
@Override @Override
public List<EquiplistSpecificBySystemVO> public List<EquiplistSpecificBySystemVO>
......
...@@ -142,6 +142,34 @@ ...@@ -142,6 +142,34 @@
</where> </where>
group by wle.code group by wle.code
</select> </select>
<select id="getEquipCountPage" resultMap="EquipCountBySystemId">
SELECT
wle.id equipment_id,
wle.code equipment_code,
wle.NAME equipment_name,
count(spe.id) num,
wle.`code` equip_code,
unit.name unit_name,
wle.shbz_img img,
cate.NAME AS equipmentCateGoryName
FROM
wl_equipment_specific AS spe
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>
wle.id is not null
<if test="systemId != null and systemId != ''">
AND find_in_set(#{systemId},spe.system_id)
</if>
<if test="bizOrgCode != null and bizOrgCode != ''">
AND spe.biz_org_code like concat (#{bizOrgCode},'%')
</if>
</where>
group by wle.code
</select>
<insert id="save"> <insert id="save">
INSERT INTO INSERT INTO
f_fire_fighting_system f_fire_fighting_system
...@@ -6810,7 +6838,7 @@ ...@@ -6810,7 +6838,7 @@
) a ON a.`code` = wes.equipment_code ) a ON a.`code` = wes.equipment_code
LEFT JOIN wl_unit wu ON wu.id = a.unit_id LEFT JOIN wl_unit wu ON wu.id = a.unit_id
WHERE WHERE
a.`name` IS NOT NULL AND wes.system_id IS NOT NULL a.`name` IS NOT NULL
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
AND wes.biz_org_code like concat (#{bizOrgCode},'%') AND wes.biz_org_code like concat (#{bizOrgCode},'%')
</if> </if>
...@@ -6847,7 +6875,7 @@ ...@@ -6847,7 +6875,7 @@
</where> </where>
) a ON a.`code` = wes.equipment_code ) a ON a.`code` = wes.equipment_code
WHERE WHERE
a.`name` IS NOT NULL AND wes.system_id IS NOT NULL a.`name` IS NOT NULL
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
AND wes.biz_org_code like concat (#{bizOrgCode},'%') AND wes.biz_org_code like concat (#{bizOrgCode},'%')
</if> </if>
...@@ -6873,7 +6901,6 @@ ...@@ -6873,7 +6901,6 @@
<foreach collection="codes" item="item" index="index" open="(" close=")" separator=","> <foreach collection="codes" item="item" index="index" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
AND spe.system_id IS NOT NULL
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
AND spe.biz_org_code like concat (#{bizOrgCode},'%') AND spe.biz_org_code like concat (#{bizOrgCode},'%')
</if> </if>
......
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