拓恒统一认证授权服务
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

43 lines
1.6KB

  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.tuoheng.mapper.ClientUserRoleMapper">
  4. <insert id="batchInsert" parameterType="java.util.List">
  5. insert into t_client_user_role (user_id, client_id, role_id, create_user,role_name)
  6. VALUES
  7. <foreach collection="list" item="it" separator=",">
  8. (#{it.userId}, #{it.clientId}, #{it.roleId}, #{it.createUser},#{it.roleName})
  9. </foreach>
  10. </insert>
  11. <insert id="insert" parameterType="com.tuoheng.model.po.ClientUserRolePo">
  12. insert into t_client_user_role (user_id, client_id, role_id, create_user, role_name)
  13. VALUES (#{userId}, #{clientId}, #{roleId}, #{createUser}, #{roleName})
  14. </insert>
  15. <update id="updateUserClientRole" parameterType="com.tuoheng.model.po.ClientUserRolePo">
  16. update t_client_user_role
  17. <set>
  18. <if test="roleId != null">
  19. role_id = #{roleId},
  20. </if>
  21. <if test="updateUser != null">
  22. update_user = #{updateUser},
  23. </if>
  24. </set>
  25. where user_id = #{userId} and client_id = #{clientId}
  26. </update>
  27. <delete id="deleteByUserIdAndClient">
  28. delete
  29. from t_client_user_role
  30. where user_id = #{userId}
  31. and client_id = #{clientId}
  32. </delete>
  33. <select id="selectListByUserId" resultType="com.tuoheng.model.po.ClientUserRolePo">
  34. SELECT *
  35. FROM t_client_user_role
  36. WHERE user_id = #{userId}
  37. </select>
  38. </mapper>