市北互联平台后端仓库
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.
 
 
 
 
 

78 lines
2.5 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.epmet.dao.GovStaffRoleTemplateDao">
<resultMap type="com.epmet.entity.GovStaffRoleTemplateEntity" id="govStaffRoleTemplateMap">
<result property="id" column="ID"/>
<result property="roleKey" column="ROLE_KEY"/>
<result property="roleName" column="ROLE_NAME"/>
<result property="orgType" column="ORG_TYPE"/>
<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>
<!--列出有效的角色字典-->
<select id="listValidateRoles" resultType="com.epmet.dto.result.GovStaffRoleTemplateDTO">
SELECT
*
FROM
gov_staff_role_template
WHERE
del_flag = '0'
ORDER BY
sort ASC
</select>
<select id="selectGovRoleList" resultType="com.epmet.dto.result.ResiGovRoleResultDTO">
SELECT
role_key AS "roleKey",
role_name AS "roleName"
FROM gov_staff_role_template
WHERE del_flag = '0'
ORDER BY full_time_only DESC
</select>
<select id="defaultRoleList" resultType="com.epmet.dto.result.GovStaffRoleResultDTO">
SELECT
role_key AS "defRoleKey",
role_name AS "defRoleName",
description AS "defDescription"
FROM
gov_staff_role_template
WHERE
del_flag = '0'
ORDER BY
sort ASC
</select>
<update id="updateSortById">
UPDATE gov_staff_role_template
SET sort = #{sort},
updated_by = #{userId},
updated_time = NOW()
WHERE
id = #{roleId}
</update>
<update id="upNameOrDescription">
UPDATE gov_staff_role_template
<set>
<if test='null != roleName'>
role_name = #{roleName},
</if>
<if test='null != description'>
description = #{description},
</if>
updated_by = #{userId},
updated_time = NOW()
</set>
WHERE
id = #{roleId}
</update>
</mapper>