后台服务
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

MallUserRoleMapper.xml 1.4 KiB

2 yıl önce
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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.iformall.mapper.MallUserRoleMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.MallUserRole">
  5. <id column="id" jdbcType="VARCHAR" property="id" />
  6. <result column="uid" jdbcType="VARCHAR" property="uid" />
  7. <result column="role_id" jdbcType="VARCHAR" property="roleId" />
  8. </resultMap>
  9. <sql id="allColumns">
  10. `uid`,`role_id`,`id`
  11. </sql>
  12. <sql id="dynamicWhereConditions">
  13. where 1 = 1
  14. <if test=" null != uid ">
  15. and `uid` like concat('%', #{uid},'%')
  16. </if>
  17. <if test=" null != roleId ">
  18. and `role_id` like concat('%', #{roleId},'%')
  19. </if>
  20. <if test=" null != id ">
  21. and `id` like concat('%', #{id},'%')
  22. </if>
  23. <if test=" null != ids ">
  24. and id in
  25. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  26. #{idItem}
  27. </foreach>
  28. </if>
  29. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  30. </sql>
  31. <select id="findList" parameterType="com.iformall.domain.po.MallUserRole" resultMap="BaseResultMap">
  32. select <include refid="allColumns" /> from mall_user_role
  33. <include refid="dynamicWhereConditions" />
  34. </select>
  35. <delete id="deleteByUserId">
  36. delete from mall_user_role where uid=#{userId}
  37. </delete>
  38. </mapper>