修复用户管理列表排序报错

This commit is contained in:
leijun
2018-12-01 11:57:12 +08:00
parent 330f6a5d39
commit 5c367c36ae

View File

@@ -18,8 +18,8 @@
</resultMap>
<sql id="Columns">
r.ID,r.USER_NAME,r.USER_PWD,r.SERVER_IP,r.user_type,r.is_audit,
r.IS_VALID,r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,remarks
a.ID,a.USER_NAME,a.USER_PWD,a.SERVER_IP,a.user_type,a.is_audit,
a.IS_VALID,a.CREATOR_ID,a.CREATE_TIME,a.EDITOR_ID,a.EDIT_TIME,a.remarks
</sql>
<select id="findList" parameterType="com.nis.domain.configuration.UserManage" resultMap="userManageMap">
@@ -28,30 +28,30 @@
<trim prefix="," prefixOverrides=",">
,s.name as creator_name ,e.name as editor_name
</trim>
FROM user_manage r
left join sys_user s on r.creator_id=s.id
left join sys_user e on r.editor_id=e.id
FROM user_manage a
left join sys_user s on a.creator_id=s.id
left join sys_user e on a.editor_id=e.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<if test="isValid != null">
AND r.is_valid=#{isValid,jdbcType=INTEGER}
AND a.is_valid=#{isValid,jdbcType=INTEGER}
</if>
<if test="isValid == null">
AND r.is_valid != -1
AND a.is_valid != -1
</if>
<if test="userName != null and userName != ''">
AND r.user_name like concat(concat('%',#{userName,jdbcType=VARCHAR}),'%')
AND a.user_name like concat(concat('%',#{userName,jdbcType=VARCHAR}),'%')
</if>
<if test="serverIp != null and serverIp != ''">
AND r.server_ip like concat(concat('%',#{serverIp,jdbcType=VARCHAR}),'%')
AND a.server_ip like concat(concat('%',#{serverIp,jdbcType=VARCHAR}),'%')
</if>
<if test="userType != null and userType != ''">
AND r.user_type =#{userType,jdbcType=VARCHAR}
AND a.user_type =#{userType,jdbcType=VARCHAR}
</if>
<if test="remarks != null and remarks != ''">
AND r.remarks like concat(concat('%',#{remarks,jdbcType=VARCHAR}),'%')
AND a.remarks like concat(concat('%',#{remarks,jdbcType=VARCHAR}),'%')
</if>
<!-- <if test="creatorName != null and creatorName != ''">
AND r.CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
@@ -67,7 +67,7 @@
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY r.id desc
ORDER BY a.id desc
</otherwise>
</choose>
@@ -144,17 +144,17 @@
<select id="getUserByLoginName" resultMap="userManageMap">
select
<include refid="Columns"/>
from user_manage r where is_valid !=-1 and r.user_name=#{userName}
from user_manage a where is_valid !=-1 and a.user_name=#{userName}
</select>
<select id="getUserById" resultMap="userManageMap">
select
<include refid="Columns"/>
from user_manage r where r.is_valid !=-1 and r.id=#{id}
from user_manage a where a.is_valid !=-1 and a.id=#{id}
</select>
<select id="findUsers" resultMap="userManageMap">
select
<include refid="Columns"/>
from user_manage r where r.is_valid !=-1
from user_manage a where a.is_valid !=-1
</select>
</mapper>