select ifnull(sum(r.filling_quantity),0) from tz_cylinder_filling_record r where date_format(r.filling_endTime,'%Y-%m-%d') = date_format(#{time},'%Y-%m-%d') and app_id in (
select u.app_id from tz_cylinder_unit u where u.region_code like CONCAT('%',#{regionCode},'%')
select ifnull(sum(r.filling_quantity),0) from tz_cylinder_filling_record r where date_format(r.filling_endTime,'%Y-%m') = date_format(#{time},'%Y-%m') and app_id = #{appId}
select ifnull(sum(r.filling_quantity),0) from tz_cylinder_filling_record r where date_format(r.filling_endTime,'%Y-%m-%d') = date_format(#{time},'%Y-%m-%d') and app_id = #{appId}
select IFNULL(count(sequence_nbr), 0) from tz_cylinder_unit where date_format(sync_date ,'yyyy-mm') LIKE date_format ( NOW( ) - INTERVAL '1 month', 'yyyy-mm' ) AND region_code like CONCAT('%',#{regionCode},'%')
select IFNULL(count(sequence_nbr), 0) from tz_cylinder_unit where date_format(sync_date ,'yyyy-mm') LIKE date_format ( NOW( ) - INTERVAL '2 month', 'yyyy-mm' ) AND region_code like CONCAT('%',#{regionCode},'%')
select count(sequence_nbr) from tz_cylinder_unit where date_format(sync_date ,'yyyy-mm') LIKE date_format ( NOW( ) ,'yyyy-mm') and region_code like CONCAT('%',#{regionCode},'%')
CONCAT(a.province,a.city,a.district) AS productArea,
CONCAT(a.stree,a.community,a.address) AS address,
a.plan_product_date AS planProductDate,
a.product_inform_date AS productInformDate,
a.accept_unit AS acceptUnit,
CASE
a.inform_status
WHEN 0 THEN
'暂存'
WHEN 1 THEN
'未接收'
WHEN 2 THEN
'已接收'
WHEN 9 THEN
'已驳回'
ELSE
''
END AS informStatus,
IFNULL(t.equipmentNum, 0) as equipmentNum,
a.process_id AS processId
FROM
tz_equipment_inform a
LEFT JOIN (select count(e.sequence_nbr) as equipmentNum, e.inform_id from tcb_inform_equipment e GROUP BY e.inform_id ) t on t.inform_id = a.sequence_nbr
WHERE a.is_delete = 0
AND a.product_unit_id = #{companyId}
<iftest="productCode != null and productCode != ''">
AND a.product_code like CONCAT('%',#{productCode},'%')
</if>
<iftest="productUnitId != null ">
AND a.product_unit_id = #{productUnitId}
</if>
<iftest="regionCode != null and regionCode != ''">
AND a.region_code like CONCAT('%',#{regionCode},'%')
</if>
<iftest="address != null and address != ''">
AND ( a.stree like CONCAT('%',#{address},'%')
or a.community like CONCAT('%',#{address},'%')
or a.address like CONCAT('%',#{address},'%') )
</if>
<iftest="productInformDateStart != null and productInformDateStart != ''">
and #{productInformDateStart} <![CDATA[ <= ]]> a.product_inform_date
</if>
<iftest="productInformDateEnd != null and productInformDateEnd != ''">
and a.product_inform_date <![CDATA[ <= ]]> #{productInformDateEnd}
</if>
<iftest="planProductDateStart != null and planProductDateStart != ''">
and #{planProductDateStart} <![CDATA[ <= ]]> a.plan_product_date
</if>
<iftest="planProductDateEnd != null and planProductDateEnd != ''">
and a.plan_product_date <![CDATA[ <= ]]> #{planProductDateEnd}
</if>
<iftest="acceptUnitId != null ">
AND a.accept_unit_id = #{acceptUnitId}
</if>
<iftest="informStatus != null and informStatus != ''">
AND a.inform_status = #{informStatus}
</if>
<iftest="sortParam != null and sortParam != '' and sortRule != null and sortRule != '' ">
CONCAT(a.province,a.city,a.district) AS productArea,
CONCAT(a.stree,a.community,a.address) AS address,
a.plan_product_date AS planProductDate,
a.product_inform_date AS productInformDate,
a.accept_unit AS acceptUnit,
CASE
a.inform_status
WHEN 0 THEN
'暂存'
WHEN 1 THEN
'未接收'
WHEN 2 THEN
'已接收'
WHEN 9 THEN
'已驳回'
ELSE
''
END AS informStatus,
IFNULL(t.equipmentNum, 0) as equipmentNum,
a.process_id AS processId
FROM
tz_equipment_inform a
LEFT JOIN (select count(e.sequence_nbr) as equipmentNum, e.inform_id from tcb_inform_equipment e GROUP BY e.inform_id ) t on t.inform_id = a.sequence_nbr
WHERE a.is_delete = 0
AND a.accept_unit_id = #{companyId}
AND a.inform_status != 0
<iftest="productCode != null and productCode != ''">
AND a.product_code like CONCAT('%',#{productCode},'%')
</if>
<iftest="productUnitId != null ">
AND a.product_unit_id = #{productUnitId}
</if>
<iftest="regionCode != null and regionCode != ''">
AND a.region_code like CONCAT('%',#{regionCode},'%')
</if>
<iftest="address != null and address != ''">
AND ( a.stree like CONCAT('%',#{address},'%')
or a.community like CONCAT('%',#{address},'%')
or a.address like CONCAT('%',#{address},'%') )
</if>
<iftest="productInformDateStart != null and productInformDateStart != ''">
and #{productInformDateStart} <![CDATA[ <= ]]> a.product_inform_date
</if>
<iftest="productInformDateEnd != null and productInformDateEnd != ''">
and a.product_inform_date <![CDATA[ <= ]]> #{productInformDateEnd}
</if>
<iftest="planProductDateStart != null and planProductDateStart != ''">
and #{planProductDateStart} <![CDATA[ <= ]]> a.plan_product_date
</if>
<iftest="planProductDateEnd != null and planProductDateEnd != ''">
and a.plan_product_date <![CDATA[ <= ]]> #{planProductDateEnd}
</if>
<iftest="acceptUnitId != null ">
AND a.accept_unit_id = #{acceptUnitId}
</if>
<iftest="informStatus != null and informStatus != ''">
AND a.inform_status = #{informStatus}
</if>
<iftest="sortParam != null and sortParam != '' and sortRule != null and sortRule != '' ">