CmMallUserMapper.xml 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 * from cm_mall_organize where id = #{id}
  6. </select>
  7. <select id="getMallUser" resultType="com.caimei.modules.weisha.entity.CmMallUser">
  8. SELECT
  9. id,
  10. organizeID,
  11. status,
  12. account,
  13. accountName,
  14. personnelType,
  15. addTime,
  16. updateTime
  17. FROM cm_mall_admin_user
  18. <where>
  19. organizeID = #{organizeId} and delFlag = 0
  20. <if test="account != null and account != ''">
  21. and account like concat('%',#{account},'%')
  22. </if>
  23. <if test="accountName != null and accountName !=''">
  24. and accountName like concat('%',#{accountName},'%')
  25. </if>
  26. <if test="status != null and status != ''">
  27. and status = #{status}
  28. </if>
  29. <if test="personnelType != null and personnelType != ''">
  30. and personnelType = #{personnelType}
  31. </if>
  32. <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
  33. and addTime <![CDATA[ >= ]]> #{startTime} and addTime <![CDATA[ <= ]]> #{endTime}
  34. </if>
  35. </where>
  36. </select>
  37. <update id="updateproduct">
  38. update cm_mall_admin_user
  39. set status = #{validFlag}
  40. where id = #{id}
  41. </update>
  42. <select id="getMallUserById" resultType="com.caimei.modules.weisha.entity.CmMallUser">
  43. SELECT
  44. id,
  45. organizeID,
  46. account,
  47. accountName,
  48. password,
  49. salt,
  50. addTime,
  51. updateTime
  52. FROM cm_mall_admin_user
  53. where id = #{id}
  54. </select>
  55. <select id="getRepeat" resultType="java.lang.Integer">
  56. select id from cm_mall_admin_user where account =#{account}
  57. <if test="id != null and id != ''">
  58. and id != #{id}
  59. </if>
  60. limit 1
  61. </select>
  62. <insert id="insertMallUser">
  63. INSERT INTO cm_mall_admin_user(account, accountName, PASSWORD, salt, organizeID, status, personnelType, ADDTIME, updateTime, delFlag)
  64. VALUES(#{account}, #{accountName}, #{password}, #{salt}, #{organizeId}, #{status}, #{personnelType}, #{addTime}, #{updateTime}, #{delFlag})
  65. </insert>
  66. <update id="updateMallUser">
  67. update cm_mall_admin_user
  68. <set>
  69. <if test="account != null and account != ''">
  70. account = #{account},
  71. </if>
  72. <if test="accountName != null and accountName != ''">
  73. accountName = #{accountName},
  74. </if>
  75. <if test="password != null and password != ''">
  76. password = #{password},
  77. </if>
  78. <if test="organizeId != null and organizeId != ''">
  79. organizeID = #{organizeId},
  80. </if>
  81. <if test="status != null and status != ''">
  82. status = #{status},
  83. </if>
  84. <if test="personnelType != null and personnelType != ''">
  85. personnelType = #{personnelType},
  86. </if>
  87. <if test="updateTime != null">
  88. updateTime = #{updateTime},
  89. </if>
  90. <if test="salt != null and salt != ''">
  91. salt = #{salt}
  92. </if>
  93. </set>
  94. where id = #{id}
  95. </update>
  96. </mapper>