Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 

69 строки
2.4 KiB

  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.WxLevelConfigMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxLevelConfig">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="points" jdbcType="INTEGER" property="points"/>
  7. <result column="level" jdbcType="VARCHAR" property="level"/>
  8. <result column="description" jdbcType="VARCHAR" property="description"/>
  9. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  10. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  11. </resultMap>
  12. <sql id="allColumns">
  13. `id`,`points`,`level`,`description`,`create_date`,`tenant_id`
  14. </sql>
  15. <sql id="dynamicWhereConditions">
  16. where 1 = 1
  17. <if test=" null != id ">
  18. and `id` = #{id}
  19. </if>
  20. <if test=" null != points ">
  21. and `points` = #{points}
  22. </if>
  23. <if test=" null != level ">
  24. and `level` like concat('%', #{level},'%')
  25. </if>
  26. <if test=" null != description ">
  27. and `description` like concat('%', #{description},'%')
  28. </if>
  29. <if test=" null != createDate ">
  30. and `create_date` = #{createDate}
  31. </if>
  32. <if test=" null != tenantId ">
  33. and `tenant_id` = #{tenantId}
  34. </if>
  35. <if test=" null != ids ">
  36. and id in
  37. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  38. #{idItem}
  39. </foreach>
  40. </if>
  41. <if test=" null != sortColumns">order by ${sortColumns}</if>
  42. </sql>
  43. <select id="findList" parameterType="com.iformall.domain.po.WxLevelConfig" resultMap="BaseResultMap">
  44. select
  45. <include refid="allColumns"/>
  46. from wx_level_config
  47. <include refid="dynamicWhereConditions"/>
  48. </select>
  49. <delete id="deleteAll" parameterType="com.iformall.domain.po.WxLevelConfig">
  50. delete from wx_level_config where `tenant_id` = #{tenantId};
  51. </delete>
  52. <select id="getLevel" parameterType="com.iformall.domain.po.WxLevelConfig" resultType="String">
  53. SELECT `level` FROM `wx_level_config` where tenant_id=#{tenantId} and points &lt;= #{points} ORDER BY points desc LIMIT 1
  54. </select>
  55. </mapper>