liusheng
2024-09-18 907641e56c2085aaa81f267946dc3e3e9fca73e7
ruoyi-system/src/main/resources/mapper/system/BaseUserInfoMapper.xml
@@ -1,73 +1,106 @@
<?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">
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.BaseUserInfoMapper">
    <resultMap type="BaseUserInfo" id="BaseUserInfoResult">
        <result property="userid"    column="userid"    />
        <result property="usercode"    column="usercode"    />
        <result property="account"    column="account"    />
        <result property="phone"    column="phone"    />
        <result property="password"    column="password"    />
        <result property="secret"    column="secret"    />
        <result property="realname"    column="realname"    />
        <result property="nickname"    column="nickname"    />
        <result property="roleid"    column="roleid"    />
        <result property="rolename"    column="rolename"    />
        <result property="deptid"    column="deptid"    />
        <result property="deptname"    column="deptname"    />
        <result property="wardid"    column="wardid"    />
        <result property="wardname"    column="wardname"    />
        <result property="usertype"    column="usertype"    />
        <result property="usertypename"    column="usertypename"    />
        <result property="dwpermission"    column="dwpermission"    />
        <result property="isopenlowerorg"    column="isopenlowerorg"    />
        <result property="isopenshareknow"    column="isopenshareknow"    />
        <result property="isopengeneraldata"    column="isopengeneraldata"    />
        <result property="orgid"    column="orgid"    />
        <result property="delFlag"    column="del_flag"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="isupload"    column="isupload"    />
        <result property="uploadTime"    column="upload_time"    />
        <result property="deptpermission"    column="deptpermission"    />
        <result property="wardpermission"    column="wardpermission"    />
    <resultMap type="com.ruoyi.system.domain.BaseUserInfo" id="BaseUserInfoResult">
        <result property="userid" column="userid"/>
        <result property="usercode" column="usercode"/>
        <result property="account" column="account"/>
        <result property="phone" column="phone"/>
        <result property="password" column="password"/>
        <result property="secret" column="secret"/>
        <result property="realname" column="realname"/>
        <result property="nickname" column="nickname"/>
        <result property="roleid" column="roleid"/>
        <result property="rolename" column="rolename"/>
        <result property="deptid" column="deptid"/>
        <result property="deptname" column="deptname"/>
        <result property="wardid" column="wardid"/>
        <result property="wardname" column="wardname"/>
        <result property="usertype" column="usertype"/>
        <result property="usertypename" column="usertypename"/>
        <result property="dwpermission" column="dwpermission"/>
        <result property="isopenlowerorg" column="isopenlowerorg"/>
        <result property="isopenshareknow" column="isopenshareknow"/>
        <result property="isopengeneraldata" column="isopengeneraldata"/>
        <result property="orgid" column="orgid"/>
        <result property="delFlag" column="del_flag"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="isupload" column="isupload"/>
        <result property="uploadTime" column="upload_time"/>
        <result property="deptpermission" column="deptpermission"/>
        <result property="wardpermission" column="wardpermission"/>
    </resultMap>
    <sql id="selectBaseUserInfoVo">
        select userid, usercode, account, phone, password, secret, realname, nickname, roleid, rolename, deptid, deptname, wardid, wardname, usertype, usertypename, dwpermission, isopenlowerorg, isopenshareknow, isopengeneraldata, orgid, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, deptpermission, wardpermission from base_user_info
        select userid,
               usercode,
               account,
               phone,
               password,
               secret,
               realname,
               nickname,
               roleid,
               rolename,
               deptid,
               deptname,
               wardid,
               wardname,
               usertype,
               usertypename,
               dwpermission,
               isopenlowerorg,
               isopenshareknow,
               isopengeneraldata,
               orgid,
               del_flag,
               update_by,
               update_time,
               create_by,
               create_time,
               isupload,
               upload_time,
               deptpermission,
               wardpermission
        from base_user_info
    </sql>
    <select id="selectBaseUserInfoList" parameterType="BaseUserInfo" resultMap="BaseUserInfoResult">
    <select id="selectBaseUserInfoList" parameterType="com.ruoyi.system.domain.BaseUserInfo"
            resultMap="BaseUserInfoResult">
        <include refid="selectBaseUserInfoVo"/>
        <where>
            <if test="usercode != null  and usercode != ''"> and usercode = #{usercode}</if>
            <if test="account != null  and account != ''"> and account = #{account}</if>
            <if test="phone != null  and phone != ''"> and phone = #{phone}</if>
            <if test="password != null  and password != ''"> and password = #{password}</if>
            <if test="secret != null  and secret != ''"> and secret = #{secret}</if>
            <if test="realname != null  and realname != ''"> and realname like concat('%', #{realname}, '%')</if>
            <if test="nickname != null  and nickname != ''"> and nickname like concat('%', #{nickname}, '%')</if>
            <if test="roleid != null "> and roleid = #{roleid}</if>
            <if test="rolename != null  and rolename != ''"> and rolename like concat('%', #{rolename}, '%')</if>
            <if test="deptid != null  and deptid != ''"> and deptid = #{deptid}</if>
            <if test="deptname != null  and deptname != ''"> and deptname like concat('%', #{deptname}, '%')</if>
            <if test="wardid != null  and wardid != ''"> and wardid = #{wardid}</if>
            <if test="wardname != null  and wardname != ''"> and wardname like concat('%', #{wardname}, '%')</if>
            <if test="usertype != null "> and usertype = #{usertype}</if>
            <if test="usertypename != null  and usertypename != ''"> and usertypename like concat('%', #{usertypename}, '%')</if>
            <if test="dwpermission != null "> and dwpermission = #{dwpermission}</if>
            <if test="isopenlowerorg != null "> and isopenlowerorg = #{isopenlowerorg}</if>
            <if test="isopenshareknow != null "> and isopenshareknow = #{isopenshareknow}</if>
            <if test="isopengeneraldata != null "> and isopengeneraldata = #{isopengeneraldata}</if>
            <if test="orgid != null  and orgid != ''"> and orgid = #{orgid}</if>
            <if test="isupload != null "> and isupload = #{isupload}</if>
            <if test="uploadTime != null "> and upload_time = #{uploadTime}</if>
            <if test="deptpermission != null  and deptpermission != ''"> and deptpermission = #{deptpermission}</if>
            <if test="wardpermission != null  and wardpermission != ''"> and wardpermission = #{wardpermission}</if>
            <if test="usercode != null  and usercode != ''">and usercode = #{usercode}</if>
            <if test="account != null  and account != ''">and account = #{account}</if>
            <if test="phone != null  and phone != ''">and phone = #{phone}</if>
            <if test="password != null  and password != ''">and password = #{password}</if>
            <if test="secret != null  and secret != ''">and secret = #{secret}</if>
            <if test="realname != null  and realname != ''">and realname like concat('%', #{realname}, '%')</if>
            <if test="nickname != null  and nickname != ''">and nickname like concat('%', #{nickname}, '%')</if>
            <if test="roleid != null ">and roleid = #{roleid}</if>
            <if test="rolename != null  and rolename != ''">and rolename like concat('%', #{rolename}, '%')</if>
            <if test="deptid != null  and deptid != ''">and deptid = #{deptid}</if>
            <if test="deptname != null  and deptname != ''">and deptname like concat('%', #{deptname}, '%')</if>
            <if test="wardid != null  and wardid != ''">and wardid = #{wardid}</if>
            <if test="wardname != null  and wardname != ''">and wardname like concat('%', #{wardname}, '%')</if>
            <if test="usertype != null ">and usertype = #{usertype}</if>
            <if test="usertypename != null  and usertypename != ''">and usertypename like concat('%', #{usertypename},
                '%')
            </if>
            <if test="dwpermission != null ">and dwpermission = #{dwpermission}</if>
            <if test="isopenlowerorg != null ">and isopenlowerorg = #{isopenlowerorg}</if>
            <if test="isopenshareknow != null ">and isopenshareknow = #{isopenshareknow}</if>
            <if test="isopengeneraldata != null ">and isopengeneraldata = #{isopengeneraldata}</if>
            <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
            <if test="isupload != null ">and isupload = #{isupload}</if>
            <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
            <if test="deptpermission != null  and deptpermission != ''">and deptpermission = #{deptpermission}</if>
            <if test="wardpermission != null  and wardpermission != ''">and wardpermission = #{wardpermission}</if>
        </where>
    </select>
@@ -76,7 +109,8 @@
        where userid = #{userid}
    </select>
    <insert id="insertBaseUserInfo" parameterType="BaseUserInfo" useGeneratedKeys="true" keyProperty="userid">
    <insert id="insertBaseUserInfo" parameterType="com.ruoyi.system.domain.BaseUserInfo" useGeneratedKeys="true"
            keyProperty="userid">
        insert into base_user_info
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="usercode != null">usercode,</if>
@@ -108,7 +142,7 @@
            <if test="uploadTime != null">upload_time,</if>
            <if test="deptpermission != null">deptpermission,</if>
            <if test="wardpermission != null">wardpermission,</if>
         </trim>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="usercode != null">#{usercode},</if>
            <if test="account != null">#{account},</if>
@@ -139,10 +173,10 @@
            <if test="uploadTime != null">#{uploadTime},</if>
            <if test="deptpermission != null">#{deptpermission},</if>
            <if test="wardpermission != null">#{wardpermission},</if>
         </trim>
        </trim>
    </insert>
    <update id="updateBaseUserInfo" parameterType="BaseUserInfo">
    <update id="updateBaseUserInfo" parameterType="com.ruoyi.system.domain.BaseUserInfo">
        update base_user_info
        <trim prefix="SET" suffixOverrides=",">
            <if test="usercode != null">usercode = #{usercode},</if>
@@ -179,7 +213,9 @@
    </update>
    <delete id="deleteBaseUserInfoByUserid" parameterType="Long">
        delete from base_user_info where userid = #{userid}
        delete
        from base_user_info
        where userid = #{userid}
    </delete>
    <delete id="deleteBaseUserInfoByUserids" parameterType="String">
@@ -188,4 +224,4 @@
            #{userid}
        </foreach>
    </delete>
</mapper>
</mapper>