Commit 6c49815c authored by 李秀明's avatar 李秀明

fix: BUG#23962 站端设备平台v5>消防自动化>消防资源>消防设施>消防装备,左下角装备定义的数量的查询接口查询出的数据,和设备卡片的数据不一致

parent 121d2911
...@@ -537,10 +537,10 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -537,10 +537,10 @@ public class FireFightingSystemController extends AbstractBaseController {
} }
} }
if (flag == 0) { if (flag == 0) {
String classificationCode = equipTypeAmountPage.getEquipmentClassificationCode().replaceAll("0+$", ""); String classificationCode = equipTypeAmountPage.getEquipmentClassificationCode().replaceAll("0+$", "").trim();
return fireFightingSystemService.getColaCategoryAmountEquList(inhierarchy, classificationCode, equipTypeAmountPage); return fireFightingSystemService.getColaCategoryAmountEquList(inhierarchy, classificationCode, equipTypeAmountPage);
} else { } else {
String classificationCode = equipTypeAmountPage.getEquipmentClassificationCode().replaceAll("0+$", ""); String classificationCode = equipTypeAmountPage.getEquipmentClassificationCode().replaceAll("0+$", "").trim();
return fireFightingSystemService.getColaCategoryAmountEquList(inhierarchy, classificationCode.length() % 2 == 0 ? classificationCode : classificationCode + "0", equipTypeAmountPage); return fireFightingSystemService.getColaCategoryAmountEquList(inhierarchy, classificationCode.length() % 2 == 0 ? classificationCode : classificationCode + "0", equipTypeAmountPage);
} }
// return fireFightingSystemService.getColaCategoryAmountEquList(inhierarchy, equipTypeAmountPage.getEquipmentClassificationCode(), equipTypeAmountPage); // return fireFightingSystemService.getColaCategoryAmountEquList(inhierarchy, equipTypeAmountPage.getEquipmentClassificationCode(), equipTypeAmountPage);
......
...@@ -12,7 +12,7 @@ public interface ISourceStatistics { ...@@ -12,7 +12,7 @@ public interface ISourceStatistics {
* @param categoryCode 资源分类code * @param categoryCode 资源分类code
* @return int 数量 * @return int 数量
*/ */
int equipCategoryStatistics(String bizOrgCode, SourceTypeEnum sourceType, String categoryCode); int equipCategoryStatistics(String bizOrgCode, SourceTypeEnum sourceType, String categoryCode, boolean isRoot);
/** /**
* 初始化所有有分类数据(装备、车辆),bizOrgCode + "_" + sourceType.getCode() + "_" + categoryCode * 初始化所有有分类数据(装备、车辆),bizOrgCode + "_" + sourceType.getCode() + "_" + categoryCode
......
...@@ -1350,7 +1350,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1350,7 +1350,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
List<EquipmentCategory> list = new ArrayList<>(); List<EquipmentCategory> list = new ArrayList<>();
Map<String, List<EquipmentCategory>> tmpMap = new HashMap<String, List<EquipmentCategory>>(); Map<String, List<EquipmentCategory>> tmpMap = new HashMap<String, List<EquipmentCategory>>();
equipmentCategorys.forEach(action -> { equipmentCategorys.forEach(action -> {
int num = sourceStatistics.equipCategoryStatistics(bizOrgCode, sourceTypeEnum, action.getCode()); int num = sourceStatistics.equipCategoryStatistics(bizOrgCode, sourceTypeEnum, action.getCode(), Objects.isNull(action.getParentId()));
action.setCount(Double.parseDouble(num + "")); action.setCount(Double.parseDouble(num + ""));
if (action.getParentId() == null) { if (action.getParentId() == null) {
list.add(action); list.add(action);
......
...@@ -23,12 +23,14 @@ public class SourcesStatisticsImpl implements ISourceStatistics { ...@@ -23,12 +23,14 @@ public class SourcesStatisticsImpl implements ISourceStatistics {
@Override @Override
public int equipCategoryStatistics(String bizOrgCode, SourceTypeEnum sourceType, String categoryCode) { public int equipCategoryStatistics(String bizOrgCode, SourceTypeEnum sourceType, String categoryCode, boolean isRoot) {
// 计算处通用code,用来上下级匹配如12001010000->1200101 // 计算处通用code,用来上下级匹配如12001010000->1200101
String treeCode = subStringZero(categoryCode); String treeCode = subStringZero(categoryCode);
treeCode = treeCode.length() % 2 == 0 ? treeCode : treeCode + "0"; if (!isRoot && treeCode.length() % 2 != 0) {
treeCode = treeCode + "0";
}
Set<String> keys = redisUtil.getKeys(buildPattenKey(bizOrgCode, sourceType.getCode(), treeCode)); Set<String> keys = redisUtil.getKeys(buildPattenKey(bizOrgCode, sourceType.getCode(), treeCode));
if (keys.size() > 0) { if (!keys.isEmpty()) {
//求和 //求和
return this.sumNumber(keys); return this.sumNumber(keys);
} else { } else {
......
...@@ -222,7 +222,7 @@ ...@@ -222,7 +222,7 @@
where id =#{id} where id =#{id}
</update> </update>
<!-- 全部建筑下不应该存在装备--> <!-- 全部建筑下不应该存在装备-->
<select id="getPointDataNum" resultType="com.yeejoin.equipmanage.common.entity.vo.PointTreeVo"> <select id="getPointDataNum" resultType="com.yeejoin.equipmanage.common.entity.vo.PointTreeVo">
SELECT b.* from ( SELECT b.* from (
select select
...@@ -274,7 +274,7 @@ ...@@ -274,7 +274,7 @@
'equipment' as `key`, 'equipment' as `key`,
equ.img as imgPath, equ.img as imgPath,
spe.qr_code as equipCode, spe.qr_code as equipCode,
-- spe.code as equipCode, -- spe.code as equipCode,
spe.code AS code, spe.code AS code,
stru.source_id as parentId, stru.source_id as parentId,
cat.id as equipId, cat.id as equipId,
...@@ -848,7 +848,7 @@ ...@@ -848,7 +848,7 @@
LEFT JOIN wl_manufacturer_info wlai on wled.manufacturer_id=wlai.id LEFT JOIN wl_manufacturer_info wlai on wled.manufacturer_id=wlai.id
LEFT JOIN wl_equipment_category wec ON wle.category_id = wec.id LEFT JOIN wl_equipment_category wec ON wle.category_id = wec.id
WHERE 1=1 WHERE 1=1
<if test="codeHead!=null and codeHead!='' and codeHead!=' '"> <if test="codeHead!=null and codeHead!=''">
and LEFT (wle.CODE, #{hierarchy}) = #{codeHead} and LEFT (wle.CODE, #{hierarchy}) = #{codeHead}
</if> </if>
...@@ -952,7 +952,7 @@ ...@@ -952,7 +952,7 @@
LEFT JOIN wl_manufacturer_info wlai ON wlc.manufacturer_id = wlai.id LEFT JOIN wl_manufacturer_info wlai ON wlc.manufacturer_id = wlai.id
LEFT JOIN wl_equipment_category wec ON wle.category_id = wec.id LEFT JOIN wl_equipment_category wec ON wle.category_id = wec.id
WHERE 1=1 WHERE 1=1
<if test="codeHead!=null and codeHead!='' and codeHead!=' '"> <if test="codeHead!=null and codeHead!=''">
and LEFT (wec.CODE, #{hierarchy}) = #{codeHead} and LEFT (wec.CODE, #{hierarchy}) = #{codeHead}
</if> </if>
<if test="equipTypeAmountPage.industryCode!=null"> <if test="equipTypeAmountPage.industryCode!=null">
...@@ -1905,7 +1905,7 @@ ...@@ -1905,7 +1905,7 @@
LEFT JOIN wl_manufacturer_info wlai ON wlc.manufacturer_id = wlai.id LEFT JOIN wl_manufacturer_info wlai ON wlc.manufacturer_id = wlai.id
LEFT JOIN wl_equipment_category wec ON wle.category_id = wec.id LEFT JOIN wl_equipment_category wec ON wle.category_id = wec.id
WHERE 1=1 WHERE 1=1
<if test="codeHead!=null and codeHead!='' and codeHead!=' '"> <if test="codeHead!=null and codeHead!=''">
and LEFT (wec.CODE, #{hierarchy}) = #{codeHead} and LEFT (wec.CODE, #{hierarchy}) = #{codeHead}
</if> </if>
<if test="equipTypeAmountPage.industryCode!=null"> <if test="equipTypeAmountPage.industryCode!=null">
...@@ -1996,7 +1996,7 @@ ...@@ -1996,7 +1996,7 @@
LEFT JOIN wl_manufacturer_info wlai on wled.manufacturer_id=wlai.id LEFT JOIN wl_manufacturer_info wlai on wled.manufacturer_id=wlai.id
LEFT JOIN wl_equipment_category wec ON wle.category_id = wec.id LEFT JOIN wl_equipment_category wec ON wle.category_id = wec.id
WHERE 1=1 WHERE 1=1
<if test="codeHead!=null and codeHead!='' and codeHead!=' '"> <if test="codeHead!=null and codeHead!=''">
and LEFT (wle.CODE, #{hierarchy}) = #{codeHead} and LEFT (wle.CODE, #{hierarchy}) = #{codeHead}
<!-- and wec.`code` like concat(#{codeHead}, '%')--> <!-- and wec.`code` like concat(#{codeHead}, '%')-->
</if> </if>
...@@ -2114,7 +2114,7 @@ ...@@ -2114,7 +2114,7 @@
LEFT JOIN wl_manufacturer_info wlai on wled.manufacturer_id=wlai.id LEFT JOIN wl_manufacturer_info wlai on wled.manufacturer_id=wlai.id
LEFT JOIN wl_equipment_category wec ON wle.category_id = wec.id LEFT JOIN wl_equipment_category wec ON wle.category_id = wec.id
WHERE 1=1 WHERE 1=1
<if test="codeHead!=null and codeHead!='' and codeHead!=' '"> <if test="codeHead!=null and codeHead!=''">
and LEFT (wle.CODE, #{hierarchy}) = #{codeHead} and LEFT (wle.CODE, #{hierarchy}) = #{codeHead}
</if> </if>
...@@ -2689,50 +2689,50 @@ ...@@ -2689,50 +2689,50 @@
<select id="equipAlarmTOP" resultType="java.util.Map"> <select id="equipAlarmTOP" resultType="java.util.Map">
<!-- SELECT--> <!-- SELECT-->
<!-- ifnull( `a`.`fightSysName`, NULL ) AS `fightSysName`,--> <!-- ifnull( `a`.`fightSysName`, NULL ) AS `fightSysName`,-->
<!-- ifnull( `a`.`fightSysCode`, NULL ) AS `fightSysCode`,--> <!-- ifnull( `a`.`fightSysCode`, NULL ) AS `fightSysCode`,-->
<!-- ifnull( `a`.`fightSysId`, NULL ) AS `fightSysId`,--> <!-- ifnull( `a`.`fightSysId`, NULL ) AS `fightSysId`,-->
<!-- ifnull( `a`.`report_date`, NULL ) AS `reportDate`,--> <!-- ifnull( `a`.`report_date`, NULL ) AS `reportDate`,-->
<!-- `a`.`equipName` AS `equipName`,--> <!-- `a`.`equipName` AS `equipName`,-->
<!-- sum( `a`.`total` ) AS `total`--> <!-- sum( `a`.`total` ) AS `total`-->
<!-- FROM--> <!-- FROM-->
<!-- (--> <!-- (-->
<!-- SELECT--> <!-- SELECT-->
<!-- `rd`.`index_type` AS `indxKey`,--> <!-- `rd`.`index_type` AS `indxKey`,-->
<!-- `rd`.`index_name` AS `index_name`,--> <!-- `rd`.`index_name` AS `index_name`,-->
<!-- `rd`.`equipment_specific_name` AS `equipName`,--> <!-- `rd`.`equipment_specific_name` AS `equipName`,-->
<!-- count( DISTINCT `rd`.`equipment_specific_id` ) AS `total`,--> <!-- count( DISTINCT `rd`.`equipment_specific_id` ) AS `total`,-->
<!-- `rd`.`report_date` AS `report_date`,--> <!-- `rd`.`report_date` AS `report_date`,-->
<!-- `fs`.`name` AS `fightSysName`,--> <!-- `fs`.`name` AS `fightSysName`,-->
<!-- `fs`.`code` AS `fightSysCode`,--> <!-- `fs`.`code` AS `fightSysCode`,-->
<!-- `fs`.`id` AS `fightSysId`,--> <!-- `fs`.`id` AS `fightSysId`,-->
<!-- `rd`.`equipment_specific_id` AS `equipId`--> <!-- `rd`.`equipment_specific_id` AS `equipId`-->
<!-- FROM--> <!-- FROM-->
<!-- (--> <!-- (-->
<!-- `wl_equipment_alarm_report_day` `rd`--> <!-- `wl_equipment_alarm_report_day` `rd`-->
<!-- LEFT JOIN `f_fire_fighting_system` `fs` ON ((--> <!-- LEFT JOIN `f_fire_fighting_system` `fs` ON ((-->
<!-- 0 != find_in_set( `fs`.`id`, `rd`.`system_ids` ))))--> <!-- 0 != find_in_set( `fs`.`id`, `rd`.`system_ids` ))))-->
<!-- WHERE--> <!-- WHERE-->
<!-- (((--> <!-- (((-->
<!-- curdate() - INTERVAL 30 DAY--> <!-- curdate() - INTERVAL 30 DAY-->
<!-- ) &lt;= cast( `rd`.`report_date` AS date ))--> <!-- ) &lt;= cast( `rd`.`report_date` AS date ))-->
<!-- AND ( `fs`.`code` = #{systemCode} )--> <!-- AND ( `fs`.`code` = #{systemCode} )-->
<!-- AND ( `fs`.`biz_org_code` like concat(#{bizOrgCode}, '%') )--> <!-- AND ( `fs`.`biz_org_code` like concat(#{bizOrgCode}, '%') )-->
<!-- AND ((--> <!-- AND ((-->
<!-- `rd`.`index_type` LIKE '%Fault'--> <!-- `rd`.`index_type` LIKE '%Fault'-->
<!-- )--> <!-- )-->
<!-- OR ( `rd`.`index_type` LIKE '%FireAlarm' )--> <!-- OR ( `rd`.`index_type` LIKE '%FireAlarm' )-->
<!-- OR ( `rd`.`index_type` LIKE '%Shield' ))--> <!-- OR ( `rd`.`index_type` LIKE '%Shield' ))-->
<!-- AND ( `rd`.`value` = 'true' ))--> <!-- AND ( `rd`.`value` = 'true' ))-->
<!-- GROUP BY--> <!-- GROUP BY-->
<!-- `rd`.`equipment_specific_id`,--> <!-- `rd`.`equipment_specific_id`,-->
<!-- `rd`.`report_date`--> <!-- `rd`.`report_date`-->
<!-- ) `a`--> <!-- ) `a`-->
<!-- GROUP BY--> <!-- GROUP BY-->
<!-- `a`.`equipId`--> <!-- `a`.`equipId`-->
<!-- ORDER BY--> <!-- ORDER BY-->
<!-- `total` DESC--> <!-- `total` DESC-->
<!-- LIMIT 5--> <!-- LIMIT 5-->
SELECT SELECT
d.* d.*
...@@ -2787,37 +2787,37 @@ ...@@ -2787,37 +2787,37 @@
</select> </select>
<select id="equipmentState" resultType="java.util.Map"> <select id="equipmentState" resultType="java.util.Map">
<!-- SELECT--> <!-- SELECT-->
<!-- b.equipName,--> <!-- b.equipName,-->
<!-- (CASE WHEN--> <!-- (CASE WHEN-->
<!-- b.totalNum > 0 THEN--> <!-- b.totalNum > 0 THEN-->
<!-- '异常' ELSE '正常' END) `status`,--> <!-- '异常' ELSE '正常' END) `status`,-->
<!-- b.totalNum AS totalNum,--> <!-- b.totalNum AS totalNum,-->
<!-- b.`code` AS equipDetailCode--> <!-- b.`code` AS equipDetailCode-->
<!-- FROM--> <!-- FROM-->
<!-- (--> <!-- (-->
<!-- SELECT--> <!-- SELECT-->
<!-- a.equipName,--> <!-- a.equipName,-->
<!-- count( wesl.id ) AS totalNum,--> <!-- count( wesl.id ) AS totalNum,-->
<!-- a.`code`--> <!-- a.`code`-->
<!-- FROM--> <!-- FROM-->
<!-- (--> <!-- (-->
<!-- SELECT--> <!-- SELECT-->
<!-- wes.`name` AS equipName,--> <!-- wes.`name` AS equipName,-->
<!-- wed.equipment_id AS equipmentId,--> <!-- wed.equipment_id AS equipmentId,-->
<!-- wed.`code` AS code--> <!-- wed.`code` AS code-->
<!-- FROM--> <!-- FROM-->
<!-- wl_equipment_specific wes--> <!-- wl_equipment_specific wes-->
<!-- LEFT JOIN wl_equipment_detail wed ON wed.id = wes.equipment_detail_id--> <!-- LEFT JOIN wl_equipment_detail wed ON wed.id = wes.equipment_detail_id-->
<!-- WHERE--> <!-- WHERE-->
<!-- FIND_IN_SET( #{id}, wes.system_id ) > 0--> <!-- FIND_IN_SET( #{id}, wes.system_id ) > 0-->
<!-- GROUP BY--> <!-- GROUP BY-->
<!-- wed.equipment_id--> <!-- wed.equipment_id-->
<!-- ) a--> <!-- ) a-->
<!-- LEFT JOIN wl_equipment_specific_alarm_log wesl ON wesl.equipment_id = a.equipmentId--> <!-- LEFT JOIN wl_equipment_specific_alarm_log wesl ON wesl.equipment_id = a.equipmentId-->
<!-- GROUP BY--> <!-- GROUP BY-->
<!-- a.equipmentId--> <!-- a.equipmentId-->
<!-- ) b--> <!-- ) b-->
SELECT SELECT
b.equipName, b.equipName,
...@@ -3157,52 +3157,52 @@ ...@@ -3157,52 +3157,52 @@
</select> </select>
<!-- <select id="getWaterPoolVolumeInfo" resultType="java.util.Map">--> <!-- <select id="getWaterPoolVolumeInfo" resultType="java.util.Map">-->
<!-- SELECT--> <!-- SELECT-->
<!-- IFNULL( sum( a.margin ), 0 ) AS margin,--> <!-- IFNULL( sum( a.margin ), 0 ) AS margin,-->
<!-- IFNULL( sum( volume ), 0 ) AS volume--> <!-- IFNULL( sum( volume ), 0 ) AS volume-->
<!-- FROM--> <!-- FROM-->
<!-- (--> <!-- (-->
<!-- SELECT--> <!-- SELECT-->
<!-- `ou`.`code` AS `code`,--> <!-- `ou`.`code` AS `code`,-->
<!-- ifnull((--> <!-- ifnull((-->
<!-- abs((--> <!-- abs((-->
<!-- ifnull(--> <!-- ifnull(-->
<!-- max((--> <!-- max((-->
<!-- CASE--> <!-- CASE-->
<!-- WHEN ( `ei`.`name_key` = 'FHS_WirelessliquidDetector_WaterLevel' ) THEN--> <!-- WHEN ( `ei`.`name_key` = 'FHS_WirelessliquidDetector_WaterLevel' ) THEN-->
<!-- `ei`.`perf_value`--> <!-- `ei`.`perf_value`-->
<!-- END--> <!-- END-->
<!-- )),--> <!-- )),-->
<!-- ifnull( `rp`.`min_water_level`, 0 )) /--> <!-- ifnull( `rp`.`min_water_level`, 0 )) /-->
<!-- IF--> <!-- IF-->
<!-- ((--> <!-- ((-->
<!-- ifnull( `rp`.`max_water_level`, 0 ) = 0--> <!-- ifnull( `rp`.`max_water_level`, 0 ) = 0-->
<!-- ),--> <!-- ),-->
<!-- 1,--> <!-- 1,-->
<!-- ifnull( `rp`.`max_water_level`, 0 )))) * ifnull( `rp`.`volume`, 0 )),--> <!-- ifnull( `rp`.`max_water_level`, 0 )))) * ifnull( `rp`.`volume`, 0 )),-->
<!-- 0--> <!-- 0-->
<!-- ) AS `margin`,--> <!-- ) AS `margin`,-->
<!-- ifnull( `rp`.`volume`, 0 ) AS `volume`--> <!-- ifnull( `rp`.`volume`, 0 ) AS `volume`-->
<!-- 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_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`.`resource_type` IN ( 'pool', 'industryPool' )--> <!-- `r`.`resource_type` IN ( 'pool', 'industryPool' )-->
<!-- AND `r`.`is_delete` = 1--> <!-- AND `r`.`is_delete` = 1-->
<!-- AND `ou`.`code` IS NOT NULL--> <!-- AND `ou`.`code` IS NOT NULL-->
<!-- <if test="companyCode != null and companyCode != ''">--> <!-- <if test="companyCode != null and companyCode != ''">-->
<!-- AND ou.`code` = #{companyCode}--> <!-- AND ou.`code` = #{companyCode}-->
<!-- </if>--> <!-- </if>-->
<!-- GROUP BY--> <!-- GROUP BY-->
<!-- `r`.`sequence_nbr`--> <!-- `r`.`sequence_nbr`-->
<!-- ) a--> <!-- ) a-->
<!-- </select>--> <!-- </select>-->
<select id="getCarNum" resultType="java.lang.Integer"> <select id="getCarNum" resultType="java.lang.Integer">
SELECT SELECT
...@@ -4790,7 +4790,7 @@ ...@@ -4790,7 +4790,7 @@
r.`name`, r.`name`,
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(max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ),'--') AS nowLevel, -- IFNULL(max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ),'--') AS nowLevel,
IFNULL((select IFNULL((select
avg(IFNULL(ei.`value`, 0)) avg(IFNULL(ei.`value`, 0))
from from
...@@ -5018,7 +5018,7 @@ ...@@ -5018,7 +5018,7 @@
LEFT JOIN wl_form_instance_equip fi ON fi.instance_id = es.id LEFT JOIN wl_form_instance_equip fi ON fi.instance_id = es.id
WHERE WHERE
ed.`code` LIKE '92011000%' ed.`code` LIKE '92011000%'
<!-- AND es.iot_code IS NOT NULL--> <!-- AND es.iot_code IS NOT NULL-->
<if test="bizOrgCode!=null and bizOrgCode!=''"> <if test="bizOrgCode!=null and bizOrgCode!=''">
AND es.biz_org_code like concat(#{bizOrgCode}, '%') AND es.biz_org_code like concat(#{bizOrgCode}, '%')
</if> </if>
...@@ -5228,7 +5228,7 @@ ...@@ -5228,7 +5228,7 @@
AND ( (sd.`status` != 7) or (sd.`status` is null) or (sd.`status` = '')) AND ( (sd.`status` != 7) or (sd.`status` is null) or (sd.`status` = ''))
AND e.expiry_date IS NOT NULL AND e.expiry_date IS NOT NULL
AND es.biz_org_code like concat(#{bizOrgCode}, '%') AND es.biz_org_code like concat(#{bizOrgCode}, '%')
<!-- AND DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) > 0--> <!-- AND DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) > 0-->
AND #{expiryDayNum} >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) AND #{expiryDayNum} >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE )
) a ) a
GROUP BY GROUP BY
...@@ -5257,7 +5257,7 @@ ...@@ -5257,7 +5257,7 @@
AND ( (sd.`status` != 7) or (sd.`status` is null) or (sd.`status` = '')) AND ( (sd.`status` != 7) or (sd.`status` is null) or (sd.`status` = ''))
AND e.expiry_date IS NOT NULL AND e.expiry_date IS NOT NULL
AND es.biz_org_code like concat(#{bizOrgCode}, '%') AND es.biz_org_code like concat(#{bizOrgCode}, '%')
<!-- AND DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) > 0--> <!-- AND DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) > 0-->
AND #{expiryDayNum} >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) AND #{expiryDayNum} >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE )
ORDER BY DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) ASC ORDER BY DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) ASC
</select> </select>
...@@ -5324,7 +5324,7 @@ ...@@ -5324,7 +5324,7 @@
AND ( (sd.`status` != 7) or (sd.`status` is null) or (sd.`status` = '')) AND ( (sd.`status` != 7) or (sd.`status` is null) or (sd.`status` = ''))
AND e.expiry_date IS NOT NULL AND e.expiry_date IS NOT NULL
AND es.biz_org_code LIKE concat(#{bizOrgCode}, '%') AND es.biz_org_code LIKE concat(#{bizOrgCode}, '%')
<!-- AND DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) > 0--> <!-- AND DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) > 0-->
AND 60 >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) AND 60 >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE )
) AS countNum ) AS countNum
</select> </select>
......
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