No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 

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