巡检计划
parent
5299c1e27d
commit
e56dc7446b
@ -0,0 +1,61 @@
|
||||
package com.op.device.mapper;
|
||||
|
||||
import com.op.system.api.domain.SysUser;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户信息Mapper接口
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-10-18
|
||||
*/
|
||||
public interface SysUserMapper {
|
||||
/**
|
||||
* 查询用户信息
|
||||
*
|
||||
* @param userId 用户信息主键
|
||||
* @return 用户信息
|
||||
*/
|
||||
public SysUser selectSysUserByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 查询用户信息列表
|
||||
*
|
||||
* @param sysUser 用户信息
|
||||
* @return 用户信息集合
|
||||
*/
|
||||
public List<SysUser> selectSysUserList(SysUser sysUser);
|
||||
|
||||
/**
|
||||
* 新增用户信息
|
||||
*
|
||||
* @param sysUser 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysUser(SysUser sysUser);
|
||||
|
||||
/**
|
||||
* 修改用户信息
|
||||
*
|
||||
* @param sysUser 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysUser(SysUser sysUser);
|
||||
|
||||
/**
|
||||
* 删除用户信息
|
||||
*
|
||||
* @param userId 用户信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysUserByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 批量删除用户信息
|
||||
*
|
||||
* @param userIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysUserByUserIds(Long[] userIds);
|
||||
}
|
@ -0,0 +1,130 @@
|
||||
<?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.op.device.mapper.SysUserMapper">
|
||||
|
||||
<resultMap type="SysUser" id="SysUserResult">
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="email" column="email" />
|
||||
<result property="phonenumber" column="phonenumber" />
|
||||
<result property="sex" column="sex" />
|
||||
<result property="avatar" column="avatar" />
|
||||
<result property="password" column="password" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="loginIp" column="login_ip" />
|
||||
<result property="loginDate" column="login_date" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysUserVo">
|
||||
select user_id, dept_id, user_name, nick_name, email, phonenumber, sex, avatar, password, status, del_flag, login_ip, login_date, create_by, create_time, update_by, update_time, remark from sys_user
|
||||
</sql>
|
||||
|
||||
<select id="selectSysUserList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
<include refid="selectSysUserVo"/>
|
||||
<where>
|
||||
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
||||
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
|
||||
<if test="email != null and email != ''"> and email = #{email}</if>
|
||||
<if test="phonenumber != null and phonenumber != ''"> and phonenumber = #{phonenumber}</if>
|
||||
<if test="sex != null and sex != ''"> and sex = #{sex}</if>
|
||||
<if test="avatar != null and avatar != ''"> and avatar = #{avatar}</if>
|
||||
<if test="password != null and password != ''"> and password = #{password}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="loginIp != null and loginIp != ''"> and login_ip = #{loginIp}</if>
|
||||
<if test="loginDate != null "> and login_date = #{loginDate}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSysUserByUserId" parameterType="Long" resultMap="SysUserResult">
|
||||
<include refid="selectSysUserVo"/>
|
||||
where user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
|
||||
insert into sys_user
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="userName != null and userName != ''">user_name,</if>
|
||||
<if test="nickName != null and nickName != ''">nick_name,</if>
|
||||
<if test="email != null">email,</if>
|
||||
<if test="phonenumber != null">phonenumber,</if>
|
||||
<if test="sex != null">sex,</if>
|
||||
<if test="avatar != null">avatar,</if>
|
||||
<if test="password != null">password,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="loginIp != null">login_ip,</if>
|
||||
<if test="loginDate != null">login_date,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="userName != null and userName != ''">#{userName},</if>
|
||||
<if test="nickName != null and nickName != ''">#{nickName},</if>
|
||||
<if test="email != null">#{email},</if>
|
||||
<if test="phonenumber != null">#{phonenumber},</if>
|
||||
<if test="sex != null">#{sex},</if>
|
||||
<if test="avatar != null">#{avatar},</if>
|
||||
<if test="password != null">#{password},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="loginIp != null">#{loginIp},</if>
|
||||
<if test="loginDate != null">#{loginDate},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysUser" parameterType="SysUser">
|
||||
update sys_user
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
||||
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
|
||||
<if test="email != null">email = #{email},</if>
|
||||
<if test="phonenumber != null">phonenumber = #{phonenumber},</if>
|
||||
<if test="sex != null">sex = #{sex},</if>
|
||||
<if test="avatar != null">avatar = #{avatar},</if>
|
||||
<if test="password != null">password = #{password},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="loginIp != null">login_ip = #{loginIp},</if>
|
||||
<if test="loginDate != null">login_date = #{loginDate},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysUserByUserId" parameterType="Long">
|
||||
delete from sys_user where user_id = #{userId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysUserByUserIds" parameterType="String">
|
||||
delete from sys_user where user_id in
|
||||
<foreach item="userId" collection="array" open="(" separator="," close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue