Commit c7a51b5a authored by zhangsen's avatar zhangsen

大屏API修改

parent 9fa4453c
...@@ -45,7 +45,7 @@ public interface FirefightersMapper extends BaseMapper<Firefighters> { ...@@ -45,7 +45,7 @@ public interface FirefightersMapper extends BaseMapper<Firefighters> {
Integer getTeamCountByCode(@Param("companyCode") String companyCode); Integer getTeamCountByCode(@Param("companyCode") String companyCode);
Map<String, Object> getFireForceInfoByCode(@Param("companyCode") String companyCode); Map<String, Object> getFireForceInfoByCode(@Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> getStationSignInfo(@Param("companyCode") String companyCode); List<Map<String, Object>> getStationSignInfo(@Param("bizOrgCode") String bizOrgCode);
} }
...@@ -495,8 +495,8 @@ LEFT JOIN cb_fire_team cft ON cff.fire_team_id = cft.sequence_nbr ...@@ -495,8 +495,8 @@ LEFT JOIN cb_fire_team cft ON cff.fire_team_id = cft.sequence_nbr
WHERE WHERE
u.is_delete = 0 u.is_delete = 0
AND u.biz_org_type = 'PERSON' AND u.biz_org_type = 'PERSON'
<if test="companyCode != null and companyCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
AND u.`code` = #{companyCode} AND u.`biz_org_code` like concat(#{bizOrgCode}, '%')
</if> </if>
GROUP BY GROUP BY
u.sequence_nbr u.sequence_nbr
...@@ -505,35 +505,164 @@ LEFT JOIN cb_fire_team cft ON cff.fire_team_id = cft.sequence_nbr ...@@ -505,35 +505,164 @@ LEFT JOIN cb_fire_team cft ON cff.fire_team_id = cft.sequence_nbr
</select> </select>
<select id="getStationSignInfo" resultType="java.util.Map"> <select id="getStationSignInfo" resultType="java.util.Map">
SELECT b.qualifiedNum, b.unQualifiedNum, (TRUNCATE ( abs(( b.qualifiedNum ) / IF (( b.totalNum = 0 ), <!-- SELECT b.qualifiedNum, b.unQualifiedNum, (TRUNCATE ( abs(( b.qualifiedNum ) / IF (( b.totalNum = 0 ),-->
1, <!-- 1,-->
b.totalNum <!-- b.totalNum-->
)) * 100 ,2)) as qualifiedAbs <!-- )) * 100 ,2)) as qualifiedAbs-->
FROM <!-- FROM-->
( <!-- (-->
<!-- SELECT-->
<!-- count( a.signCount &gt;= 8 OR NULL ) AS qualifiedNum,-->
<!-- count( 1 ) AS totalNum,-->
<!-- count( a.signCount &lt; 8 OR NULL ) AS unQualifiedNum-->
<!-- FROM-->
<!-- (-->
<!-- SELECT-->
<!-- si.`code`,-->
<!-- count( DISTINCT cs.user_id ) AS signCount-->
<!-- FROM-->
<!-- idx_biz_station_info si-->
<!-- LEFT JOIN cb_org_usr ou ON ou.`code` = si.`code`-->
<!-- AND ou.is_delete = 0-->
<!-- LEFT JOIN cb_sign cs ON cs.biz_org_code = ou.biz_org_code-->
<!-- AND cs.date LIKE CONCAT( DATE_FORMAT( now(), '%Y-%m' ), '%' )-->
<!-- <where>-->
<!-- <if test="companyCode != null and companyCode != ''">-->
<!-- si.`code` = #{companyCode}-->
<!-- </if>-->
<!-- </where>-->
<!-- GROUP BY-->
<!-- si.`code`-->
<!-- ) a-->
<!-- ) b-->
<!-- SELECT-->
<!-- sum( c.isNormal ) AS qualifiedNum,-->
<!-- (-->
<!-- count( 1 ) - sum( c.isNormal )) AS unQualifiedNum,-->
<!-- (-->
<!-- TRUNCATE (-->
<!-- abs(-->
<!-- sum( c.isNormal ) /-->
<!-- IF-->
<!-- (( count( 1 ) = 0 ), 1, count( 1 ) )) * 100,-->
<!-- 2-->
<!-- )) AS qualifiedAbs-->
<!-- FROM-->
<!-- (-->
<!-- SELECT-->
<!-- si.`code`,-->
<!-- CASE-->
<!-- WHEN count( b.`date` IS NOT NULL OR NULL ) = DATEDIFF(-->
<!-- DATE_ADD( CURDATE(), INTERVAL 1 DAY ),-->
<!-- DATE_ADD( curdate(), INTERVAL - DAY ( curdate()) + 1 DAY )) THEN-->
<!-- 1 ELSE 0-->
<!-- END AS isNormal-->
<!-- FROM-->
<!-- idx_biz_station_info si-->
<!-- LEFT JOIN (-->
<!-- SELECT-->
<!-- *-->
<!-- FROM-->
<!-- (-->
<!-- SELECT-->
<!-- t.date,-->
<!-- count( DISTINCT cs.user_id ) AS num,-->
<!-- si.`code`-->
<!-- FROM-->
<!-- (-->
<!-- SELECT-->
<!-- DATE_ADD( DATE_ADD( CURDATE(), INTERVAL - 1 DAY ), INTERVAL @s DAY ) AS date,-->
<!-- @s := @s - 1 AS `index`-->
<!-- FROM-->
<!-- mysql.help_topic,-->
<!-- ( SELECT @s := 1 ) temp-->
<!-- WHERE-->
<!-- @s > DATEDIFF( date_add( curdate(), INTERVAL - DAY ( curdate()) + 1 DAY ), CURDATE() )) t-->
<!-- LEFT JOIN cb_sign cs ON cs.date = t.date-->
<!-- LEFT JOIN cb_org_usr ou ON ou.`biz_org_code` = cs.`biz_org_code`-->
<!-- AND ou.is_delete = 0-->
<!-- LEFT JOIN idx_biz_station_info si ON si.`code` = ou.`code`-->
<!-- GROUP BY-->
<!-- t.date,-->
<!-- si.`code`-->
<!-- ) a-->
<!-- WHERE-->
<!-- num &gt;= 8-->
<!-- ) b ON b.`code` = si.`code`-->
<!-- <where>-->
<!-- <if test="bizOrgCode != null and bizOrgCode != ''">-->
<!-- si.`code` = #{bizOrgCode}-->
<!-- </if>-->
<!-- </where>-->
<!-- GROUP BY-->
<!-- si.`code`-->
<!-- ) c-->
SELECT SELECT
count( a.signCount &gt;= 8 OR NULL ) AS qualifiedNum, sum( c.isNormal ) AS qualifiedNum,
count( 1 ) AS totalNum, (
count( a.signCount &lt; 8 OR NULL ) AS unQualifiedNum count( 1 ) - sum( c.isNormal )) AS unQualifiedNum,
(
TRUNCATE (
abs(
sum( c.isNormal ) /
IF
(( count( 1 ) = 0 ), 1, count( 1 ) )) * 100,
2
)) AS qualifiedAbs
FROM FROM
( (
SELECT SELECT
si.`code`, si.`code`,
count( DISTINCT cs.user_id ) AS signCount CASE
WHEN count( b.`date` IS NOT NULL OR NULL ) = DATEDIFF(
DATE_ADD( CURDATE(), INTERVAL 1 DAY ),
DATE_ADD( curdate(), INTERVAL - DAY ( curdate()) + 1 DAY )) THEN
1 ELSE 0
END AS isNormal
FROM FROM
idx_biz_station_info si idx_biz_station_info si
LEFT JOIN cb_org_usr ou ON ou.`code` = si.`code` LEFT JOIN (
SELECT
*
FROM
(
SELECT
t.date,
count( DISTINCT cs.user_id ) AS num,
si.`code`
FROM
(
SELECT
DATE_ADD( DATE_ADD( CURDATE(), INTERVAL - 1 DAY ), INTERVAL @s DAY ) AS date,
@s := @s - 1 AS `index`
FROM
mysql.help_topic,
( SELECT @s := 1 ) temp
WHERE
@s > DATEDIFF( date_add( curdate(), INTERVAL - DAY ( curdate()) + 1 DAY ), CURDATE() )) t
LEFT JOIN cb_sign cs ON cs.date = t.date
LEFT JOIN cb_org_usr ou ON ou.`biz_org_code` = cs.`biz_org_code`
AND ou.is_delete = 0 AND ou.is_delete = 0
LEFT JOIN cb_sign cs ON cs.biz_org_code = ou.biz_org_code LEFT JOIN idx_biz_station_info si ON si.`code` = ou.`code`
AND cs.date LIKE CONCAT( DATE_FORMAT( now(), '%Y-%m' ), '%' )
<where>
<if test="companyCode != null and companyCode != ''">
si.`code` = #{companyCode}
</if>
</where>
GROUP BY GROUP BY
t.date,
si.`code` si.`code`
) a ) a
) b WHERE
num >= 8
) b ON b.`code` = si.`code`
LEFT JOIN cb_org_usr ou1 ON ou1.`code` = si.`code`
AND is_delete = 0
<where>
<if test="bizOrgCode != null and bizOrgCode != ''">
ou1.`biz_org_code` = #{bizOrgCode}
</if>
</where>
GROUP BY
si.`code`
) c
</select> </select>
</mapper> </mapper>
...@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisKey; ...@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.module.common.api.dto.*; import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
...@@ -57,6 +58,8 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi ...@@ -57,6 +58,8 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
OrgUsrServiceImpl orgUsrService; OrgUsrServiceImpl orgUsrService;
@Autowired @Autowired
FirefightersContactsServiceImpl ifirefightersContactsService; FirefightersContactsServiceImpl ifirefightersContactsService;
@Autowired
private OrgUsrMapper orgUsrMapper;
@Override @Override
public List<FirefightersZhDto> getFirefighters(int pageNum, int pageSize, FirefightersDto par) { public List<FirefightersZhDto> getFirefighters(int pageNum, int pageSize, FirefightersDto par) {
...@@ -273,9 +276,16 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi ...@@ -273,9 +276,16 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
@Override @Override
public BigScreen1VO getFireForceInfoByCode(String companyCode) { public BigScreen1VO getFireForceInfoByCode(String companyCode) {
String bizOrgCode = null;
if (StringUtils.isNotEmpty(companyCode)) {
OrgUsr orgUsr = orgUsrMapper.queryByCompanyCode(companyCode);
if (ObjectUtils.isNotEmpty(orgUsr)) {
bizOrgCode = orgUsr.getBizOrgCode();
}
}
BigScreen1VO bigScreen1VO = new BigScreen1VO(); BigScreen1VO bigScreen1VO = new BigScreen1VO();
Integer teamCount = firefightersMapper.getTeamCountByCode(companyCode); // Integer teamCount = firefightersMapper.getTeamCountByCode(companyCode);
Map<String, Object> fireForceInfoByCode = firefightersMapper.getFireForceInfoByCode(companyCode); Map<String, Object> fireForceInfoByCode = firefightersMapper.getFireForceInfoByCode(bizOrgCode);
List<Map<String, Object>> personInfoList = new ArrayList<>(); List<Map<String, Object>> personInfoList = new ArrayList<>();
HashMap<String, Object> fireInfo = new HashMap<>(); HashMap<String, Object> fireInfo = new HashMap<>();
fireInfo.put("fireCer", fireForceInfoByCode.get("fireCer")); fireInfo.put("fireCer", fireForceInfoByCode.get("fireCer"));
...@@ -292,12 +302,12 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi ...@@ -292,12 +302,12 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
bigScreen1VO.setPersonList(personInfoList); bigScreen1VO.setPersonList(personInfoList);
List<Map<String, Object>> teamInfoList = new ArrayList<>(); List<Map<String, Object>> teamInfoList = new ArrayList<>();
HashMap<String, Object> teamInfoMap = new HashMap<>(); HashMap<String, Object> teamInfoMap = new HashMap<>();
teamInfoMap.put("teamNum", teamCount); // teamInfoMap.put("teamNum", teamCount);
teamInfoList.add(teamInfoMap); teamInfoList.add(teamInfoMap);
bigScreen1VO.setTeamNumInfo(teamInfoList); bigScreen1VO.setTeamNumInfo(teamInfoList);
// bigScreen1VO.setTeamNum(teamCount); // bigScreen1VO.setTeamNum(teamCount);
// bigScreen1VO.setFirefightersInfo(fireForceInfoByCode); // bigScreen1VO.setFirefightersInfo(fireForceInfoByCode);
List<Map<String, Object>> stationSignInfo = firefightersMapper.getStationSignInfo(companyCode); List<Map<String, Object>> stationSignInfo = firefightersMapper.getStationSignInfo(bizOrgCode);
bigScreen1VO.setUsrSignInfo(stationSignInfo); bigScreen1VO.setUsrSignInfo(stationSignInfo);
return bigScreen1VO; return bigScreen1VO;
} }
......
...@@ -374,17 +374,17 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -374,17 +374,17 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
/** /**
* 获取系统告警信息 * 获取系统告警信息
* @param companyCode * @param bizOrgCode
* @return * @return
*/ */
List<Map<String, Object>> getSystemAlarmInfoNum(@Param("companyCode") String companyCode); List<Map<String, Object>> getSystemAlarmInfoNum(@Param("bizOrgCode") String bizOrgCode);
/** /**
* 消防水池或者工业水池信息 * 消防水池或者工业水池信息
* @param companyCode * @param bizOrgCode
* @return * @return
*/ */
List<Map<String, Object>> getWaterPoolInfoNum(@Param("companyCode") String companyCode, @Param("poolType") String poolType); List<Map<String, Object>> getWaterPoolInfoNum(@Param("bizOrgCode") String bizOrgCode, @Param("poolType") String poolType);
/** /**
* 消防水源总量统计 * 消防水源总量统计
...@@ -400,9 +400,9 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -400,9 +400,9 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
*/ */
Integer getCarNum(@Param("companyCode") String companyCode); Integer getCarNum(@Param("companyCode") String companyCode);
List<Map<String, Object>> getCarInfo(@Param("companyCode") String companyCode); List<Map<String, Object>> getCarInfo(@Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> getEquipInfo(@Param("companyCode") String companyCode, @Param("alarmType") String alarmType); List<Map<String, Object>> getEquipInfo(@Param("bizOrgCode") String bizOrgCode, @Param("alarmType") String alarmType);
/** /**
* 统计某站下装备总数、摄像头总数 * 统计某站下装备总数、摄像头总数
...@@ -465,4 +465,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -465,4 +465,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
*/ */
Page<Map<String, Object>> equipList (Page page, @Param("bizOrgCode") String bizOrgCode); Page<Map<String, Object>> equipList (Page page, @Param("bizOrgCode") String bizOrgCode);
String queryByCompanyCode(@Param("companyCode") String companyCode);
} }
...@@ -1412,17 +1412,21 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1412,17 +1412,21 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Override @Override
public BigScreenVo getCarInfo(String companyCode) { public BigScreenVo getCarInfo(String companyCode) {
String bizOrgCode = null;
if (StringUtil.isNotEmpty(companyCode)) {
bizOrgCode = fireFightingSystemMapper.queryByCompanyCode(companyCode);
}
BigScreenVo bigScreenVo = new BigScreenVo(); BigScreenVo bigScreenVo = new BigScreenVo();
List<Map<String, Object>> carInfo = fireFightingSystemMapper.getCarInfo(companyCode); List<Map<String, Object>> carInfo = fireFightingSystemMapper.getCarInfo(bizOrgCode);
bigScreenVo.setCarNumInfo(carInfo); bigScreenVo.setCarNumInfo(carInfo);
List<Map<String, Object>> systemAlarmInfoNum = fireFightingSystemMapper.getSystemAlarmInfoNum(companyCode); List<Map<String, Object>> systemAlarmInfoNum = fireFightingSystemMapper.getSystemAlarmInfoNum(bizOrgCode);
List<Map<String, Object>> pool = fireFightingSystemMapper.getWaterPoolInfoNum(companyCode, "pool"); List<Map<String, Object>> pool = fireFightingSystemMapper.getWaterPoolInfoNum(bizOrgCode, "pool");
List<Map<String, Object>> industryPool = fireFightingSystemMapper.getWaterPoolInfoNum(companyCode, "industryPool"); List<Map<String, Object>> industryPool = fireFightingSystemMapper.getWaterPoolInfoNum(bizOrgCode, "industryPool");
bigScreenVo.setSystemAlarmInfoNum(systemAlarmInfoNum); bigScreenVo.setSystemAlarmInfoNum(systemAlarmInfoNum);
bigScreenVo.setIndustryPool(industryPool); bigScreenVo.setIndustryPool(industryPool);
bigScreenVo.setPool(pool); bigScreenVo.setPool(pool);
List<Map<String, Object>> equipInfo = fireFightingSystemMapper.getEquipInfo(companyCode, null); List<Map<String, Object>> equipInfo = fireFightingSystemMapper.getEquipInfo(bizOrgCode, null);
List<Map<String, Object>> breakdown = fireFightingSystemMapper.getEquipInfo(companyCode, "BREAKDOWN"); List<Map<String, Object>> breakdown = fireFightingSystemMapper.getEquipInfo(bizOrgCode, "BREAKDOWN");
bigScreenVo.setEquipInfo(equipInfo); bigScreenVo.setEquipInfo(equipInfo);
bigScreenVo.setBreakdownInfo(breakdown); bigScreenVo.setBreakdownInfo(breakdown);
return bigScreenVo; return bigScreenVo;
......
...@@ -2677,11 +2677,10 @@ ...@@ -2677,11 +2677,10 @@
IFNULL( sum( esa.`status` ), 0 ) AS alarmNum IFNULL( sum( esa.`status` ), 0 ) AS alarmNum
FROM FROM
f_fire_fighting_system fs f_fire_fighting_system fs
LEFT JOIN cb_org_usr ou ON ou.biz_org_code = fs.biz_org_code
LEFT JOIN wl_equipment_specific_alarm esa ON FIND_IN_SET( fs.id, esa.system_ids ) LEFT JOIN wl_equipment_specific_alarm esa ON FIND_IN_SET( fs.id, esa.system_ids )
<where> <where>
<if test="companyCode != null and companyCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
ou.`code` = #{companyCode} fs.`biz_org_code` like concat(#{bizOrgCode}, '%')
</if> </if>
</where> </where>
GROUP BY GROUP BY
...@@ -2704,7 +2703,6 @@ ...@@ -2704,7 +2703,6 @@
FROM FROM
( (
SELECT SELECT
`ou`.`code` AS `code`,
ifnull( `rp`.`min_water_level`, 0 ) AS `minLevel`, ifnull( `rp`.`min_water_level`, 0 ) AS `minLevel`,
ifnull( `rp`.`max_water_level`, 0 ) AS `maxLevel`, ifnull( `rp`.`max_water_level`, 0 ) AS `maxLevel`,
ifnull( ifnull(
...@@ -2718,16 +2716,14 @@ ...@@ -2718,16 +2716,14 @@
ifnull( `rp`.`min_water_level`, 0 )) AS `nowLevel` ifnull( `rp`.`min_water_level`, 0 )) AS `nowLevel`
FROM FROM
`cb_water_resource` `r` `cb_water_resource` `r`
LEFT JOIN `cb_org_usr` `ou` ON `ou`.`biz_org_code` = `r`.`biz_org_code`
LEFT JOIN `cb_water_resource_pool` `rp` ON `rp`.`resource_id` = `r`.`sequence_nbr` LEFT JOIN `cb_water_resource_pool` `rp` ON `rp`.`resource_id` = `r`.`sequence_nbr`
LEFT JOIN `wl_equipment_specific` `es` ON `es`.`id` = `rp`.`level_device_id` LEFT JOIN `wl_equipment_specific` `es` ON `es`.`id` = `rp`.`level_device_id`
LEFT JOIN `wl_equipment_detail` `ed` ON `ed`.`id` = `es`.`equipment_detail_id` LEFT JOIN `wl_equipment_detail` `ed` ON `ed`.`id` = `es`.`equipment_detail_id`
LEFT JOIN `wl_equipment_index` `ei` ON `ei`.`equipment_id` = `ed`.`equipment_id` LEFT JOIN `wl_equipment_index` `ei` ON `ei`.`equipment_id` = `ed`.`equipment_id`
WHERE WHERE
`r`.`is_delete` = 1 `r`.`is_delete` = 1
AND `ou`.`code` IS NOT NULL <if test="bizOrgCode != null and bizOrgCode != ''">
<if test="companyCode != null and companyCode != ''"> AND r.`biz_org_code` like concat(#{bizOrgCode}, '%')
AND ou.`code` = #{companyCode}
</if> </if>
AND `r`.`resource_type` = #{poolType} AND `r`.`resource_type` = #{poolType}
GROUP BY GROUP BY
...@@ -2815,10 +2811,9 @@ ...@@ -2815,10 +2811,9 @@
FROM FROM
`wl_car` `wc` `wl_car` `wc`
LEFT JOIN `wl_car_property` `wcp` ON `wcp`.`car_id` = `wc`.`id` LEFT JOIN `wl_car_property` `wcp` ON `wcp`.`car_id` = `wc`.`id`
LEFT JOIN cb_org_usr ou ON ou.amos_org_code = wc.org_code
<where> <where>
<if test="companyCode!=null and companyCode!=''"> <if test="bizOrgCode!=null and bizOrgCode!=''">
ou.`code` = #{companyCode} wc.`biz_org_code` like concat(#{bizOrgCode}, '%')
</if> </if>
</where> </where>
GROUP BY GROUP BY
...@@ -2849,11 +2844,10 @@ ...@@ -2849,11 +2844,10 @@
wl_equipment_specific es wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
LEFT JOIN wl_equipment e ON e.id = ed.equipment_id LEFT JOIN wl_equipment e ON e.id = ed.equipment_id
LEFT JOIN cb_org_usr ou ON ou.biz_org_code = es.biz_org_code
WHERE WHERE
e.is_iot = 1 e.is_iot = 1
<if test="companyCode != null and companyCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
and ou.`code` = #{companyCode} and es.`biz_org_code` like concat(#{bizOrgCode}, '%')
</if> </if>
) AS total, ) AS total,
( (
...@@ -2868,8 +2862,8 @@ ...@@ -2868,8 +2862,8 @@
<if test="alarmType != null and alarmType != ''"> <if test="alarmType != null and alarmType != ''">
AND esa.type = #{alarmType} AND esa.type = #{alarmType}
</if> </if>
<if test="companyCode != null and companyCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
and ou.`code` = #{companyCode} and ou.`biz_org_code` like concat(#{bizOrgCode}, '%')
</if> </if>
) AS alarmEquipTotalNum, ) AS alarmEquipTotalNum,
( (
...@@ -2885,8 +2879,8 @@ ...@@ -2885,8 +2879,8 @@
<if test="alarmType != null and alarmType != ''"> <if test="alarmType != null and alarmType != ''">
AND esa.type = #{alarmType} AND esa.type = #{alarmType}
</if> </if>
<if test="companyCode != null and companyCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
and ou.`code` = #{companyCode} and ou.`biz_org_code` like concat(#{bizOrgCode}, '%')
</if> </if>
) AS notReturned ) AS notReturned
) temp ) temp
...@@ -3500,4 +3494,13 @@ ...@@ -3500,4 +3494,13 @@
</where> </where>
</select> </select>
<select id="queryByCompanyCode" resultType="java.lang.String">
SELECT biz_org_code
FROM cb_org_usr
WHERE is_delete = 0
<if test="companyCode != null and companyCode != ''">
AND code = #{companyCode}
</if>
</select>
</mapper> </mapper>
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