|
@@ -98,24 +98,25 @@
|
|
<select id="listByAdminName" resultType="com.xy.dto.DeviceInfoDto$ListByAdminName">
|
|
<select id="listByAdminName" resultType="com.xy.dto.DeviceInfoDto$ListByAdminName">
|
|
SELECT d.device_id, d.device_name, p.admin_name, d.device_type
|
|
SELECT d.device_id, d.device_name, p.admin_name, d.device_type
|
|
FROM device_info d
|
|
FROM device_info d
|
|
- left join merc_place p on p.id = d.place_id
|
|
|
|
- <where>
|
|
|
|
- and d.merc_id = #{dto.mercId}
|
|
|
|
- and d.active_state = 1
|
|
|
|
- <if test="dto.deviceIdList != null and dto.deviceIdList.size > 0">
|
|
|
|
- and device_id in
|
|
|
|
- <foreach collection="dto.deviceIdList" index="index" item="item" open="(" separator="," close=")">
|
|
|
|
- #{item}
|
|
|
|
- </foreach>
|
|
|
|
- </if>
|
|
|
|
- <if test="dto.searchKey != null and dto.searchKey != ''">
|
|
|
|
- and CONCAT(IFNULL(d.device_name, ''), IFNULL(p.admin_name, '')) like CONCAT('%', #{dto.searchKey}, '%')
|
|
|
|
- </if>
|
|
|
|
- </where>
|
|
|
|
|
|
+ left join merc_place p on p.id = d.place_id
|
|
|
|
+ <where>
|
|
|
|
+ and d.merc_id = #{dto.mercId}
|
|
|
|
+ and d.active_state = 1
|
|
|
|
+ <if test="dto.deviceIdList != null and dto.deviceIdList.size > 0">
|
|
|
|
+ and device_id in
|
|
|
|
+ <foreach collection="dto.deviceIdList" index="index" item="item" open="(" separator="," close=")">
|
|
|
|
+ #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dto.searchKey != null and dto.searchKey != ''">
|
|
|
|
+ and CONCAT(IFNULL(d.device_name, ''), IFNULL(p.admin_name, '')) like CONCAT('%', #{dto.searchKey}, '%')
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="pageByAdminName" resultType="com.xy.dto.DeviceInfoDto$ListByAdminName">
|
|
<select id="pageByAdminName" resultType="com.xy.dto.DeviceInfoDto$ListByAdminName">
|
|
- SELECT d.device_id, d.device_name, p.admin_name, d.device_type,p.region_name,p.place_name,m.name as merc_name,m.merc_code as merc_code
|
|
|
|
|
|
+ SELECT d.device_id, d.device_name, p.admin_name,p.admin_id, d.device_type,p.region_name,p.place_name,m.name as
|
|
|
|
+ merc_name,m.merc_code as merc_code
|
|
FROM device_info d
|
|
FROM device_info d
|
|
left join merc_place p on p.id = d.place_id
|
|
left join merc_place p on p.id = d.place_id
|
|
left join merc m on m.id = d.merc_id
|
|
left join merc m on m.id = d.merc_id
|
|
@@ -261,7 +262,8 @@
|
|
</choose>
|
|
</choose>
|
|
</if>
|
|
</if>
|
|
<if test="queryPage.keyword != null and queryPage.keyword != ''">
|
|
<if test="queryPage.keyword != null and queryPage.keyword != ''">
|
|
- and CONCAT(IFNULL(info.device_name, ''), IFNULL(info.device_id, '')) LIKE CONCAT('%',#{queryPage.keyword},'%')
|
|
|
|
|
|
+ and CONCAT(IFNULL(info.device_name, ''), IFNULL(info.device_id, '')) LIKE
|
|
|
|
+ CONCAT('%',#{queryPage.keyword},'%')
|
|
</if>
|
|
</if>
|
|
<if test="queryPage.showStatus != null">
|
|
<if test="queryPage.showStatus != null">
|
|
and info.show_status = #{queryPage.showStatus}
|
|
and info.show_status = #{queryPage.showStatus}
|