|
|
|
<?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.epmet.dao.UserRoleDao">
|
|
|
|
|
|
|
|
<resultMap type="com.epmet.entity.UserRoleEntity" id="userRoleMap">
|
|
|
|
<result property="id" column="ID"/>
|
|
|
|
<result property="customerId" column="CUSTOMER_ID"/>
|
|
|
|
<result property="userId" column="USER_ID"/>
|
|
|
|
<result property="roleId" column="ROLE_ID"/>
|
|
|
|
<result property="delFlag" column="DEL_FLAG"/>
|
|
|
|
<result property="revision" column="REVISION"/>
|
|
|
|
<result property="createdBy" column="CREATED_BY"/>
|
|
|
|
<result property="createdTime" column="CREATED_TIME"/>
|
|
|
|
<result property="updatedBy" column="UPDATED_BY"/>
|
|
|
|
<result property="updatedTime" column="UPDATED_TIME"/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<insert id="saveResiRole" parameterType="com.epmet.dto.UserRoleDTO">
|
|
|
|
INSERT INTO user_role (
|
|
|
|
id,
|
|
|
|
customer_id,
|
|
|
|
user_id,
|
|
|
|
role_id,
|
|
|
|
del_flag,
|
|
|
|
revision,
|
|
|
|
created_by,
|
|
|
|
created_time,
|
|
|
|
updated_by,
|
|
|
|
updated_time
|
|
|
|
)VALUES(
|
|
|
|
#{id},
|
|
|
|
#{customerId},
|
|
|
|
#{userId},
|
|
|
|
#{roleId},
|
|
|
|
#{delFlag},
|
|
|
|
#{revision},
|
|
|
|
#{createdBy},
|
|
|
|
#{createdTime},
|
|
|
|
#{updatedBy},
|
|
|
|
#{updatedTime}
|
|
|
|
)
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getUserRoleInfo" parameterType="com.epmet.dto.form.UserRoleFormDTO"
|
|
|
|
resultType="com.epmet.dto.result.UserRoleResultDTO">
|
|
|
|
|
|
|
|
SELECT
|
|
|
|
DISTINCT
|
|
|
|
er.ROLE_NAME,
|
|
|
|
er.ROLE_KEY
|
|
|
|
FROM
|
|
|
|
USER_ROLE ur
|
|
|
|
JOIN EPMET_ROLE er ON ur.ROLE_ID = er.ID
|
|
|
|
<where>
|
|
|
|
er.DEL_FLAG = 0
|
|
|
|
AND
|
|
|
|
ur.DEL_FLAG = 0
|
|
|
|
AND
|
|
|
|
ur.USER_ID = #{userId}
|
|
|
|
<if test='null != app and "" != app'>
|
|
|
|
AND
|
|
|
|
er.APP = #{app}
|
|
|
|
</if>
|
|
|
|
<if test='null != customerId and "" != customerId'>
|
|
|
|
AND
|
|
|
|
ur.CUSTOMER_ID = #{customerId}
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
</mapper>
|