123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.yx.face.dao.UserControlEarlyWarningListDao">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.yx.face.model.entity.UserControlEarlyWarningList">
- <id column="id" property="id" />
- <result column="early_warning_name" property="earlyWarningName" />
- <result column="update_time" property="updateTime" />
- <result column="create_time" property="createTime" />
- <result column="admin_id" property="adminId" />
- <result column="early_warning_id_number" property="earlyWarningIdNumber" />
- <result column="control_name" property="controlName" />
- <result column="control_phone" property="controlPhone" />
- <result column="control_unit" property="controlUnit" />
- </resultMap>
- <!-- 通用查询结果列 -->
- <sql id="Base_Column_List">
- id, early_warning_name, update_time, create_time, admin_id, early_warning_id_number, control_name, control_phone, control_unit
- </sql>
- <select id="getPageList" resultType="com.yx.face.model.vo.UserControlEarlyWarningVO">
- select
- u.id,
- u.early_warning_name,
- u.early_warning_id_number,
- u.control_name,
- u.control_phone,
- u.control_unit,
- u.create_time,
- a.username,
- a.id as adminId
- from user_control_early_warning_list u
- Left join admin a on a.id = u.admin_id
- <where>
- <if test="adminVO.type == 2">
- and a.province_id = #{adminVo.provinceId}
- and a.type in (3 ,4 ,5)
- </if>
- <if test="adminVO.type == 3">
- and a.province_id = #{adminVo.provinceId}
- and a.type in (4 , 5)
- and a.tag_id = #{adminVo.tagId}
- </if>
- <if test="adminVO.type == 4">
- and a.city_id = #{adminVo.cityId}
- and a.type = 5
- and a.tag_id = #{adminVo.tagId}
- </if>
- <if test="adminVO.type == 5">
- and a.id =#{adminVo.adminId}
- </if>
- <if test="query.earlyWarningName != null and query.earlyWarningName !=''">
- AND u.early_warning_name LIKE CONCAT('%',#{query.earlyWarningName},'%')
- </if>
- <if test="query.earlyWarningIdNumber != null and query.earlyWarningIdNumber !=''">
- AND u.early_warning_id_number = #{query.earlyWarningIdNumber}
- </if>
- <if test="query.controlName != null and query.controlName !=''">
- AND u.control_name LIKE CONCAT('%',#{query.controlName},'%')
- </if>
- <if test="query.controlPhone != null and query.controlPhone !=''">
- AND u.control_phone = #{query.controlPhone}
- </if>
- <if test="query.controlUnit != null and query.controlUnit !=''">
- AND u.control_unit LIKE CONCAT('%',#{query.controlUnit},'%')
- </if>
- <if test="query.username != null and query.username !=''">
- AND a.username = #{query.username}
- </if>
- </where>
- </select>
- </mapper>
|