|
@@ -51,7 +51,9 @@
|
|
|
on us.site_id = s.id
|
|
|
<where>
|
|
|
s.enable=1
|
|
|
- and s.tenant_id=#{tenantId}
|
|
|
+ <if test="tenantId != null and tenantId != 0 and tenantId != ''">
|
|
|
+ and s.tenant_id=#{tenantId}
|
|
|
+ </if>
|
|
|
<if test="userId != null and userId != 0">
|
|
|
and us.user_id = #{userId}
|
|
|
</if>
|
|
@@ -62,6 +64,21 @@
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
+ <select id="listOne" resultType="com.bizmatics.model.Site">
|
|
|
+ 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 site as s
|
|
|
+ <where>
|
|
|
+ s.enable=1
|
|
|
+ <if test="tenantId != null and tenantId != 0 and tenantId != ''">
|
|
|
+ and s.tenant_id=#{tenantId}
|
|
|
+ </if>
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ and s.site_name LIKE CONCAT(CONCAT('%', #{name}), '%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="list2" resultType="com.bizmatics.model.SiteTwo">
|
|
|
SELECT
|
|
|
a.*, b.device_status
|