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

137 строки
4.1 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.WxMsgConfigMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxMsgConfig">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
  7. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
  8. <result column="secret" jdbcType="VARCHAR" property="secret" />
  9. <result column="publickey" jdbcType="VARCHAR" property="publickey" />
  10. <result column="bid" jdbcType="VARCHAR" property="bid" />
  11. <result column="recharge" jdbcType="BIGINT" property="recharge" />
  12. <result column="remains" jdbcType="BIGINT" property="remains" />
  13. <result column="total" jdbcType="BIGINT" property="total" />
  14. <result column="account" jdbcType="VARCHAR" property="account" />
  15. <result column="reminderstatus" jdbcType="INTEGER" property="reminderstatus" />
  16. <result column="reminder" jdbcType="BIGINT" property="reminder" />
  17. <result column="phone" jdbcType="VARCHAR" property="phone" />
  18. <result column="notifyurl" jdbcType="VARCHAR" property="notifyurl" />
  19. <result column="modelnotifyurl" jdbcType="VARCHAR" property="modelnotifyurl" />
  20. <result column="verifynotifyurl" jdbcType="VARCHAR" property="verifynotifyurl" />
  21. <!-- <result column="appid" jdbcType="VARCHAR" property="appid" />-->
  22. <result column="sms_channel" jdbcType="SMALLINT" property="smsChannel" />
  23. </resultMap>
  24. <sql id="allColumns">
  25. `id`,`tenant_id`,`parent_tenant_id`,`secret`,`publickey`,`bid`,`recharge`,`remains`,`total`,`account`,
  26. `reminderstatus`,`reminder`,`phone`,`notifyurl`,`modelnotifyurl`,`verifynotifyurl`,`sms_channel`
  27. </sql>
  28. <sql id="dynamicWhereConditions">
  29. where 1 = 1
  30. <if test=" null != id ">
  31. and `id` = #{id}
  32. </if>
  33. <if test=" null != tenantId and '' != tenantId">
  34. and `tenant_id` = #{tenantId}
  35. </if>
  36. <if test=" null != parentTenantId and '' != parentTenantId">
  37. and `parent_tenant_id` = #{parentTenantId}
  38. </if>
  39. <if test=" null != secret ">
  40. and `secret` like concat('%', #{secret},'%')
  41. </if>
  42. <if test=" null != publickey ">
  43. and `publickey` like concat('%', #{publickey},'%')
  44. </if>
  45. <if test=" null != bid ">
  46. and `bid` = #{bid}
  47. </if>
  48. <if test=" null != recharge ">
  49. and `recharge` = #{recharge}
  50. </if>
  51. <if test=" null != remains ">
  52. and `remains` = #{remains}
  53. </if>
  54. <if test=" null != total ">
  55. and `total` = #{total}
  56. </if>
  57. <if test=" null != account ">
  58. and `account` like concat('%', #{account},'%')
  59. </if>
  60. <if test=" null != reminderstatus ">
  61. and `reminderstatus` = #{reminderstatus}
  62. </if>
  63. <if test=" null != reminder ">
  64. and `reminder` = #{reminder}
  65. </if>
  66. <if test=" null != phone ">
  67. and `phone` like concat('%', #{phone},'%')
  68. </if>
  69. <if test=" null != notifyurl ">
  70. and `notifyurl` like concat('%', #{notifyurl},'%')
  71. </if>
  72. <if test=" null != smsChannel ">
  73. and `sms_channel` = #{smsChannel}
  74. </if>
  75. <if test=" null != ids ">
  76. and id in
  77. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  78. #{idItem}
  79. </foreach>
  80. </if>
  81. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  82. </sql>
  83. <select id="findList" parameterType="com.iformall.domain.po.WxMsgConfig" resultMap="BaseResultMap">
  84. select
  85. <include refid="allColumns"/>
  86. from wx_msg_config
  87. <include refid="dynamicWhereConditions" />
  88. </select>
  89. <update id="updateRemains" parameterType="com.iformall.domain.po.WxMsgConfig">
  90. update wx_msg_config set remains = if(remains - #{remains} &lt; 0,0,remains - #{remains})
  91. where 1=1
  92. <if test=" null != tenantId and '' != tenantId">
  93. and `tenant_id` = #{tenantId}
  94. </if>
  95. <if test=" null != parentTenantId and '' != parentTenantId">
  96. and `parent_tenant_id` = #{parentTenantId}
  97. </if>
  98. </update>
  99. </mapper>