You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ocr/jyjz-system/jyjz-system-admin/src/main/resources/mapper/admin/UserMapper.xml

149 lines
6.9 KiB

<?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="cn.jyjz.xiaoyao.admin.dataDao.UserMybatisDao">
<resultMap id="BaseResultMap" type="cn.jyjz.xiaoyao.admin.dataobject.User">
<id column="ID" property="id" jdbcType="BIGINT"/>
<result column="LOGINNAME" property="loginname" jdbcType="VARCHAR"/>
<result column="PASSWORD" property="password" jdbcType="VARCHAR"/>
<result column="USERNAME" property="username" jdbcType="VARCHAR"/>
<result column="ISSYS" property="issys" jdbcType="INTEGER"/>
<result column="SORTING" property="sorting" jdbcType="INTEGER"/>
<result column="ENABLED" property="enabled" jdbcType="INTEGER"/>
<result column="USEX" property="usex" jdbcType="CHAR"/>
<result column="USERDESC" property="userdesc" jdbcType="VARCHAR"/>
<result column="MOBILE" property="mobile" jdbcType="VARCHAR"/>
<result column="EMAIL" property="email" jdbcType="VARCHAR"/>
<result column="USERICON" property="usericon" jdbcType="VARCHAR"/>
<result column="USERTYPE" property="usertype" jdbcType="INTEGER"/>
<result column="PERFECT" property="perfect" jdbcType="INTEGER"/>
<result column="FROMSIT" property="fromsit" jdbcType="BIGINT"/>
<result column="CREATEUSER" property="createuser" jdbcType="VARCHAR"/>
<result column="CREATEDATE" property="createdate" jdbcType="BIGINT"/>
<result column="UPDATEUSER" property="updateuser" jdbcType="VARCHAR"/>
<result column="UPDATETIME" property="updatetime" jdbcType="BIGINT"/>
<result column="PSDUPDATETIME" property="psdupdatetime" jdbcType="BIGINT"/>
<collection property="deptlist" select="cn.jyjz.xiaoyao.admin.dataDao.DepartmentMybatisDao.selectDeptByUserid" javaType="java.util.ArrayList" column="ID"/>
</resultMap>
<sql id="Base_Column_List">
ID AS id,
LOGINNAME AS loginname,
PASSWORD AS password,
USERNAME AS username,
ISSYS AS issys,
SORTING AS sorting,
ENABLED AS enabled,
USEX AS usex,
USERDESC AS userdesc,
MOBILE AS mobile,
EMAIL AS email,
USERICON AS usericon,
USERTYPE AS usertype,
PERFECT AS perfect,
FROMSIT AS fromsit,
CREATEUSER AS createuser,
CREATEDATE AS createdate,
UPDATEUSER AS updateuser,
UPDATETIME AS updatetime,
PSDUPDATETIME AS psdupdatetime
</sql>
<sql id="Base_Where">
<where>
<trim prefixOverrides="and|or">
<if test="id != null"> and ID ${id.dataOp} ${id.likestar}#{id.value}${id.likeend}</if>
<if test="loginname != null"> and LOGINNAME ${loginname.dataOp} ${loginname.likestar}#{loginname.value}${loginname.likeend}</if>
<if test="password != null"> and PASSWORD ${password.dataOp} ${password.likestar}#{password.value}${password.likeend}</if>
<if test="username != null"> and USERNAME ${username.dataOp} ${username.likestar}#{username.value}${username.likeend}</if>
<if test="issys != null"> and ISSYS ${issys.dataOp} ${issys.likestar}#{issys.value}${issys.likeend}</if>
<if test="sorting != null"> and SORTING ${sorting.dataOp} ${sorting.likestar}#{sorting.value}${sorting.likeend}</if>
<if test="enabled != null"> and ENABLED ${enabled.dataOp} ${enabled.likestar}#{enabled.value}${enabled.likeend}</if>
<if test="usex != null"> and USEX ${usex.dataOp} ${usex.likestar}#{usex.value}${usex.likeend}</if>
<if test="userdesc != null"> and USERDESC ${userdesc.dataOp} ${userdesc.likestar}#{userdesc.value}${userdesc.likeend}</if>
<if test="mobile != null"> and MOBILE ${mobile.dataOp} ${mobile.likestar}#{mobile.value}${mobile.likeend}</if>
<if test="email != null"> and EMAIL ${email.dataOp} ${email.likestar}#{email.value}${email.likeend}</if>
<if test="usericon != null"> and USERICON ${usericon.dataOp} ${usericon.likestar}#{usericon.value}${usericon.likeend}</if>
<if test="usertype != null"> and USERTYPE ${usertype.dataOp} ${usertype.likestar}#{usertype.value}${usertype.likeend}</if>
<if test="perfect != null"> and PERFECT ${perfect.dataOp} ${perfect.likestar}#{perfect.value}${perfect.likeend}</if>
<if test="fromsit != null"> and FROMSIT ${fromsit.dataOp} ${fromsit.likestar}#{fromsit.value}${fromsit.likeend}</if>
<if test="createuser != null"> and CREATEUSER ${createuser.dataOp} ${createuser.likestar}#{createuser.value}${createuser.likeend}</if>
<if test="createdate != null"> and CREATEDATE ${createdate.dataOp} ${createdate.likestar}#{createdate.value}${createdate.likeend}</if>
<if test="updateuser != null"> and UPDATEUSER ${updateuser.dataOp} ${updateuser.likestar}#{updateuser.value}${updateuser.likeend}</if>
<if test="updatetime != null"> and UPDATETIME ${updatetime.dataOp} ${updatetime.likestar}#{updatetime.value}${updatetime.likeend}</if>
<if test="psdupdatetime != null"> and PSDUPDATETIME ${psdupdatetime.dataOp} ${psdupdatetime.likestar}#{psdupdatetime.value}${psdupdatetime.likeend}</if>
<if test="userid != null"> and USERID ${userid.dataOp} ${userid.likestar}#{userid.value}${userid.likeend}</if>
<if test="listdept != null">
and uo.DEPARTID in
<foreach collection="listdept" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</if>
</trim>
</where>
<if test="page != null">
<if test="page.sortname != null"> order by ${page.sortname} ${page.sortorder}</if>
limit ${page.start}, ${page.Pagesize}
</if>
</sql>
<select id="selectListPageAlias" resultMap="BaseResultMap">
select
u.ID AS id,
u.LOGINNAME AS loginname,
u.PASSWORD AS password,
u.USERNAME AS username,
u.ISSYS AS issys,
u.SORTING AS sorting,
u.ENABLED AS enabled,
u.USEX AS usex,
u.USERDESC AS userdesc,
u.MOBILE AS mobile,
u.EMAIL AS email,
u.USERICON AS usericon,
u.USERTYPE AS usertype,
u.PERFECT AS perfect,
u.FROMSIT AS fromsit,
u.CREATEUSER AS createuser,
u.CREATEDATE AS createdate,
u.UPDATEUSER AS updateuser,
u.UPDATETIME AS updatetime,
u.PSDUPDATETIME AS psdupdatetime
from S_USER_T u
${ew.customSqlSegment}
</select>
<select id="selectListAlias" resultMap="BaseResultMap">
select
u.ID AS id,
u.LOGINNAME AS loginname,
u.USERNAME AS username,
u.ISSYS AS issys,
u.SORTING AS sorting,
u.ENABLED AS enabled,
u.USEX AS usex,
u.USERDESC AS userdesc,
u.MOBILE AS mobile,
u.EMAIL AS email,
u.USERICON AS usericon,
u.USERTYPE AS usertype
from S_USER_T u RIGHT JOIN S_USEROBJECT_T uo ON uo.USERID = u.ID
${ew.customSqlSegment}
</select>
<select id="selectLoginname" resultType="java.lang.String" parameterType="java.util.Map">
select u.LOGINNAME from S_USER_T u ,S_USEROBJECT_T uo where uo.USERID = u.ID
<if test="listdept != null">
and uo.DEPARTID in
<foreach collection="listdept" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</if>
</select>
<update id="updateUserBan" parameterType="java.util.Map">
update S_USER_T set ENABLED = 0 where
LOGINNAME in
<foreach collection="loginName" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</update>
</mapper>