123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- <?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.gree.mall.manager.commonmapper.AdminMapper">
- <select id="mchList" resultType="com.gree.mall.manager.plus.entity.AdminUser">
- select a.* from admin_user a
- join admin_user_company_rela b on a.admin_user_id = b.admin_user_id
- join admin_company_wechat c on c.company_wechat_id = b.company_wechat_id
- <where>
- <if test="userName != null and userName !=''">
- a.user_name like concat('%',#{userName},'%')
- </if>
- <if test="nickName != null and nickName !=''">
- a.nick_name like concat('%',#{nickName},'%')
- </if>
- <if test="linkPhone != null and linkPhone !=''">
- a.link_phone like concat('%',#{linkPhone},'%')
- </if>
- <if test="email != null and email !=''">
- a.email like concat('%',#{email},'%')
- </if>
- <if test="status != null">
- a.status = #{status}
- </if>
- </where>
- order by a.create_time desc
- </select>
- <select id="queryAdminCompanyWechat" resultType="com.gree.mall.manager.plus.entity.AdminCompanyWechat">
- select b.* from admin_user_company_rela a join admin_company_wechat b on a.company_wechat_id = b.company_wechat_id
- where b.del=0
- <if test="adminUserId != null and adminUserId !=''">
- and a.admin_user_id = #{adminUserId}
- </if>
- </select>
- <select id="getAdminUser" resultType="com.gree.mall.manager.plus.entity.AdminUser">
- SELECT u.*
- from admin_user_company_rela aucr
- join admin_user u on aucr.admin_user_id=u.admin_user_id
- <where>
- <if test="roleId != null and roleId != ''">
- and u.role_id = #{roleId}
- </if>
- <if test="status != null and status != ''">
- and u.status = #{status}
- </if>
- <if test="userName != null and userName != ''">
- and u.user_name like concat('%',#{userName},'%')
- </if>
- <if test="companyWechatIds != null and companyWechatIds.size > 0">
- and aucr.company_wechat_id in
- <foreach item="item" index="index" collection="companyWechatIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </where>
- </select>
- <sql id="adminUserAllCol">
- b.admin_user_id, b.nick_name,b.status,b.role_id,b.role_name,b.last_login_time,b.user_name,
- b.password,b.link_name,b.link_phone,b.email,b.address,b.never_exprise,b.del as del2,b.create_time as create_time2,
- b.type,b.company_wechat_id as company_wechat_id2,b.company_name as company_name2
- </sql>
- <select id="pageCompanyWechat" resultMap="pageCompanyWechatResultMap">
- select * from(
- SELECT DISTINCT
- a.*,
- <include refid="adminUserAllCol"/>,
- a.del as del1,
- a.company_wechat_id as company_wechat_id1,
- a.company_name as company_name1,
- a.create_time as create_time1
- FROM admin_user_company_rela aucr
- RIGHT JOIN admin_company_wechat a on a.company_wechat_id=aucr.company_wechat_id
- LEFT JOIN admin_user b on b.admin_user_id = aucr.admin_user_id
- <where>
- <if test="userName != null and userName !=''">b.user_name like concat('%',#{userName},'%')
- </if>
- <if test="nickName != null and nickName !=''">
- b.nick_name like concat('%',#{nickName},'%')
- </if>
- <if test="linkPhone != null and linkPhone !=''">
- b.link_phone like concat('%',#{linkPhone},'%')
- </if>
- <if test="email != null and email !=''">
- b.email like concat('%',#{email},'%')
- </if>
- <if test="status != null">
- b.status = #{status}
- </if>
- </where>
- ORDER BY b.create_time
- )a
- GROUP BY a.company_wechat_id
- </select>
- <select id="list" resultType="com.gree.mall.manager.bean.admin.AdminDeptWebsitVO">
- SELECT
- ${ex.selected}
- FROM admin_dept_websit a
- ${ex.query}
- <if test="ex.orderBy == null or ex.orderBy ==''">
- ORDER BY a.create_time DESC
- </if>
- ${ex.orderBy}
- </select>
- <select id="sysDictCompanyList" resultType="com.gree.mall.manager.bean.common.SysDictCompanyVO">
- select
- a.*,
- b.remark as 'dictTypeName'
- from sys_dict_company a
- left join sys_dict_type_company b on a.dict_type=b.dict_type
- ${ex.query}
- and a.del=0
- <if test="companyWechatIds != null and companyWechatIds.size > 0">
- AND a.company_wechat_id IN
- <foreach item="item" index="index" collection="companyWechatIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="ex.orderBy == null or ex.orderBy ==''">
- order by a.sort_num,a.create_time desc
- </if>
- ${ex.orderBy}
- </select>
- <resultMap id="pageCompanyWechatResultMap" autoMapping="true" type="com.gree.mall.manager.bean.admin.respDto.AdminCompanyWechatRespPageBean">
- <id column="company_wechat_id1" property="companyWechatId"/>
- <result column="del1" property="del"/>
- <result column="company_name1" property="companyName"/>
- <result column="create_time1" property="createTime"/>
- <association property="adminUser" autoMapping="true" javaType="com.gree.mall.manager.plus.entity.AdminUser">
- <result column="del2" property="del"/>
- <result column="company_wechat_id2" property="companyWechatId"/>
- <result column="company_name2" property="companyName"/>
- <result column="create_time2" property="createTime"/>
- </association>
- </resultMap>
- </mapper>
|