Commit 6401d514 authored by KeYong's avatar KeYong

补充列表接口

parent cb3dd5de
......@@ -624,4 +624,18 @@ public class EquipmentSpecificController extends AbstractBaseController {
return equipmentSpecificMapper.getFireEquipStatistic(bizOrgCode);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/fire/equip/list")
@ApiOperation(httpMethod = "GET", value = "根据装备分类code获取装备list", notes = "根据装备分类code获取装备list")
public List<Map<String, Object>> getFireEquipListByDefineCode(@RequestParam(value = "code") String code){
ReginParams reginParams = JSONObject.parseObject(redisUtils
.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(),
ReginParams.class);
String bizOrgCode = null;
if (reginParams != null && reginParams.getCompany() !=null && !org.apache.commons.lang3.ObjectUtils.isEmpty(reginParams.getCompany().getOrgCode())) {
bizOrgCode = reginParams.getPersonIdentity().getBizOrgCode();
}
return equipmentSpecificMapper.getFireEquipListByDefineCode(bizOrgCode, code);
}
}
......@@ -338,6 +338,8 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
List<Map<String, Object>> getFireEquipStatistic(@Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> getFireEquipListByDefineCode(@Param("bizOrgCode") String bizOrgCode, @Param("code") String code);
Integer selectEquipmentCountBySystemId(@Param("systemId") Long systemId);
}
......@@ -2900,18 +2900,18 @@
And find_in_set(es.id, #{bussIds}) > 0
</if>
</select>
<select id="getFireEquipStatistic" resultType="Map">
SELECT
a.`name` AS `name`,
wes.equipment_code AS `code`,
COUNT(1) AS `value`,
IFNULL(wu.`name`, '') AS unit,
IFNULL(IF(a.img IS NOT NULL, a.img, a.shbz_img), '') AS icon
FROM
wl_equipment_specific wes
LEFT JOIN wl_equipment_detail wed ON wed.id = wes.equipment_detail_id
LEFT JOIN (SELECT id, `code`, `name`, img, shbz_img, unit_id FROM wl_equipment WHERE LEFT(`code`, 1) IN (1, 3, 4, 5, 6, 7, 8)) a ON a.id = wed.equipment_id
LEFT JOIN wl_unit wu ON wu.id = a.unit_id
LEFT JOIN (SELECT id, `code`, `name`, img, shbz_img, unit_id FROM wl_equipment WHERE LEFT(`code`, 1) IN (1, 3, 4, 5, 6, 7, 8)) a ON a.`code` = wes.equipment_code
LEFT JOIN wl_unit wu ON wu.id = a.unit_id
WHERE
a.`name` IS NOT NULL
<if test="bizOrgCode != null and bizOrgCode != ''">
......@@ -2921,6 +2921,26 @@
wes.equipment_code
</select>
<select id="getFireEquipListByDefineCode" resultType="Map">
SELECT
wes.id AS specificId,
a.`name` AS `typeName`,
wes.biz_org_name AS bizOrgName,
wes.`name` AS `name`,
wes.equip_status AS equipStatus
FROM
wl_equipment_specific wes
LEFT JOIN (SELECT id, `code`, `name`, img, shbz_img, unit_id FROM wl_equipment WHERE LEFT(`code`, 1) IN (1, 3, 4, 5, 6, 7, 8)) a ON a.`code` = wes.equipment_code
<where>
<if test="code != null and code != ''">
wes.equipment_code = #{code}
</if>
<if test="bizOrgCode != null and bizOrgCode != ''">
AND wes.biz_org_code like concat (#{bizOrgCode},'%')
</if>
</where>
</select>
<select id="selectEquipmentCountBySystemId" resultType="int">
SELECT
es.id,
......
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