|
@@ -40,19 +40,15 @@
|
|
a.version as version,
|
|
a.version as version,
|
|
CONCAT(f.dict_label,'-',e.name,'-',d.name,'-',c.name,'-',b.name) as house
|
|
CONCAT(f.dict_label,'-',e.name,'-',d.name,'-',c.name,'-',b.name) as house
|
|
from g_order a
|
|
from g_order a
|
|
- left join g_house b on a.house_id = b.id
|
|
|
|
- left join g_unit c on b.unit_id = c.id
|
|
|
|
- left join g_building d on c.building_id = d.id
|
|
|
|
- left join g_area e on d.area_id = e.id
|
|
|
|
- left join sys_dict_data f on e.district = f.dict_value
|
|
|
|
|
|
+ left join g_house b on a.house_id = b.id and b.del_flag = '0'
|
|
|
|
+ left join g_unit c on b.unit_id = c.id and c.del_flag = '0'
|
|
|
|
+ left join g_building d on c.building_id = d.id and d.del_flag = '0'
|
|
|
|
+ left join g_area e on d.area_id = e.id and e.del_flag = '0'
|
|
|
|
+ left join sys_dict_data f on e.district = f.dict_value and f.dict_type='district'
|
|
left join g_user u on a.user_id = u.id
|
|
left join g_user u on a.user_id = u.id
|
|
where a.del_flag = '0'
|
|
where a.del_flag = '0'
|
|
- and b.del_flag = '0'
|
|
|
|
- and c.del_flag = '0'
|
|
|
|
- and d.del_flag = '0'
|
|
|
|
- and e.del_flag = '0'
|
|
|
|
and a.service_type not in ('004','005','006')
|
|
and a.service_type not in ('004','005','006')
|
|
- and f.dict_type='district'
|
|
|
|
|
|
+
|
|
<if test="p.serviceType != null and p.serviceType != ''">
|
|
<if test="p.serviceType != null and p.serviceType != ''">
|
|
and a.service_type = #{p.serviceType}
|
|
and a.service_type = #{p.serviceType}
|
|
</if>
|
|
</if>
|
|
@@ -174,19 +170,14 @@
|
|
a.version as version,
|
|
a.version as version,
|
|
CONCAT(f.dict_label,'-',e.name,'-',d.name,'-',c.name,'-',b.name) as house
|
|
CONCAT(f.dict_label,'-',e.name,'-',d.name,'-',c.name,'-',b.name) as house
|
|
from g_order a
|
|
from g_order a
|
|
- left join g_house b on a.house_id = b.id
|
|
|
|
- left join g_unit c on b.unit_id = c.id
|
|
|
|
- left join g_building d on c.building_id = d.id
|
|
|
|
- left join g_area e on d.area_id = e.id
|
|
|
|
- left join sys_dict_data f on e.district = f.dict_value
|
|
|
|
|
|
+ left join g_house b on a.house_id = b.id and b.del_flag = '0'
|
|
|
|
+ left join g_unit c on b.unit_id = c.id and c.del_flag = '0'
|
|
|
|
+ left join g_building d on c.building_id = d.id and d.del_flag = '0'
|
|
|
|
+ left join g_area e on d.area_id = e.id and e.del_flag = '0'
|
|
|
|
+ left join sys_dict_data f on e.district = f.dict_value and f.dict_type='district'
|
|
left join g_user u on a.user_id = u.id
|
|
left join g_user u on a.user_id = u.id
|
|
where a.del_flag = '0' and a.order_status = '001'
|
|
where a.del_flag = '0' and a.order_status = '001'
|
|
- and b.del_flag = '0'
|
|
|
|
- and c.del_flag = '0'
|
|
|
|
- and d.del_flag = '0'
|
|
|
|
- and e.del_flag = '0'
|
|
|
|
and a.service_type not in ('004','005','006')
|
|
and a.service_type not in ('004','005','006')
|
|
- and f.dict_type='district'
|
|
|
|
<if test="p.serviceType != null and p.serviceType != ''">
|
|
<if test="p.serviceType != null and p.serviceType != ''">
|
|
and a.service_type = #{p.serviceType}
|
|
and a.service_type = #{p.serviceType}
|
|
</if>
|
|
</if>
|
|
@@ -238,17 +229,12 @@
|
|
select count(DISTINCT o.id) as value,
|
|
select count(DISTINCT o.id) as value,
|
|
o.pipe_type as name
|
|
o.pipe_type as name
|
|
from g_order o
|
|
from g_order o
|
|
- left join g_house a on o.house_id = a.id
|
|
|
|
- left join g_unit b on a.unit_id = b.id
|
|
|
|
- left join g_building c on b.building_id = c.id
|
|
|
|
- left join g_area d on c.area_id = d.id
|
|
|
|
- where
|
|
|
|
- a.del_flag = '0'
|
|
|
|
- and o.service_type = '002'
|
|
|
|
- and b.del_flag = '0'
|
|
|
|
- and c.del_flag = '0'
|
|
|
|
- and d.del_flag = '0'
|
|
|
|
- and o.del_flag = '0'
|
|
|
|
|
|
+ left join g_house a on o.house_id = a.id and a.del_flag = '0'
|
|
|
|
+ left join g_unit b on a.unit_id = b.id and b.del_flag = '0'
|
|
|
|
+ left join g_building c on b.building_id = c.id and c.del_flag = '0'
|
|
|
|
+ left join g_area d on c.area_id = d.id and d.del_flag = '0'
|
|
|
|
+ where o.service_type = '002'
|
|
|
|
+ and o.del_flag = '0'
|
|
<if test="id != null and id != ''">
|
|
<if test="id != null and id != ''">
|
|
and d.id = #{id}
|
|
and d.id = #{id}
|
|
</if>
|
|
</if>
|
|
@@ -258,16 +244,12 @@
|
|
select count(DISTINCT o.id) as value,
|
|
select count(DISTINCT o.id) as value,
|
|
o.pipe_length as name
|
|
o.pipe_length as name
|
|
from g_order o
|
|
from g_order o
|
|
- left join g_house a on o.house_id = a.id
|
|
|
|
- left join g_unit b on a.unit_id = b.id
|
|
|
|
- left join g_building c on b.building_id = c.id
|
|
|
|
- left join g_area d on c.area_id = d.id
|
|
|
|
|
|
+ left join g_house a on o.house_id = a.id and a.del_flag = '0'
|
|
|
|
+ left join g_unit b on a.unit_id = b.id and b.del_flag = '0'
|
|
|
|
+ left join g_building c on b.building_id = c.id and c.del_flag = '0'
|
|
|
|
+ left join g_area d on c.area_id = d.id and d.del_flag = '0'
|
|
where
|
|
where
|
|
- a.del_flag = '0'
|
|
|
|
- and o.service_type = '002'
|
|
|
|
- and b.del_flag = '0'
|
|
|
|
- and c.del_flag = '0'
|
|
|
|
- and d.del_flag = '0'
|
|
|
|
|
|
+ o.service_type = '002'
|
|
and o.del_flag = '0'
|
|
and o.del_flag = '0'
|
|
<if test="id != null and id != ''">
|
|
<if test="id != null and id != ''">
|
|
and d.id = #{id}
|
|
and d.id = #{id}
|
|
@@ -278,16 +260,11 @@
|
|
select count(DISTINCT o.id) as value,
|
|
select count(DISTINCT o.id) as value,
|
|
o.valve_type as name
|
|
o.valve_type as name
|
|
from g_order o
|
|
from g_order o
|
|
- left join g_house a on o.house_id = a.id
|
|
|
|
- left join g_unit b on a.unit_id = b.id
|
|
|
|
- left join g_building c on b.building_id = c.id
|
|
|
|
- left join g_area d on c.area_id = d.id
|
|
|
|
- where
|
|
|
|
- a.del_flag = '0'
|
|
|
|
- and o.service_type = '002'
|
|
|
|
- and b.del_flag = '0'
|
|
|
|
- and c.del_flag = '0'
|
|
|
|
- and d.del_flag = '0'
|
|
|
|
|
|
+ left join g_house a on o.house_id = a.id and a.del_flag = '0'
|
|
|
|
+ left join g_unit b on a.unit_id = b.id and b.del_flag = '0'
|
|
|
|
+ left join g_building c on b.building_id = c.id and c.del_flag = '0'
|
|
|
|
+ left join g_area d on c.area_id = d.id and d.del_flag = '0'
|
|
|
|
+ where o.service_type = '002'
|
|
and o.del_flag = '0'
|
|
and o.del_flag = '0'
|
|
<if test="id != null and id != ''">
|
|
<if test="id != null and id != ''">
|
|
and d.id = #{id}
|
|
and d.id = #{id}
|