AuthMapper.xml 1.3 KB

1234567891011121314151617181920212223242526272829303132
  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. <delete id="deleteAuthByAuthId">
  20. delete from cm_brand_auth where id = #{authId}
  21. </delete>
  22. <select id="getAuthList" resultType="com.caimei.model.vo.AuthVo">
  23. select id as authId, authParty, a.status, a.createTime, u.name as createBy
  24. from cm_brand_auth a
  25. left join cm_brand_auth_user u on a.createBy = u.authUserId
  26. where a.authUserId = #{authUserId}
  27. <if test="authParty != null and authParty != ''">
  28. and a.authParty like CONCAT('%',#{authParty},'%')
  29. </if>
  30. order by a.createTime desc
  31. </select>
  32. </mapper>