<?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.SysUserDao"><select id="queryObject" resultType="com.cf.entity.SysUserEntity">select * from sys_user where user_id = #{value}</select><select id="queryList" resultType="com.cf.entity.SysUserEntity">select * from sys_user<where><if test="createUserId != null">and `create_user_id` = #{createUserId}</if><if test="username != null and username.trim() != ''">and `username` like concat('%',#{username},'%')</if></where><choose><when test="sidx != null and sidx.trim() != ''">order by ${sidx} ${order}</when><otherwise>order by user_id desc</otherwise></choose><if test="offset != null and limit != null">limit #{offset}, #{limit}</if></select><select id="queryTotal" resultType="int">select count(*) from sys_user<where><if test="createUserId != null">and `create_user_id` = #{createUserId}</if><if test="username != null and username.trim() != ''">and `username` like concat('%',#{username},'%')</if></where></select><!-- 查询用户的所有权限 --><select id="queryAllPerms" resultType="string">select m.perms from sys_user_role urLEFT JOIN sys_role_menu rm on ur.role_id = rm.role_idLEFT JOIN sys_menu m on rm.menu_id = m.menu_idwhere ur.user_id = #{userId}</select><!-- 查询用户的所有菜单ID --><select id="queryAllMenuId" resultType="long">select distinct rm.menu_id from sys_user_role urLEFT JOIN sys_role_menu rm on ur.role_id = rm.role_idwhere ur.user_id = #{userId}</select><select id="queryByUserName" resultType="com.cf.entity.SysUserEntity">select * from sys_user where username = #{username}</select><insert id="save" parameterType="com.cf.entity.SysUserEntity" useGeneratedKeys="true" keyProperty="userId">insert into sys_user(`user_id`,`username`,`password`,`email`,`mobile`,`status`,`create_user_id`,`create_time`)values(#{userId},#{username},#{password},#{email},#{mobile},#{status},#{createUserId},#{createTime})</insert><update id="update" parameterType="com.cf.entity.SysUserEntity">update sys_user<set><if test="username != null">`username` = #{username}, </if><if test="password != null">`password` = #{password}, </if><if test="email != null">`email` = #{email}, </if><if test="mobile != null">`mobile` = #{mobile}, </if><if test="status != null">`status` = #{status}, </if></set>where user_id = #{userId}<if test="createUserId != null">and `create_user_id` = #{createUserId}</if></update><update id="updatePassword" parameterType="map">update sys_user set `password` = #{newPassword}where user_id = #{userId} and password = #{password}</update><delete id="deleteBatch">delete from sys_user where user_id in<foreach item="userId" collection="array" open="(" separator="," close=")">#{userId}</foreach>;delete from sys_user_role where user_id in<foreach item="userId" collection="array" open="(" separator="," close=")">#{userId}</foreach></delete></mapper>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型