123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?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.ym.mec.biz.dal.dao.SysUserTenantDao">
- <resultMap id="BaseResultMap" type="com.ym.mec.biz.dal.entity.SysUserTenant">
- <id column="id_" jdbcType="INTEGER" property="id"/>
- <result column="user_id_" jdbcType="INTEGER" property="userId"/>
- <result column="tenant_id_" jdbcType="INTEGER" property="tenantId"/>
- <result column="created_by_" jdbcType="INTEGER" property="createdBy"/>
- <result column="created_time_" jdbcType="TIMESTAMP" property="createdTime"/>
- </resultMap>
- <sql id="Base_Column_List">
- id_
- , user_id_, tenant_id_, created_by_, created_time_
- </sql>
- <insert id="insertBatch" keyColumn="id_" keyProperty="id" useGeneratedKeys="true"
- parameterType="com.ym.mec.biz.dal.entity.SysUserTenant">
- insert into sys_user_tenant(user_id_, tenant_id_, created_by_, created_time_)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.userId}, #{entity.tenantId}, #{entity.createdBy}, #{entity.createdTime})
- </foreach>
- </insert>
- <select id="queryUserTenant" resultType="com.ym.mec.biz.dal.vo.SysUserTenantVo">
- select
- a.id_ as id,
- a.user_id_ as userId,
- b.id_ as tenantId,
- b.name_ as tenantName
- from sys_user_tenant as a
- left join tenant_info as b on a.tenant_id_ = b.id_
- where a.user_id_ = #{userId}
- </select>
- <select id="personOwnerList"
- resultType="com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetExtendWrapper$MusicSheetExtend">
- select su.id_ userId,su.real_name_ username
- ,'TEACHER' clientType,su.phone_ phone from teacher t
- left join sys_user su ON su.id_ = t.id_
- where su.user_type_ LIKE '%TEACHER%' AND su.del_flag_ = 0 AND su.lock_flag_ = 0
- <if test="param.name != null and param.name != ''">
- AND (su.phone_ LIKE CONCAT('%',#{param.name},'%') OR su.username_ LIKE CONCAT('%',#{param.name},'%'))
- </if>
- <if test="param.userIdList != null and param.userIdList.size > 0">
- AND su.id_ IN
- <foreach collection="param.userIdList" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- </select>
- <select id="orgOwnerList"
- resultType="com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetExtendWrapper$MusicSheetExtend">
- select id_ organizationRoleId,name_ organizationRole,'ORG' clientType,phone_ phone from tenant_info where state_ = 1
- <if test="param.name != null and param.name != ''">
- AND (phone_ LIKE CONCAT('%',#{param.name},'%') OR name_ LIKE CONCAT('%',#{param.name},'%'))
- </if>
- <if test="param.userIdList != null and param.userIdList.size > 0">
- AND id_ IN
- <foreach collection="param.userIdList" item="item" open="(" close=")" separator=",">
- #{item}
- </foreach>
- </if>
- </select>
- </mapper>
|