59 lines
2.6 KiB
XML
59 lines
2.6 KiB
XML
<?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.supervision.knowsub.mapper.SystemBaseMapper">
|
|
|
|
<resultMap id="BaseResultMap" type="com.supervision.knowsub.model.SystemBase">
|
|
<id property="id" column="id" jdbcType="VARCHAR"/>
|
|
<result property="baseName" column="base_name" jdbcType="VARCHAR"/>
|
|
<result property="baseCode" column="base_code" jdbcType="VARCHAR"/>
|
|
<result property="createUserId" column="create_user_id" jdbcType="VARCHAR"/>
|
|
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
<result property="updateUserId" column="update_user_id" jdbcType="VARCHAR"/>
|
|
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
|
</resultMap>
|
|
|
|
<sql id="Base_Column_List">
|
|
id,base_name,base_code,
|
|
create_user_id,create_time,update_user_id,
|
|
update_time
|
|
</sql>
|
|
|
|
<resultMap id="listSubLibraryResultMap" type="com.supervision.knowsub.vo.sublibrary.SubLibraryResVo">
|
|
<id property="id" column="id"/>
|
|
<result property="baseName" column="baseName"/>
|
|
<result property="baseCode" column="baseCode"/>
|
|
<collection property="deptInfoList" ofType="com.supervision.knowsub.vo.sublibrary.DeptInfo">
|
|
<id property="deptId" column="deptId"/>
|
|
</collection>
|
|
</resultMap>
|
|
|
|
|
|
<select id="listSubLibrary" resultMap="listSubLibraryResultMap">
|
|
select b.id as id,
|
|
b.base_code as baseCode,
|
|
b.base_name as baseName,
|
|
dr.dept_id as deptId
|
|
from ks_system_base b
|
|
left join ks_system_base_dept_relation dr on b.id = dr.base_id
|
|
<where>
|
|
<if test="subLibrary.baseName != null and subLibrary.baseName != ''">
|
|
and b.base_name like concat('%',#{subLibrary.baseName},'%')
|
|
</if>
|
|
<if test="subLibrary.baseCode != null and subLibrary.baseCode != ''">
|
|
and b.base_code = #{subLibrary.baseCode}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="queryUserBaseOperateAuth" resultType="com.supervision.knowsub.dto.base.UserBaseOperateAuthDTO">
|
|
select distinct t1.base_id as baseId, t1.flow_type as flowType
|
|
from ks_system_flow_type_relation t1
|
|
left join (select distinct flow_id
|
|
from ks_system_flow_rule_user
|
|
where user_id = #{userId}) t2
|
|
on t1.flow_id = t2.flow_id
|
|
</select>
|
|
</mapper>
|