|
@@ -49,6 +49,7 @@
|
|
|
inner join site as s
|
|
|
on us.site_id = s.id
|
|
|
<where>
|
|
|
+ s.enable=1
|
|
|
<if test="userId != null and userId != 0">
|
|
|
and us.user_id = #{userId}
|
|
|
</if>
|
|
@@ -58,6 +59,48 @@
|
|
|
|
|
|
</where>
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="list2" resultType="com.bizmatics.model.Site">
|
|
|
+ SELECT
|
|
|
+ a.*, b.device_status
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ s.id,
|
|
|
+ s.site_name,
|
|
|
+ s.site_address,
|
|
|
+ s.company_code,
|
|
|
+ s.user_name,
|
|
|
+ s.phone,
|
|
|
+ s.station_area_id,
|
|
|
+ s.route_id,
|
|
|
+ s.installed_capacity,
|
|
|
+ s.rheological_change,
|
|
|
+ s.longitude,
|
|
|
+ s.latitude,
|
|
|
+ s.region,
|
|
|
+ s.create_time,
|
|
|
+ s.creator,
|
|
|
+ s. ENABLE
|
|
|
+ FROM
|
|
|
+ user_site AS us
|
|
|
+ INNER JOIN site AS s ON us.site_id = s.id
|
|
|
+ <where>
|
|
|
+ s.enable=1
|
|
|
+ <if test="userId != null and userId != 0">
|
|
|
+ and us.user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ and s.site_name LIKE CONCAT(CONCAT('%', #{name}), '%')
|
|
|
+ </if>
|
|
|
+ </where>) AS a
|
|
|
+ LEFT JOIN device_status AS b ON a.id = b.site_id
|
|
|
+ GROUP BY
|
|
|
+ a.id
|
|
|
+ ORDER BY
|
|
|
+ a.id
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="Sitelist" resultType="com.bizmatics.model.SiteList">
|
|
|
select
|
|
|
a.user_id,
|