|
@@ -0,0 +1,94 @@
|
|
|
+<?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.caimei.modules.shiro.dao.MallUserDao">
|
|
|
+ <select id="getMallUserInfo" resultType="com.caimei.modules.shiro.entity.CmMallAdminUser">
|
|
|
+ SELECT
|
|
|
+ id,
|
|
|
+ organizeID as organizeId,
|
|
|
+ status,
|
|
|
+ account,
|
|
|
+ accountName,
|
|
|
+ addTime,
|
|
|
+ updateTime
|
|
|
+ FROM cm_mall_admin_user
|
|
|
+ <where>
|
|
|
+ organizeID = #{organizeId} and delFlag = 0 and personnelType = 0
|
|
|
+ <if test="account != null and account != ''">
|
|
|
+ and account like concat('%',#{account},'%')
|
|
|
+ </if>
|
|
|
+ <if test="accountName != null and accountName !=''">
|
|
|
+ and accountName like concat('%',#{accountName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">
|
|
|
+ and status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
+ and addTime <![CDATA[ >= ]]> #{startTime}
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
+ and addTime <![CDATA[ <= ]]> #{endTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+ <select id="getMallUserById" resultType="com.caimei.modules.shiro.entity.CmMallAdminUser">
|
|
|
+ SELECT
|
|
|
+ id,
|
|
|
+ organizeID,
|
|
|
+ account,
|
|
|
+ accountName,
|
|
|
+ password,
|
|
|
+ salt,
|
|
|
+ addTime,
|
|
|
+ updateTime
|
|
|
+ FROM cm_mall_admin_user
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+ <update id="updateUser">
|
|
|
+ update cm_mall_admin_user
|
|
|
+ set status = #{validFlag}
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+ <select id="getRepeat" resultType="java.lang.Integer">
|
|
|
+ select id from cm_mall_admin_user where account =#{account}
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ and id != #{id}
|
|
|
+ </if>
|
|
|
+ limit 1
|
|
|
+ </select>
|
|
|
+ <insert id="insertMallUser">
|
|
|
+ INSERT INTO cm_mall_admin_user(account, accountName, PASSWORD, salt, organizeID, status, personnelType, ADDTIME, updateTime, delFlag)
|
|
|
+ VALUES(#{account}, #{accountName}, #{password}, #{salt}, #{organizeId}, #{status}, #{personnelType}, #{addTime}, #{updateTime}, #{delFlag})
|
|
|
+ </insert>
|
|
|
+ <update id="updateMallUser">
|
|
|
+ update cm_mall_admin_user
|
|
|
+ <set>
|
|
|
+ <if test="account != null and account != ''">
|
|
|
+ account = #{account},
|
|
|
+ </if>
|
|
|
+ <if test="accountName != null and accountName != ''">
|
|
|
+ accountName = #{accountName},
|
|
|
+ </if>
|
|
|
+ <if test="password != null and password != ''">
|
|
|
+ password = #{password},
|
|
|
+ </if>
|
|
|
+ <if test="organizeId != null and organizeId != ''">
|
|
|
+ organizeID = #{organizeId},
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">
|
|
|
+ status = #{status},
|
|
|
+ </if>
|
|
|
+ <if test="personnelType != null and personnelType != ''">
|
|
|
+ personnelType = #{personnelType},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null and updateTime != ''">
|
|
|
+ updateTime = #{updateTime},
|
|
|
+ </if>
|
|
|
+ <if test="salt != null and salt != ''">
|
|
|
+ salt = #{salt}
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+</mapper>
|