user表role改为role_id;后台管理用户增删改查封装成component
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cxyxiaomo.epp.user.dao.RoleDao">
|
||||
<select id="getRoleList" resultType="com.cxyxiaomo.epp.common.pojo.Role">
|
||||
select * from role
|
||||
</select>
|
||||
</mapper>
|
@@ -8,10 +8,39 @@
|
||||
VALUES (#{username}, #{password})
|
||||
</insert>
|
||||
<select id="getUserById" parameterType="java.lang.Long" resultType="com.cxyxiaomo.epp.common.pojo.User">
|
||||
SELECT * FROM user
|
||||
SELECT *
|
||||
FROM user
|
||||
WHERE id = #{id}
|
||||
</select>
|
||||
<select id="getUserByUsername" resultType="com.cxyxiaomo.epp.common.pojo.User">
|
||||
select * from user where username = #{username}
|
||||
select *
|
||||
from user
|
||||
where username = #{username}
|
||||
</select>
|
||||
<select id="getUserList" resultType="com.cxyxiaomo.epp.common.pojo.User">
|
||||
select *
|
||||
from user
|
||||
where 1 = 1
|
||||
<if test="roleId != null">
|
||||
AND role_id = #{roleId}
|
||||
</if>
|
||||
<if test="username != null && username != ''">
|
||||
AND username LIKE concat('%',#{username,jdbcType=VARCHAR},'%')
|
||||
</if>
|
||||
<if test="realname != null && realname != ''">
|
||||
AND realname LIKE concat('%',#{realname,jdbcType=VARCHAR},'%')
|
||||
</if>
|
||||
<if test="idNumber != null && idNumber != ''">
|
||||
AND id_number LIKE concat('%',#{idNumber,jdbcType=VARCHAR},'%')
|
||||
</if>
|
||||
<if test="phoneNumber != null && phoneNumber != ''">
|
||||
AND phone_number LIKE concat('%',#{phoneNumber,jdbcType=VARCHAR},'%')
|
||||
</if>
|
||||
<if test="buildingId != null && buildingId != ''">
|
||||
AND building_id LIKE concat('%',#{buildingId,jdbcType=VARCHAR},'%')
|
||||
</if>
|
||||
<if test="doorplate != null && doorplate != ''">
|
||||
AND doorplate LIKE concat('%',#{doorplate,jdbcType=VARCHAR},'%')
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
Reference in New Issue
Block a user