123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- <?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.AdminDao">
- <select id="getAdmins" resultType="com.yx.face.model.vo.AdminVO">
- SELECT
- a.id AS adminId,
- a.nickname AS name,
- a.username AS username,
- a.avatar AS avatar,
- a.phone AS phone,
- a.email AS email,
- a.gender AS gender,
- a.type AS type,
- a.create_time AS createTime,
- a.province_id as provinceId,
- a.province_name as provinceName,
- a.city_id as cityId,
- a.city_name as cityName,
- a.area_id as areaId,
- a.area_name as areaName,
- a.street_id as streetId,
- a.street_name as streetName,
- a.address as address,
- a.police_station_code as policeStationCode,
- a.police_station_name as policeStationName,
- a.tag_id as tagId,
- at.name as tagName,
- a.is_out as isOut,
- a.is_hide_important as isHideImportant,
- a.is_control_early_warning as isControlEarlyWarning
- FROM admin a left join admin_tag at on at.id = a.tag_id
- <where>
- <if test="type == 1">
- and a.type != 1
- </if>
- <if test="type == 2">
- and a.province_id = #{adminVo.provinceId}
- and a.type in (3 ,4 ,5)
- </if>
- <if test="type == 3">
- and a.province_id = #{adminVo.provinceId}
- and a.type in (4 ,5)
- and a.tag_id = #{adminVo.tagId}
- </if>
- <if test="type == 4">
- and a.city_id = #{adminVo.cityId}
- and a.type = 5
- and a.tag_id = #{adminVo.tagId}
- </if>
- <if test="type == 5">
- and a.id = #{adminVo.adminId}
- </if>
- <if test="ads.username != null and ads.username !=''">
- and a.username = #{ads.username}
- </if>
- <if test="ads.name != null and ads.name !=''">
- and a.nickname LIKE CONCAT('%',#{ads.name},'%')
- </if>
- <if test="ads.phone != null and ads.phone !=''">
- and a.phone = #{ads.phone}
- </if>
- <if test="ads.provinceId != null">
- and a.province_id =#{ads.provinceId}
- </if>
- <if test="ads.cityId != null">
- and a.city_id =#{ads.cityId}
- </if>
- <if test="ads.areaId != null">
- and a.area_id =#{ads.areaId}
- </if>
- <if test="ads.type != null">
- and a.type =#{ads.type}
- </if>
- <if test="ads.tagId != null">
- and a.tag_id =#{ads.tagId}
- </if>
- </where>
- order by a.create_time desc
- </select>
- <select id="getAuthInfo" resultType="com.yx.face.model.vo.AdminVO">
- SELECT id AS adminId,
- nickname AS name,
- type AS type,
- password AS password
- FROM admin
- WHERE id = #{id}
- </select>
- <select id="getAdminlist" resultType="com.yx.face.model.vo.AdminVO">
- select
- a.id AS adminId,
- a.username AS username
- FROM admin a
- <where>
- <if test="type == 1">
- and a.type != 1
- </if>
- <if test="type == 2">
- and a.province_id = #{provinceId}
- and a.type in (3 ,4 ,5)
- </if>
- <if test="type == 3">
- and a.province_id = #{provinceId}
- and a.type in (4 ,5)
- and a.tag_id = #{tagId}
- </if>
- <if test="type == 4">
- and a.city_id = #{cityId}
- and a.type = 5
- and a.tag_id = #{tagId}
- </if>
- <if test="type == 5">
- and a.id = #{adminId}
- </if>
- </where>
- </select>
- <select id="getAdminLsit" resultType="com.yx.face.model.vo.AdminVO">
- select
- a.id AS adminId,
- a.username AS username
- FROM admin a
- where a.type = #{type}
- </select>
- </mapper>
|