<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="com.yami.shop.user.comment.dao.UserRightsMapper">


  <update id="setStatua">
    UPDATE
      tz_user_rights
    SET
      `status` = #{status}
    WHERE rights_id = #{rightsId}
  </update>
  <select id="getUserRightsIdListByLevelId" resultType="java.lang.Long">
    SELECT ur.rights_id FROM tz_user_rights ur
    JOIN tz_user_level_rights ulr ON ur.rights_id = ulr.rights_id
    WHERE ulr.level_id = #{id}
    <if test="levelType != null">
      AND ur.service_type = #{levelType}
    </if>
  </select>
</mapper>
