UserControlEarlyWarningListDao.xml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.yx.face.dao.UserControlEarlyWarningListDao">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.yx.face.model.entity.UserControlEarlyWarningList">
  6. <id column="id" property="id" />
  7. <result column="early_warning_name" property="earlyWarningName" />
  8. <result column="update_time" property="updateTime" />
  9. <result column="create_time" property="createTime" />
  10. <result column="admin_id" property="adminId" />
  11. <result column="early_warning_id_number" property="earlyWarningIdNumber" />
  12. <result column="control_name" property="controlName" />
  13. <result column="control_phone" property="controlPhone" />
  14. <result column="control_unit" property="controlUnit" />
  15. </resultMap>
  16. <!-- 通用查询结果列 -->
  17. <sql id="Base_Column_List">
  18. id, early_warning_name, update_time, create_time, admin_id, early_warning_id_number, control_name, control_phone, control_unit
  19. </sql>
  20. <select id="getPageList" resultType="com.yx.face.model.vo.UserControlEarlyWarningVO">
  21. select
  22. u.id,
  23. u.early_warning_name,
  24. u.early_warning_id_number,
  25. u.control_name,
  26. u.control_phone,
  27. u.control_unit,
  28. u.create_time,
  29. a.username,
  30. a.id as adminId
  31. from user_control_early_warning_list u
  32. Left join admin a on a.id = u.admin_id
  33. <where>
  34. <if test="adminVO.type == 2">
  35. and a.province_id = #{adminVo.provinceId}
  36. and a.type in (3 ,4 ,5)
  37. </if>
  38. <if test="adminVO.type == 3">
  39. and a.province_id = #{adminVo.provinceId}
  40. and a.type in (4 , 5)
  41. and a.tag_id = #{adminVo.tagId}
  42. </if>
  43. <if test="adminVO.type == 4">
  44. and a.city_id = #{adminVo.cityId}
  45. and a.type = 5
  46. and a.tag_id = #{adminVo.tagId}
  47. </if>
  48. <if test="adminVO.type == 5">
  49. and a.id =#{adminVo.adminId}
  50. </if>
  51. <if test="query.earlyWarningName != null and query.earlyWarningName !=''">
  52. AND u.early_warning_name LIKE CONCAT('%',#{query.earlyWarningName},'%')
  53. </if>
  54. <if test="query.earlyWarningIdNumber != null and query.earlyWarningIdNumber !=''">
  55. AND u.early_warning_id_number = #{query.earlyWarningIdNumber}
  56. </if>
  57. <if test="query.controlName != null and query.controlName !=''">
  58. AND u.control_name LIKE CONCAT('%',#{query.controlName},'%')
  59. </if>
  60. <if test="query.controlPhone != null and query.controlPhone !=''">
  61. AND u.control_phone = #{query.controlPhone}
  62. </if>
  63. <if test="query.controlUnit != null and query.controlUnit !=''">
  64. AND u.control_unit LIKE CONCAT('%',#{query.controlUnit},'%')
  65. </if>
  66. <if test="query.username != null and query.username !=''">
  67. AND a.username = #{query.username}
  68. </if>
  69. </where>
  70. </select>
  71. </mapper>