1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

user表role改为role_id;后台管理用户增删改查封装成component

This commit is contained in:
2023-03-28 22:13:59 +08:00
parent 880e4f8941
commit cf962a92da
33 changed files with 865 additions and 281 deletions

View File

@@ -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 &amp;&amp; username != ''">
AND username LIKE concat('%',#{username,jdbcType=VARCHAR},'%')
</if>
<if test="realname != null &amp;&amp; realname != ''">
AND realname LIKE concat('%',#{realname,jdbcType=VARCHAR},'%')
</if>
<if test="idNumber != null &amp;&amp; idNumber != ''">
AND id_number LIKE concat('%',#{idNumber,jdbcType=VARCHAR},'%')
</if>
<if test="phoneNumber != null &amp;&amp; phoneNumber != ''">
AND phone_number LIKE concat('%',#{phoneNumber,jdbcType=VARCHAR},'%')
</if>
<if test="buildingId != null &amp;&amp; buildingId != ''">
AND building_id LIKE concat('%',#{buildingId,jdbcType=VARCHAR},'%')
</if>
<if test="doorplate != null &amp;&amp; doorplate != ''">
AND doorplate LIKE concat('%',#{doorplate,jdbcType=VARCHAR},'%')
</if>
</select>
</mapper>