mapper.MkSecUserRoleMapper.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="com.github.xujiaji.mk.security.mapper.MkSecUserRoleMapper"> <insert id="addSecUserRole"> INSERT INTO mk_sec_user_role(sec_user_id, role_id, create_time) VALUES (${secUserId}, ${roleId}, NOW()) </insert> <delete id="deleteBySecUserId"> DELETE FROM mk_sec_user_role WHERE sec_user_id = ${secUserId} </delete> <select id="selectSecRoleBySecUserId" resultType="com.github.xujiaji.mk.security.entity.MkSecRole"> SELECT sr.* FROM mk_sec_user_role sur LEFT JOIN mk_sec_role sr ON sr.id = sur.role_id WHERE sur.sec_user_id = #{secUserId} </select> </mapper>