|
@@ -43,30 +43,31 @@ rt.type_desc, rt.tenant_id, rt.alarm_status </sql>
|
|
|
<select id="selectList" resultType="com.zcxk.rmcp.api.dto.alarm.AlarmTypeDto">
|
|
|
select
|
|
|
<include refid="Base_Column_List"/>,ifnull(rule.numberOfWaterMeters,0)numberOfWaterMeters
|
|
|
- ,b.product_name,c.name categoryName
|
|
|
+ ,CONCAT_ws("/",e.name,b.product_model,b.product_name) product_name,c.name categoryName
|
|
|
from rmcp_alarm_type rt left join (select count(*) numberOfWaterMeters,alarm_type_id
|
|
|
from rmcp_device_alarm_rule group by alarm_type_id ) rule on rt.id=rule.alarm_type_id
|
|
|
join rmcp_product b on rt.device_type_id=b.id
|
|
|
join rmcp_product_category c on rt.product_categroy_id=c.id
|
|
|
+ join rmcp_manufacturer e on b.manufacturer_id=e.id
|
|
|
<where>
|
|
|
rt.status=1
|
|
|
|
|
|
|
|
|
<if test="deviceTypeId != null">
|
|
|
- and device_type_id = #{deviceTypeId}
|
|
|
+ and rt.device_type_id = #{deviceTypeId}
|
|
|
</if>
|
|
|
<if test="productCategroyId != null">
|
|
|
- and product_category_id = #{productCategroyId}
|
|
|
+ and rt.product_category_id = #{productCategroyId}
|
|
|
</if>
|
|
|
<if test="name != null and name != ''">
|
|
|
- and name like concat('%',#{name} ,'%')
|
|
|
+ and rt.name like concat('%',#{name} ,'%')
|
|
|
</if>
|
|
|
|
|
|
<if test="typeDesc != null and typeDesc != ''">
|
|
|
- and type_desc = like concat('%',#{typeDesc} ,'%')
|
|
|
+ and rt.type_desc like concat('%',#{typeDesc} ,'%')
|
|
|
</if>
|
|
|
<if test="tenantId != null and tenantId != ''">
|
|
|
- and tenant_id = #{tenantId}
|
|
|
+ and rt.tenant_id = #{tenantId}
|
|
|
</if>
|
|
|
|
|
|
</where>
|