CmMallUserMapper.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.caimei.modules.weisha.dao.CmMallUserDao">
  4. <select id="get" resultType="com.caimei.modules.weisha.entity.CmMallOrganize">
  5. select *
  6. from cm_mall_organize
  7. where id = #{id}
  8. </select>
  9. <select id="getMallUser" resultType="com.caimei.modules.weisha.entity.CmMallUser">
  10. SELECT
  11. id,
  12. organizeID,
  13. status,
  14. account,
  15. accountName,
  16. personnelType,
  17. addTime,
  18. updateTime
  19. FROM cm_mall_admin_user
  20. <where>
  21. organizeID = #{organizeId} and delFlag = 0
  22. <if test="account != null and account != ''">
  23. and account like concat('%',#{account},'%')
  24. </if>
  25. <if test="accountName != null and accountName !=''">
  26. and accountName like concat('%',#{accountName},'%')
  27. </if>
  28. <if test="status != null and status != ''">
  29. and status = #{status}
  30. </if>
  31. <if test="personnelType != null and personnelType != ''">
  32. and personnelType = #{personnelType}
  33. </if>
  34. <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
  35. and addTime <![CDATA[ >= ]]> #{startTime} and addTime <![CDATA[ <= ]]> #{endTime}
  36. </if>
  37. </where>
  38. </select>
  39. <update id="updateproduct">
  40. update cm_mall_admin_user
  41. set status = #{validFlag}
  42. where id = #{id}
  43. </update>
  44. <select id="getMallUserById" resultType="com.caimei.modules.weisha.entity.CmMallUser">
  45. SELECT id,
  46. organizeID,
  47. account,
  48. accountName,
  49. password,
  50. salt,
  51. addTime,
  52. updateTime
  53. FROM cm_mall_admin_user
  54. where id = #{id}
  55. </select>
  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,
  65. updateTime, delFlag)
  66. VALUES (#{account}, #{accountName}, #{password}, #{salt}, #{organizeId}, #{status}, #{personnelType},
  67. #{addTime}, #{updateTime}, #{delFlag})
  68. </insert>
  69. <update id="updateMallUser">
  70. update cm_mall_admin_user
  71. <set>
  72. <if test="account != null and account != ''">
  73. account = #{account},
  74. </if>
  75. <if test="accountName != null and accountName != ''">
  76. accountName = #{accountName},
  77. </if>
  78. <if test="password != null and password != ''">
  79. password = #{password},
  80. </if>
  81. <if test="organizeId != null and organizeId != ''">
  82. organizeID = #{organizeId},
  83. </if>
  84. <if test="status != null and status != ''">
  85. status = #{status},
  86. </if>
  87. <if test="personnelType != null and personnelType != ''">
  88. personnelType = #{personnelType},
  89. </if>
  90. <if test="updateTime != null">
  91. updateTime = #{updateTime},
  92. </if>
  93. <if test="salt != null and salt != ''">
  94. salt = #{salt}
  95. </if>
  96. </set>
  97. where id = #{id}
  98. </update>
  99. </mapper>