| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650 |
- <?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.ssm.mapper.system.SysUserMapper" >
- <resultMap id="BaseResultMap" type="com.ssm.model.system.SysUser" >
- <id column="UserID" property="userid" jdbcType="INTEGER" />
- <result column="UserName" property="username" jdbcType="VARCHAR" />
- <result column="UserNameEN" property="usernameen" jdbcType="VARCHAR" />
- <result column="EmployeeNo" property="employeeno" jdbcType="VARCHAR" />
- <result column="Gender" property="gender" jdbcType="VARCHAR" />
- <result column="Password" property="password" jdbcType="VARCHAR" />
- <!-- <result column="DepID" property="depid" jdbcType="INTEGER" /> -->
- <!-- <result column="PositionID" property="positionid" jdbcType="INTEGER" /> -->
- <result column="PhoneNumber" property="phonenumber" jdbcType="VARCHAR" />
- <result column="MobileNumber" property="mobilenumber" jdbcType="VARCHAR" />
- <result column="EmailAddress" property="emailaddress" jdbcType="VARCHAR" />
- <result column="Area" property="area" jdbcType="VARCHAR" />
- <result column="LineManagerID" property="linemanagerid" jdbcType="VARCHAR" />
- <result column="Entrydate" property="entrydate" jdbcType="TIMESTAMP" />
- <result column="BirthDay" property="birthday" jdbcType="TIMESTAMP" />
- <result column="HeadImageUrl" property="headimageurl" jdbcType="VARCHAR" />
- <result column="OwnedCompany" property="ownedcompany" jdbcType="VARCHAR" />
- <result column="WorkLocation" property="worklocation" jdbcType="VARCHAR" />
- <result column="Address" property="address" jdbcType="VARCHAR" />
- <result column="LastLoginDate" property="lastlogindate" jdbcType="TIMESTAMP" />
- <result column="LastLoginIP" property="lastloginip" jdbcType="VARCHAR" />
- <result column="LoginCounts" property="logincounts" jdbcType="INTEGER" />
- <result column="IsEnabled" property="isenabled" jdbcType="BIT" />
- <result column="IsDeleted" property="isdeleted" jdbcType="BIT" />
- <result column="CreatedUserID" property="createduserid" jdbcType="INTEGER" />
- <result column="CreatedDatetime" property="createddatetime" jdbcType="TIMESTAMP" />
- <result column="LastUpdateUserID" property="lastupdateuserid" jdbcType="INTEGER" />
- <result column="LastUpdateDatetime" property="lastupdatedatetime" jdbcType="TIMESTAMP" />
- <!-- 会存在N+1问题 , 影响系统效率 -->
- <!-- <association column="PositionID" javaType="com.ssm.model.system.SysPosition" property="sysPosition" select="getPosition" /> -->
- <!-- <association column="DepID" property="sysDepartment" select="getDepartment" /> -->
- <association javaType="com.ssm.model.system.SysPosition"
- property="sysPosition" resultMap="com.ssm.mapper.system.SysPositionMapper.BaseResultMap" />
- <association javaType="com.ssm.model.system.SysDepartment"
- property="sysDepartment" resultMap="com.ssm.mapper.system.SysDepartmentMapper.BaseResultMap" />
- <collection property="roleList" ofType="com.ssm.model.system.SysRole">
- <id property="roleId" column="roleid" />
- <result property="roleName" column="rolename" />
- </collection>
- </resultMap>
- <sql id="Example_Where_Clause" >
- <where >
- <foreach collection="oredCriteria" item="criteria" separator="or" >
- <if test="criteria.valid" >
- <trim prefix="(" suffix=")" prefixOverrides="and" >
- <foreach collection="criteria.criteria" item="criterion" >
- <choose >
- <when test="criterion.noValue" >
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue" >
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue" >
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue" >
- and ${criterion.condition}
- <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Update_By_Example_Where_Clause" >
- <where >
- <foreach collection="example.oredCriteria" item="criteria" separator="or" >
- <if test="criteria.valid" >
- <trim prefix="(" suffix=")" prefixOverrides="and" >
- <foreach collection="criteria.criteria" item="criterion" >
- <choose >
- <when test="criterion.noValue" >
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue" >
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue" >
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue" >
- and ${criterion.condition}
- <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <select id="getPosition" parameterType="int" resultType="com.ssm.model.system.SysPosition">
- SELECT * FROM SysPosition WHERE PositionID=#{id}
- </select>
- <select id="getDepartment" parameterType="int" resultType="com.ssm.model.system.SysDepartment">
- SELECT * FROM SysDepartment WHERE DepID=#{id}
- </select>
- <select id="selectPerssion" resultType="int">
- SELECT count(*) from SysRoleMenu s ,SysUserRole sr , SysMenu sm
- WHERE s.RoleID = sr.RoleID AND sr.UserID=#{userid}
- AND s.MenuID = sm.MenuID AND sm.IsDelete = 0 AND sm.IsEnable = 0
- AND sm.MenuUrl= #{menuUrl}
- </select>
- <sql id="Base_Column_List" >
- UserID, UserName, UserNameEN, EmployeeNo, Gender, Password, DepID, PositionID, PhoneNumber,
- MobileNumber, EmailAddress, Area, LineManagerID, Entrydate, BirthDay, HeadImageUrl,
- OwnedCompany, WorkLocation, Address, LastLoginDate, LastLoginIP, LoginCounts, IsEnabled,
- IsDeleted, CreatedUserID, CreatedDatetime, LastUpdateUserID, LastUpdateDatetime
- </sql>
- <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.ssm.model.system.SysUserExample" >
- select
- <if test="distinct" >
- distinct
- </if>
- <include refid="Base_Column_List" />
- from SysUser
- <if test="_parameter != null" >
- <include refid="Example_Where_Clause" />
- </if>
- <if test="orderByClause != null" >
- order by ${orderByClause}
- </if>
- </select>
-
- <select id="selectByCondition" resultMap="BaseResultMap" parameterType="java.lang.String" >
- select su.userid, su.username, su.positionid, su.employeeno,
- su.mobilenumber, su.emailaddress,
- sp.positionname,su.isEnabled , sd.DepName
- from SysUser su
- LEFT JOIN SysPosition sp ON su.PositionID = sp.PositionID
- LEFT JOIN SysDepartment sd ON su.DepID = sd.DepID
- where su.isDeleted = 0
- <if test="username != null ">
- and su.username like CONCAT('%',#{username},'%')
-
- </if>
- <if test="employeeno != null ">
- and su.employeeno like CONCAT('%',#{employeeno},'%')
- </if>
- order by su.userid desc
- </select>
-
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from SysUser
- where UserID = #{userid,jdbcType=INTEGER}
- </select>
-
- <select id="findByEmployeeno" resultMap="BaseResultMap" parameterType="java.lang.String">
- select
- <include refid="Base_Column_List" />
- from SysUser
- where EmployeeNo = #{employeeno}
- </select>
-
- <select id="findByEmployeenoAndPasswod" resultMap="BaseResultMap" parameterType="java.lang.String">
- select
- <include refid="Base_Column_List" />
- from SysUser
- where EmployeeNo = #{employeeno} and Password = #{password}
- </select>
-
- <update id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- update SysUser set IsDeleted = 1
- where UserID = #{userid,jdbcType=INTEGER}
- </update>
- <delete id="deleteByExample" parameterType="com.ssm.model.system.SysUserExample" >
- delete from SysUser
- <if test="_parameter != null" >
- <include refid="Example_Where_Clause" />
- </if>
- </delete>
- <delete id="deleteUserRole" parameterType="java.lang.Integer">
- delete from SysUserRole
- where UserID = #{userid,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.ssm.model.system.SysUser" >
- insert into SysUser (UserID, UserName, UserNameEN,
- EmployeeNo, Gender, Password,
- DepID, PositionID, PhoneNumber,
- MobileNumber, EmailAddress, Area,
- LineManagerID, Entrydate, BirthDay,
- HeadImageUrl, OwnedCompany, WorkLocation,
- Address, LastLoginDate, LastLoginIP,
- LoginCounts, IsEnabled, IsDeleted,
- CreatedUserID, CreatedDatetime, LastUpdateUserID,
- LastUpdateDatetime)
- values (#{userid,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{usernameen,jdbcType=VARCHAR},
- #{employeeno,jdbcType=VARCHAR}, #{gender,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
- #{sysDepartment.depid,jdbcType=INTEGER}, #{sysPosition.positionid,jdbcType=INTEGER}, #{phonenumber,jdbcType=VARCHAR},
- #{mobilenumber,jdbcType=VARCHAR}, #{emailaddress,jdbcType=VARCHAR}, #{area,jdbcType=VARCHAR},
- #{linemanagerid,jdbcType=VARCHAR}, #{entrydate,jdbcType=TIMESTAMP}, #{birthday,jdbcType=TIMESTAMP},
- #{headimageurl,jdbcType=VARCHAR}, #{ownedcompany,jdbcType=VARCHAR}, #{worklocation,jdbcType=VARCHAR},
- #{address,jdbcType=VARCHAR}, #{lastlogindate,jdbcType=TIMESTAMP}, #{lastloginip,jdbcType=VARCHAR},
- #{logincounts,jdbcType=INTEGER}, #{isenabled,jdbcType=BIT}, #{isdeleted,jdbcType=BIT},
- #{createduserid,jdbcType=INTEGER}, #{createddatetime,jdbcType=TIMESTAMP}, #{lastupdateuserid,jdbcType=INTEGER},
- #{lastupdatedatetime,jdbcType=TIMESTAMP})
- </insert>
- <insert id="insertSelective" parameterType="com.ssm.model.system.SysUser" >
- <selectKey resultType="java.lang.Integer" order="AFTER" keyProperty="userid">
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into SysUser
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="userid != null" >
- UserID,
- </if>
- <if test="username != null" >
- UserName,
- </if>
- <if test="usernameen != null" >
- UserNameEN,
- </if>
- <if test="employeeno != null" >
- EmployeeNo,
- </if>
- <if test="gender != null" >
- Gender,
- </if>
- <if test="password != null" >
- Password,
- </if>
- <if test="sysDepartment != null and sysDepartment.depid != null" >
- DepID,
- </if>
- <if test="sysPosition != null and sysPosition.positionid != null" >
- PositionID,
- </if>
- <if test="phonenumber != null" >
- PhoneNumber,
- </if>
- <if test="mobilenumber != null" >
- MobileNumber,
- </if>
- <if test="emailaddress != null" >
- EmailAddress,
- </if>
- <if test="area != null" >
- Area,
- </if>
- <if test="linemanagerid != null" >
- LineManagerID,
- </if>
- <if test="entrydate != null" >
- Entrydate,
- </if>
- <if test="birthday != null" >
- BirthDay,
- </if>
- <if test="headimageurl != null" >
- HeadImageUrl,
- </if>
- <if test="ownedcompany != null" >
- OwnedCompany,
- </if>
- <if test="worklocation != null" >
- WorkLocation,
- </if>
- <if test="address != null" >
- Address,
- </if>
- <if test="lastlogindate != null" >
- LastLoginDate,
- </if>
- <if test="lastloginip != null" >
- LastLoginIP,
- </if>
- <if test="logincounts != null" >
- LoginCounts,
- </if>
- <if test="isenabled != null" >
- IsEnabled,
- </if>
- <if test="isdeleted != null" >
- IsDeleted,
- </if>
- <if test="createduserid != null" >
- CreatedUserID,
- </if>
- <if test="createddatetime != null" >
- CreatedDatetime,
- </if>
- <if test="lastupdateuserid != null" >
- LastUpdateUserID,
- </if>
- <if test="lastupdatedatetime != null" >
- LastUpdateDatetime,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="userid != null" >
- #{userid,jdbcType=INTEGER},
- </if>
- <if test="username != null" >
- #{username,jdbcType=VARCHAR},
- </if>
- <if test="usernameen != null" >
- #{usernameen,jdbcType=VARCHAR},
- </if>
- <if test="employeeno != null" >
- #{employeeno,jdbcType=VARCHAR},
- </if>
- <if test="gender != null" >
- #{gender,jdbcType=VARCHAR},
- </if>
- <if test="password != null" >
- #{password,jdbcType=VARCHAR},
- </if>
- <if test="sysDepartment != null and sysDepartment.depid != null" >
- #{sysDepartment.depid,jdbcType=INTEGER},
- </if>
- <if test="sysPosition != null and sysPosition.positionid != null" >
- #{sysPosition.positionid,jdbcType=INTEGER},
- </if>
- <if test="phonenumber != null" >
- #{phonenumber,jdbcType=VARCHAR},
- </if>
- <if test="mobilenumber != null" >
- #{mobilenumber,jdbcType=VARCHAR},
- </if>
- <if test="emailaddress != null" >
- #{emailaddress,jdbcType=VARCHAR},
- </if>
- <if test="area != null" >
- #{area,jdbcType=VARCHAR},
- </if>
- <if test="linemanagerid != null" >
- #{linemanagerid,jdbcType=VARCHAR},
- </if>
- <if test="entrydate != null" >
- #{entrydate,jdbcType=TIMESTAMP},
- </if>
- <if test="birthday != null" >
- #{birthday,jdbcType=TIMESTAMP},
- </if>
- <if test="headimageurl != null" >
- #{headimageurl,jdbcType=VARCHAR},
- </if>
- <if test="ownedcompany != null" >
- #{ownedcompany,jdbcType=VARCHAR},
- </if>
- <if test="worklocation != null" >
- #{worklocation,jdbcType=VARCHAR},
- </if>
- <if test="address != null" >
- #{address,jdbcType=VARCHAR},
- </if>
- <if test="lastlogindate != null" >
- #{lastlogindate,jdbcType=TIMESTAMP},
- </if>
- <if test="lastloginip != null" >
- #{lastloginip,jdbcType=VARCHAR},
- </if>
- <if test="logincounts != null" >
- #{logincounts,jdbcType=INTEGER},
- </if>
- <if test="isenabled != null" >
- #{isenabled,jdbcType=BIT},
- </if>
- <if test="isdeleted != null" >
- #{isdeleted,jdbcType=BIT},
- </if>
- <if test="createduserid != null" >
- #{createduserid,jdbcType=INTEGER},
- </if>
- <if test="createddatetime != null" >
- #{createddatetime,jdbcType=TIMESTAMP},
- </if>
- <if test="lastupdateuserid != null" >
- #{lastupdateuserid,jdbcType=INTEGER},
- </if>
- <if test="lastupdatedatetime != null" >
- #{lastupdatedatetime,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <insert id="insertUserRole" parameterType="java.lang.Integer">
- insert into SysUserRole(UserID, RoleID)
- values(#{userid,jdbcType=INTEGER}, #{roleid, jdbcType=INTEGER})
- </insert>
- <select id="countByExample" parameterType="com.ssm.model.system.SysUserExample" resultType="java.lang.Integer" >
- select count(*) from SysUser
- <if test="_parameter != null" >
- <include refid="Example_Where_Clause" />
- </if>
- </select>
- <update id="updateByExampleSelective" parameterType="map" >
- update SysUser
- <set >
- <if test="record.userid != null" >
- UserID = #{record.userid,jdbcType=INTEGER},
- </if>
- <if test="record.username != null" >
- UserName = #{record.username,jdbcType=VARCHAR},
- </if>
- <if test="record.usernameen != null" >
- UserNameEN = #{record.usernameen,jdbcType=VARCHAR},
- </if>
- <if test="record.employeeno != null" >
- EmployeeNo = #{record.employeeno,jdbcType=VARCHAR},
- </if>
- <if test="record.gender != null" >
- Gender = #{record.gender,jdbcType=VARCHAR},
- </if>
- <if test="record.password != null" >
- Password = #{record.password,jdbcType=VARCHAR},
- </if>
- <if test="record.depid != null" >
- DepID = #{record.depid,jdbcType=INTEGER},
- </if>
- <if test="record.positionid != null" >
- PositionID = #{record.positionid,jdbcType=INTEGER},
- </if>
- <if test="record.phonenumber != null" >
- PhoneNumber = #{record.phonenumber,jdbcType=VARCHAR},
- </if>
- <if test="record.mobilenumber != null" >
- MobileNumber = #{record.mobilenumber,jdbcType=VARCHAR},
- </if>
- <if test="record.emailaddress != null" >
- EmailAddress = #{record.emailaddress,jdbcType=VARCHAR},
- </if>
- <if test="record.area != null" >
- Area = #{record.area,jdbcType=VARCHAR},
- </if>
- <if test="record.linemanagerid != null" >
- LineManagerID = #{record.linemanagerid,jdbcType=VARCHAR},
- </if>
- <if test="record.entrydate != null" >
- Entrydate = #{record.entrydate,jdbcType=TIMESTAMP},
- </if>
- <if test="record.birthday != null" >
- BirthDay = #{record.birthday,jdbcType=TIMESTAMP},
- </if>
- <if test="record.headimageurl != null" >
- HeadImageUrl = #{record.headimageurl,jdbcType=VARCHAR},
- </if>
- <if test="record.ownedcompany != null" >
- OwnedCompany = #{record.ownedcompany,jdbcType=VARCHAR},
- </if>
- <if test="record.worklocation != null" >
- WorkLocation = #{record.worklocation,jdbcType=VARCHAR},
- </if>
- <if test="record.address != null" >
- Address = #{record.address,jdbcType=VARCHAR},
- </if>
- <if test="record.lastlogindate != null" >
- LastLoginDate = #{record.lastlogindate,jdbcType=TIMESTAMP},
- </if>
- <if test="record.lastloginip != null" >
- LastLoginIP = #{record.lastloginip,jdbcType=VARCHAR},
- </if>
- <if test="record.logincounts != null" >
- LoginCounts = #{record.logincounts,jdbcType=INTEGER},
- </if>
- <if test="record.isenabled != null" >
- IsEnabled = #{record.isenabled,jdbcType=BIT},
- </if>
- <if test="record.isdeleted != null" >
- IsDeleted = #{record.isdeleted,jdbcType=BIT},
- </if>
- <if test="record.createduserid != null" >
- CreatedUserID = #{record.createduserid,jdbcType=INTEGER},
- </if>
- <if test="record.createddatetime != null" >
- CreatedDatetime = #{record.createddatetime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.lastupdateuserid != null" >
- LastUpdateUserID = #{record.lastupdateuserid,jdbcType=INTEGER},
- </if>
- <if test="record.lastupdatedatetime != null" >
- LastUpdateDatetime = #{record.lastupdatedatetime,jdbcType=TIMESTAMP},
- </if>
- </set>
- <if test="_parameter != null" >
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByExample" parameterType="map" >
- update SysUser
- set UserID = #{record.userid,jdbcType=INTEGER},
- UserName = #{record.username,jdbcType=VARCHAR},
- UserNameEN = #{record.usernameen,jdbcType=VARCHAR},
- EmployeeNo = #{record.employeeno,jdbcType=VARCHAR},
- Gender = #{record.gender,jdbcType=VARCHAR},
- Password = #{record.password,jdbcType=VARCHAR},
- DepID = #{record.depid,jdbcType=INTEGER},
- PositionID = #{record.positionid,jdbcType=INTEGER},
- PhoneNumber = #{record.phonenumber,jdbcType=VARCHAR},
- MobileNumber = #{record.mobilenumber,jdbcType=VARCHAR},
- EmailAddress = #{record.emailaddress,jdbcType=VARCHAR},
- Area = #{record.area,jdbcType=VARCHAR},
- LineManagerID = #{record.linemanagerid,jdbcType=VARCHAR},
- Entrydate = #{record.entrydate,jdbcType=TIMESTAMP},
- BirthDay = #{record.birthday,jdbcType=TIMESTAMP},
- HeadImageUrl = #{record.headimageurl,jdbcType=VARCHAR},
- OwnedCompany = #{record.ownedcompany,jdbcType=VARCHAR},
- WorkLocation = #{record.worklocation,jdbcType=VARCHAR},
- Address = #{record.address,jdbcType=VARCHAR},
- LastLoginDate = #{record.lastlogindate,jdbcType=TIMESTAMP},
- LastLoginIP = #{record.lastloginip,jdbcType=VARCHAR},
- LoginCounts = #{record.logincounts,jdbcType=INTEGER},
- IsEnabled = #{record.isenabled,jdbcType=BIT},
- IsDeleted = #{record.isdeleted,jdbcType=BIT},
- CreatedUserID = #{record.createduserid,jdbcType=INTEGER},
- CreatedDatetime = #{record.createddatetime,jdbcType=TIMESTAMP},
- LastUpdateUserID = #{record.lastupdateuserid,jdbcType=INTEGER},
- LastUpdateDatetime = #{record.lastupdatedatetime,jdbcType=TIMESTAMP}
- <if test="_parameter != null" >
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.ssm.model.system.SysUser" >
- update SysUser
- <set >
- <if test="username != null" >
- UserName = #{username,jdbcType=VARCHAR},
- </if>
- <if test="usernameen != null" >
- UserNameEN = #{usernameen,jdbcType=VARCHAR},
- </if>
- <if test="employeeno != null" >
- EmployeeNo = #{employeeno,jdbcType=VARCHAR},
- </if>
- <if test="gender != null" >
- Gender = #{gender,jdbcType=VARCHAR},
- </if>
- <if test="password != null" >
- Password = #{password,jdbcType=VARCHAR},
- </if>
- <if test="sysDepartment != null and sysDepartment.depid != null" >
- DepID = #{sysDepartment.depid,jdbcType=INTEGER},
- </if>
- <if test="sysPosition!=null and sysPosition.positionid != null" >
- PositionID = #{sysPosition.positionid,jdbcType=INTEGER},
- </if>
- <if test="phonenumber != null" >
- PhoneNumber = #{phonenumber,jdbcType=VARCHAR},
- </if>
- <if test="mobilenumber != null" >
- MobileNumber = #{mobilenumber,jdbcType=VARCHAR},
- </if>
- <if test="emailaddress != null" >
- EmailAddress = #{emailaddress,jdbcType=VARCHAR},
- </if>
- <if test="area != null" >
- Area = #{area,jdbcType=VARCHAR},
- </if>
- <if test="linemanagerid != null" >
- LineManagerID = #{linemanagerid,jdbcType=VARCHAR},
- </if>
- <if test="entrydate != null" >
- Entrydate = #{entrydate,jdbcType=TIMESTAMP},
- </if>
- <if test="birthday != null" >
- BirthDay = #{birthday,jdbcType=TIMESTAMP},
- </if>
- <if test="headimageurl != null" >
- HeadImageUrl = #{headimageurl,jdbcType=VARCHAR},
- </if>
- <if test="ownedcompany != null" >
- OwnedCompany = #{ownedcompany,jdbcType=VARCHAR},
- </if>
- <if test="worklocation != null" >
- WorkLocation = #{worklocation,jdbcType=VARCHAR},
- </if>
- <if test="address != null" >
- Address = #{address,jdbcType=VARCHAR},
- </if>
- <if test="lastlogindate != null" >
- LastLoginDate = #{lastlogindate,jdbcType=TIMESTAMP},
- </if>
- <if test="lastloginip != null" >
- LastLoginIP = #{lastloginip,jdbcType=VARCHAR},
- </if>
- <if test="logincounts != null" >
- LoginCounts = #{logincounts,jdbcType=INTEGER},
- </if>
- <if test="isenabled != null" >
- IsEnabled = #{isenabled,jdbcType=BIT},
- </if>
- <if test="isdeleted != null" >
- IsDeleted = #{isdeleted,jdbcType=BIT},
- </if>
- <if test="createduserid != null" >
- CreatedUserID = #{createduserid,jdbcType=INTEGER},
- </if>
- <if test="createddatetime != null" >
- CreatedDatetime = #{createddatetime,jdbcType=TIMESTAMP},
- </if>
- <if test="lastupdateuserid != null" >
- LastUpdateUserID = #{lastupdateuserid,jdbcType=INTEGER},
- </if>
- <if test="lastupdatedatetime != null" >
- LastUpdateDatetime = #{lastupdatedatetime,jdbcType=TIMESTAMP},
- </if>
- </set>
- where UserID = #{userid,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.ssm.model.system.SysUser" >
- update SysUser
- set UserName = #{username,jdbcType=VARCHAR},
- UserNameEN = #{usernameen,jdbcType=VARCHAR},
- EmployeeNo = #{employeeno,jdbcType=VARCHAR},
- Gender = #{gender,jdbcType=VARCHAR},
- Password = #{password,jdbcType=VARCHAR},
- DepID = #{sysDepartment.depid,jdbcType=INTEGER},
- PositionID = #{sysPosition.positionid,jdbcType=INTEGER},
- PhoneNumber = #{phonenumber,jdbcType=VARCHAR},
- MobileNumber = #{mobilenumber,jdbcType=VARCHAR},
- EmailAddress = #{emailaddress,jdbcType=VARCHAR},
- Area = #{area,jdbcType=VARCHAR},
- LineManagerID = #{linemanagerid,jdbcType=VARCHAR},
- Entrydate = #{entrydate,jdbcType=TIMESTAMP},
- BirthDay = #{birthday,jdbcType=TIMESTAMP},
- HeadImageUrl = #{headimageurl,jdbcType=VARCHAR},
- OwnedCompany = #{ownedcompany,jdbcType=VARCHAR},
- WorkLocation = #{worklocation,jdbcType=VARCHAR},
- Address = #{address,jdbcType=VARCHAR},
- LastLoginDate = #{lastlogindate,jdbcType=TIMESTAMP},
- LastLoginIP = #{lastloginip,jdbcType=VARCHAR},
- LoginCounts = #{logincounts,jdbcType=INTEGER},
- IsEnabled = #{isenabled,jdbcType=BIT},
- IsDeleted = #{isdeleted,jdbcType=BIT},
- CreatedUserID = #{createduserid,jdbcType=INTEGER},
- CreatedDatetime = #{createddatetime,jdbcType=TIMESTAMP},
- LastUpdateUserID = #{lastupdateuserid,jdbcType=INTEGER},
- LastUpdateDatetime = #{lastupdatedatetime,jdbcType=TIMESTAMP}
- where UserID = #{userid,jdbcType=INTEGER}
- </update>
- <select id="selectAllUser" resultMap="BaseResultMap">
- SELECT * from SysUser s where s.IsDeleted = 0 AND s.IsEnabled = 0
- </select>
- <select id="selectUserRoleByUserIdAndRoldId" resultType="java.lang.Integer">
- select COUNT(ssr.ID) from sysuserrole ssr where UserID=#{userid,jdbcType=INTEGER} and RoleID=#{roldid,jdbcType=INTEGER}
- </select>
- </mapper>
|