AuthMapper.xml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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.mapper.AuthMapper">
  4. <insert id="insertAuth" >
  5. insert into cm_brand_auth (authUserId, authParty, status, createTime, createBy)
  6. values (#{authUserId}, #{authParty}, #{status}, #{createTime}, #{createBy})
  7. </insert>
  8. <update id="updateAuthStatusByAuthId">
  9. update cm_brand_auth
  10. set status = #{status}
  11. where id = #{authId}
  12. </update>
  13. <update id="updateAuthByAuthId">
  14. update cm_brand_auth
  15. set authParty = #{authParty},
  16. status = #{status}
  17. where id = #{id}
  18. </update>
  19. <update id="updateAuthAuditStatus">
  20. update cm_brand_auth
  21. set auditStatus = #{auditStatus},
  22. invalidReason = #{invalidReason}
  23. where id = #{authId}
  24. </update>
  25. <delete id="deleteAuthByAuthId">
  26. delete from cm_brand_auth where id = #{authId}
  27. </delete>
  28. <select id="getAuthList" resultType="com.caimei.model.vo.AuthVo">
  29. select id as authId, authParty, a.status, a.auditStatus, a.createTime, u.name as createBy
  30. from cm_brand_auth a
  31. left join cm_brand_auth_user u on a.createBy = u.authUserId
  32. where a.authUserId = #{authUserId}
  33. <if test="authParty != null and authParty != ''">
  34. and a.authParty like CONCAT('%',#{authParty},'%')
  35. </if>
  36. order by a.createTime desc
  37. </select>
  38. <select id="getProductWaitAuditNum" resultType="java.lang.Integer">
  39. select count(*)
  40. from cm_brand_auth_product
  41. where authId = #{authId}
  42. and auditStatus = 2
  43. </select>
  44. </mapper>