mapper.AdminRoleAuthorityMapperPlus.xml Maven / Gradle / Ivy
<?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="cn.ipokerface.admin.mapper.AdminRoleAuthorityMapper"> <delete id="deleteByRoleIds" parameterType="list"> DELETE FROM ADMIN_ROLE_AUTHORITY where ROLE_ID IN <foreach collection="list" item="item" open="(" close=")" separator=","> #{item} </foreach> </delete> <insert id="insertBatch" parameterType="list"> insert into ADMIN_ROLE_AUTHORITY (ID, ROLE_ID, AUTHORITY_ID, VERSION, REMARK, STATE, CREATED_ID, CREATED_TIME, UPDATED_ID, UPDATED_TIME) values <foreach collection="list" item="item" separator=","> (#{item.id,jdbcType=BIGINT}, #{item.roleId,jdbcType=BIGINT}, #{item.authorityId,jdbcType=BIGINT}, #{item.version,jdbcType=INTEGER}, #{item.remark,jdbcType=VARCHAR}, #{item.state,jdbcType=VARCHAR}, #{item.createdId,jdbcType=BIGINT}, #{item.createdTime,jdbcType=TIMESTAMP}, #{item.updatedId,jdbcType=BIGINT}, #{item.updatedTime,jdbcType=TIMESTAMP}) </foreach> </insert> <select id="selectByRoleId" resultType="cn.ipokerface.admin.model.AuthorityModel"> SELECT T_AA.ID AS id, T_AA.NAME AS name, T_AA.DESCRIPTION AS description, T_AA.CATEGORY AS category, T_AA.CODE AS code, T_AA.ROUTE AS CODE, T_AA.LINK AS LINK, T_AA.PARENT AS parent, T_AA.SORT AS sort, T_AA.ICON AS icon, T_AA.VERSION AS version, T_AA.REMARK AS remark, T_AA.STATE AS state, T_AA.CREATED_ID AS createdId, T_AA.CREATED_TIME AS createdTime, T_AA.UPDATED_ID AS updatedId, T_AA.UPDATED_TIME AS updatedTime FROM ADMIN_AUTHORITY T_AA WHERE T_AA.ID IN ( SELECT T_RA.AUTHORITY_ID FROM ADMIN_ROLE_AUTHORITY T_RA WHERE T_RA.ROLE_ID = #{roleId} ) ORDER BY T_AA.ID ASC </select> </mapper>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy