人员配置机构

This commit is contained in:
root
2021-06-29 16:34:02 +08:00
parent 4533960ef9
commit 39e5e4c4c5
22 changed files with 439 additions and 23 deletions
@@ -1,10 +1,36 @@
<?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.adc.da.slrs.sarPosition.dao.TsPositionDao">
<resultMap id="PositionAndRole" type="com.adc.da.slrs.sarPosition.entity.TsPosition">
<id property="id" column="id"/>
<result property="operateTime" column="operate_time"/>
<result property="operator" column="operator"/>
<result property="name" column="name"/>
<result property="createDeptId" column="create_dept_id"/>
<result property="createById" column="create_by_id"/>
<result property="type" column="type"/>
<collection property="roles" ofType="com.adc.da.slrs.sarRole.entity.TsRole">
<result property="id" column="rid"/>
<result property="name" column="r_name"/>
</collection>
</resultMap>
<select id="getRole" resultType="com.adc.da.slrs.sarRole.entity.TsRole">
select * from ts_role r
left join ts_position_role ps
on r.id=ps.role_id
where ps.position_id=#{positionId}
</select>
<select id="selectPositionAndRole" resultMap="PositionAndRole">
select p.*,r.id rid,r.name r_name from ts_position p
left join ts_position_role pr
on p.id=pr.position_id
left join ts_role r
on pr.role_id=r.id
<where>
<if test="name!=null">
p.name like concat(concat('%',#{name}),'%')
</if>
</where>
</select>
</mapper>