<?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.cf.dao.SysRoleDao"><select id="queryObject" resultType="com.cf.entity.SysRoleEntity">select * from sys_role where role_id = #{value}</select><select id="queryList" resultType="com.cf.entity.SysRoleEntity">select * from sys_role<where><if test="roleName != null and roleName.trim() != ''">and `role_name` like concat('%',#{roleName},'%')</if><if test="createUserId != null">and create_user_id = #{createUserId}</if></where><choose><when test="sidx != null and sidx.trim() != ''">order by ${sidx} ${order}</when><otherwise>order by role_id asc</otherwise></choose><if test="offset != null and limit != null">limit #{offset}, #{limit}</if></select><select id="queryTotal" resultType="int">select count(*) from sys_role<where><if test="roleName != null and roleName.trim() != ''">and `role_name` like concat('%',#{roleName},'%')</if><if test="createUserId != null">and create_user_id = #{createUserId}</if></where></select><insert id="save" parameterType="com.cf.entity.SysRoleEntity" useGeneratedKeys="true" keyProperty="roleId">insert into sys_role(`role_id`,`role_name`,`remark`,`create_user_id`,`create_time`)values(#{roleId},#{roleName},#{remark},#{createUserId},#{createTime})</insert><update id="update" parameterType="com.cf.entity.SysRoleEntity">update sys_role<set><if test="roleName != null">`role_name` = #{roleName}, </if><if test="remark != null">`remark` = #{remark}</if></set>where role_id = #{roleId}</update><delete id="deleteBatch">delete from sys_role where role_id in<foreach item="roleId" collection="array" open="(" separator="," close=")">#{roleId}</foreach>;delete from sys_role_menu where role_id in<foreach item="roleId" collection="array" open="(" separator="," close=")">#{roleId}</foreach>;delete from sys_user_role where role_id in<foreach item="roleId" collection="array" open="(" separator="," close=")">#{roleId}</foreach></delete><!-- 查询用户创建的角色ID列表 --><select id="queryRoleIdList" resultType="long">select role_id from sys_role where create_user_id = #{createUserId}</select></mapper>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型