MallUserMapper.xml 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.caimei.modules.shiro.dao.MallUserDao">
  6. <select id="getMallUserInfo" resultType="com.caimei.modules.shiro.entity.CmMallAdminUser">
  7. SELECT
  8. id,
  9. organizeID as organizeId,
  10. status,
  11. account,
  12. accountName,
  13. personnelType,
  14. addTime,
  15. updateTime
  16. FROM cm_mall_admin_user
  17. <where>
  18. organizeID = #{organizeId} and delFlag = 0 and personnelType != 1
  19. <if test="account != null and account != ''">
  20. and account like concat('%',#{account},'%')
  21. </if>
  22. <if test="accountName != null and accountName !=''">
  23. and accountName like concat('%',#{accountName},'%')
  24. </if>
  25. <if test="status != null and status != ''">
  26. and status = #{status}
  27. </if>
  28. <if test="startTime != null and startTime != ''">
  29. and addTime <![CDATA[ >= ]]> #{startTime}
  30. </if>
  31. <if test="endTime != null and endTime != ''">
  32. and addTime <![CDATA[ <= ]]> #{endTime}
  33. </if>
  34. </where>
  35. order by addTime desc
  36. </select>
  37. <select id="getMallUserById" resultType="com.caimei.modules.shiro.entity.CmMallAdminUser">
  38. SELECT
  39. id,
  40. organizeID,
  41. account,
  42. accountName,
  43. password,
  44. status,
  45. salt,
  46. addTime,
  47. updateTime
  48. FROM cm_mall_admin_user
  49. where id = #{id}
  50. </select>
  51. <update id="updateUser">
  52. update cm_mall_admin_user
  53. set status = #{status}
  54. where id = #{id}
  55. </update>
  56. <select id="getRepeat" resultType="java.lang.Integer">
  57. select id from cm_mall_admin_user where account =#{account}
  58. <if test="id != null and id != ''">
  59. and id != #{id}
  60. </if>
  61. limit 1
  62. </select>
  63. <insert id="insertMallUser">
  64. INSERT INTO cm_mall_admin_user(account, accountName, PASSWORD, salt, organizeID, status, personnelType, ADDTIME, updateTime, delFlag)
  65. VALUES(#{account}, #{accountName}, #{password}, #{salt}, #{organizeId}, #{status}, #{personnelType}, #{addTime}, #{updateTime}, #{delFlag})
  66. </insert>
  67. <update id="updateMallUser">
  68. update cm_mall_admin_user
  69. <set>
  70. <if test="account != null and account != ''">
  71. account = #{account},
  72. </if>
  73. <if test="accountName != null and accountName != ''">
  74. accountName = #{accountName},
  75. </if>
  76. <if test="password != null and password != ''">
  77. password = #{password},
  78. </if>
  79. <if test="organizeId != null and organizeId != ''">
  80. organizeID = #{organizeId},
  81. </if>
  82. <if test="status != null and status != ''">
  83. status = #{status},
  84. </if>
  85. <if test="personnelType != null and personnelType != ''">
  86. personnelType = #{personnelType},
  87. </if>
  88. <if test="updateTime != null">
  89. updateTime = #{updateTime},
  90. </if>
  91. <if test="salt != null and salt != ''">
  92. salt = #{salt}
  93. </if>
  94. </set>
  95. where id = #{id}
  96. </update>
  97. </mapper>