|
@@ -17,34 +17,71 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="password" column="password"/>
|
|
|
</resultMap>
|
|
|
|
|
|
- <select id="search" resultType="java.util.Map">
|
|
|
- SELECT a.id AS id,
|
|
|
- a.administrative_office AS name,
|
|
|
- "1" AS type
|
|
|
- FROM `g_regulator_box` a
|
|
|
- WHERE a.number LIKE concat('%',#{value},'%')
|
|
|
- OR a.administrative_office LIKE concat('%',#{value},'%')
|
|
|
- UNION ALL
|
|
|
- SELECT b.id AS id,
|
|
|
- b.remarks AS NAME,
|
|
|
- "2" AS type
|
|
|
- FROM `g_courtyard_network_management` b
|
|
|
- WHERE b.remarks LIKE concat('%',#{value},'%')
|
|
|
- UNION ALL
|
|
|
- SELECT c.id AS id,
|
|
|
- c.repair_content AS name,
|
|
|
- "3" AS type
|
|
|
- FROM `g_emergency_repair` c
|
|
|
- WHERE c.repair_content LIKE concat('%',#{value},'%')
|
|
|
- OR c.remarks LIKE concat('%',#{value},'%')
|
|
|
- UNION ALL
|
|
|
- SELECT d.id AS id,
|
|
|
- wp.NAME AS name,
|
|
|
- "4" AS type
|
|
|
- FROM `g_patrol_record` d
|
|
|
- left join g_warning_pile wp on d.warning_pile_id = wp.id and wp.NAME LIKE concat('%',#{value},'%')
|
|
|
- OR wp.remarks LIKE concat('%',#{value},'%')
|
|
|
- OR wp.warning_pile_info LIKE concat('%',#{value},'%')
|
|
|
+ <select id="search1" resultType="java.util.Map">
|
|
|
+ SELECT a.id AS id,
|
|
|
+ a.engin_name AS name,
|
|
|
+ a.create_time AS time
|
|
|
+ FROM
|
|
|
+ g_emergency_repair a
|
|
|
+ WHERE a.del_flag = 0
|
|
|
+ <if test="p.userId != null and p.userId != ''">
|
|
|
+ AND a.create_by = #{p.userId}
|
|
|
+ </if>
|
|
|
+ <if test="p.value != null and p.value != ''">
|
|
|
+ AND a.engin_name = #{p.value}
|
|
|
+ </if>
|
|
|
+ ORDER BY create_time DESC limit #{p.page,jdbcType=INTEGER},#{p.size,jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
+ <select id="search2" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ a.id AS id,
|
|
|
+ (SELECT name FROM g_area ar WHERE ar.id = a.area_id) AS name,
|
|
|
+ a.create_time AS time
|
|
|
+ FROM
|
|
|
+ g_regulator_box a WHERE a.del_flag =0
|
|
|
+ <if test="p.userId != null and p.userId != ''">
|
|
|
+ AND a.create_by = #{p.userId}
|
|
|
+ </if>
|
|
|
+ <if test="p.value != null and p.value != ''">
|
|
|
+ AND a.area_id in (SELECT id FROM g_area WHERE name LIKE concat('%',#{p.value},'%'))
|
|
|
+ </if>
|
|
|
+ ORDER BY create_time DESC limit #{p.page,jdbcType=INTEGER},#{p.size,jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
+ <select id="search3" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ a.id AS id,
|
|
|
+ concat(ar.name,'-',bu.name) AS name,
|
|
|
+ a.create_time AS time
|
|
|
+ FROM
|
|
|
+ g_courtyard_network_management a
|
|
|
+ LEFT JOIN g_building bu on bu.id = a.building_id
|
|
|
+ LEFT JOIN g_area ar on bu.area_id = ar.id
|
|
|
+ WHERE a.del_flag = 0
|
|
|
+ <if test="p.userId != null and p.userId != ''">
|
|
|
+ AND a.create_by = #{p.userId}
|
|
|
+ </if>
|
|
|
+ <if test="p.value != null and p.value != ''">
|
|
|
+ and ar.name LIKE concat('%',#{p.value},'%')
|
|
|
+ </if>
|
|
|
+ ORDER BY a.create_time DESC limit #{p.page,jdbcType=INTEGER},#{p.size,jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
+ <select id="search4" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ a.id AS id,
|
|
|
+ wa.name AS name,
|
|
|
+ a.create_time AS time
|
|
|
+ FROM
|
|
|
+ g_patrol_record a
|
|
|
+ LEFT JOIN g_warning_pile wa on wa.id = a.warning_pile_id
|
|
|
+ WHERE a.del_flag = 0
|
|
|
+ <if test="p.userId != null and p.userId != ''">
|
|
|
+ AND a.create_by = #{p.userId}
|
|
|
+ </if>
|
|
|
+ <if test="p.value != null and p.value != ''">
|
|
|
+ and wa.name LIKE concat('%',#{p.value},'%')
|
|
|
+ </if>
|
|
|
+ ORDER BY a.create_time DESC
|
|
|
+ limit #{p.page,jdbcType=INTEGER},#{p.size,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|