| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <?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.ydtech.modules.admin.dao.SysUserLinkSysMapper">
- <resultMap id="BaseResultMap" type="com.ydtech.modules.admin.model.po.SysUserLinkSys">
- <id property="id" column="id" jdbcType="BIGINT"/>
- <result property="sysId" column="sys_id" jdbcType="BIGINT"/>
- <result property="userId" column="user_id" jdbcType="VARCHAR"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
- <result property="createUser" column="create_user" jdbcType="VARCHAR"/>
- <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
- <result property="updateUser" column="update_user" jdbcType="VARCHAR"/>
- </resultMap>
- <sql id="Base_Column_List">
- id,sys_id,user_id,
- create_time,create_user,update_time,
- update_user
- </sql>
- <select id="queryPage" resultType="com.ydtech.modules.admin.model.po.SysUserLinkSys">
- select
- link.id as id,
- link.sys_id as sysId,
- link.user_id as userId,
- link.create_time as createTime,
- s.system_name as systemName,
- s.system_code as systemCode,
- s.system_status as systemStatus,
- su.name as userName,
- su.id as userId
- from sys_user_link_sys link
- left join sys_sys s on s.id=link.sys_id
- left join sys_user su on su.id =link.user_id
- <where>
- 1=1
- <if test="vo.systemName != null and vo.systemName != ''">
- AND s.system_name like CONCAT('%', #{vo.systemName}, '%')
- </if>
- <if test="vo.systemCode != null and vo.systemCode != ''">
- AND s.system_code = #{vo.systemCode}
- </if>
- <if test="vo.userName != null and vo.userName != ''">
- AND su.name like CONCAT('%', #{vo.userName}, '%')
- </if>
- <if test="vo.userId != null and vo.userId != ''">
- AND su.id = #{vo.userId}
- </if>
- </where>
- </select>
- <select id="queryUserPage" resultType="com.ydtech.modules.admin.model.SysUser">
- select *
- from sys_user su
- <where>
- su.status=1 and su.id !='admin'
- <if test="vo.deptId != null and vo.deptId != ''">
- AND su.dept_id like CONCAT('', #{vo.deptId}, '%')
- </if>
- <if test="vo.name != null and vo.name != ''">
- AND su.name like CONCAT('%', #{vo.name}, '%')
- </if>
- <if test="vo.userId != null and vo.userId != ''">
- AND su.id = #{vo.userId}
- </if>
- </where>
- </select>
- <select id="checkSys" resultType="com.ydtech.modules.admin.model.po.SysUserLinkSys">
- select
- link.id as id,
- link.sys_id as sysId,
- link.user_id as userId,
- s.system_name as systemName,
- su.name as userName
- from sys_user_link_sys link
- left join sys_sys s on s.id=link.sys_id
- left join sys_user su on su.id =link.user_id
- <where>
- s.system_status = '1'
- <if test="userId != null and userId != ''">
- AND link.id = #{userId}
- </if>
- <if test="sysId != null and sysId != ''">
- AND link.sys_id = #{sysId}
- </if>
- </where>
- </select>
- <select id="setByUserIds" resultType="java.lang.String">
- SELECT
- a.user_id
- FROM
- sys_user_link_sys a
- LEFT JOIN sys_sys s ON s.id = a.sys_id
- <where>
- s.system_status ='1'
- <if test="userIds != null and userIds != '' and userIds.size() > 0">
- and a.user_id in
- <foreach collection="userIds" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <if test="sysId != null and sysId !=''">
- and a.sys_id =#{sysId}
- </if>
- </where>
- </select>
- </mapper>
|