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

74 строки
2.5 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.WxMsgLimitMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxMsgLimit">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="type" jdbcType="TINYINT" property="type"/>
  8. <result column="limit_id" jdbcType="VARCHAR" property="limitId"/>
  9. <result column="limit_num" jdbcType="INTEGER" property="limitNum"/>
  10. <result column="limit_date" jdbcType="TIMESTAMP" property="limitDate"/>
  11. </resultMap>
  12. <sql id="allColumns">
  13. `id`,`tenant_id`,`type`,`limit_id`,`limit_num`,`limit_date`
  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 != tenantId ">
  21. and `tenant_id`=#{tenantId}
  22. </if>
  23. <if test=" null != type ">
  24. and `type` = #{type}
  25. </if>
  26. <if test=" null != limitId ">
  27. and `limit_id` = #{limitId}
  28. </if>
  29. <if test=" null != limitNum ">
  30. and `limitNum` = #{limitNum}
  31. </if>
  32. <if test=" null != limitDate ">
  33. and `limit_date` = #{limitDate}
  34. </if>
  35. <if test=" null != expireDate ">
  36. and `limit_date` > #{expireDate}
  37. </if>
  38. <if test=" null != ids ">
  39. and id in
  40. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  41. #{idItem}
  42. </foreach>
  43. </if>
  44. <if test=" null != sortColumns">order by ${sortColumns}</if>
  45. </sql>
  46. <select id="findList" parameterType="com.iformall.domain.po.WxMsgLimit" resultMap="BaseResultMap">
  47. select
  48. <include refid="allColumns"/>
  49. from wx_msg_limit
  50. <include refid="dynamicWhereConditions"/>
  51. </select>
  52. <update id="updateLimitNum" parameterType="com.iformall.domain.po.WxMsgLimit">
  53. update wx_msg_limit set limit_num = limit_num - 1 where `id` = #{id} and `tenant_id` = #{tenantId} and limit_num > 0
  54. </update>
  55. <delete id="delLimitNum" parameterType="com.iformall.domain.po.WxMsgLimit">
  56. delete from wx_msg_limit
  57. where `tenant_id` = #{tenantId} and `type`= #{type} and `limit_id` = #{limitId}
  58. </delete>
  59. </mapper>