You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.3 KiB

<?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.daqing.financial.hrms.dao.RoleDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="com.daqing.framework.domain.hrms.RoleEntity" id="roleMap">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="description" column="description"/>
<result property="createTime" column="create_time"/>
<result property="motifyTime" column="motify_time"/>
</resultMap>
<insert id="saveUserRole">
insert into hrms_employee_role (user_id,role_id) values (#{userId},#{roleId})
</insert>
<delete id="removeUserRole">
DELETE FROM hrms_employee_role WHERE role_id = #{roleId}
</delete>
<select id="listRoleIdAndName" resultType="com.daqing.framework.domain.hrms.ext.RoleVO">
SELECT id,name FROM hrms_role WHERE del_or_not = 0
</select>
<select id="selectEmployeesByRoleId" resultType="com.daqing.financial.hrms.entity.vo.EmployeeVO">
SELECT he.name,he.user_id
FROM
hrms_employee_role her
LEFT JOIN hrms_employee he ON her.user_id = he.user_id
WHERE
role_id = #{roleId}
</select>
</mapper>