后台服务
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.

WxMsgConfigMapper.xml 4.5 KiB

2 yıl önce
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. <result column="product" jdbcType="VARCHAR" property="product" />
  24. <result column="domain" jdbcType="VARCHAR" property="domain" />
  25. <result column="region_id" jdbcType="VARCHAR" property="regionId" />
  26. <result column="endpoint_name" jdbcType="VARCHAR" property="endpointName" />
  27. </resultMap>
  28. <sql id="allColumns">
  29. `id`,`tenant_id`,`parent_tenant_id`,`secret`,`publickey`,`bid`,`recharge`,`remains`,`total`,`account`,
  30. `reminderstatus`,`reminder`,`phone`,`notifyurl`,`modelnotifyurl`,`verifynotifyurl`,`sms_channel`,
  31. `product`,`domain`,`region_id`,`endpoint_name`
  32. </sql>
  33. <sql id="dynamicWhereConditions">
  34. where 1 = 1
  35. <if test=" null != id ">
  36. and `id` = #{id}
  37. </if>
  38. <if test=" null != tenantId and '' != tenantId">
  39. and `tenant_id` = #{tenantId}
  40. </if>
  41. <if test=" null != parentTenantId and '' != parentTenantId">
  42. and `parent_tenant_id` = #{parentTenantId}
  43. </if>
  44. <if test=" null != secret ">
  45. and `secret` like concat('%', #{secret},'%')
  46. </if>
  47. <if test=" null != publickey ">
  48. and `publickey` like concat('%', #{publickey},'%')
  49. </if>
  50. <if test=" null != bid ">
  51. and `bid` = #{bid}
  52. </if>
  53. <if test=" null != recharge ">
  54. and `recharge` = #{recharge}
  55. </if>
  56. <if test=" null != remains ">
  57. and `remains` = #{remains}
  58. </if>
  59. <if test=" null != total ">
  60. and `total` = #{total}
  61. </if>
  62. <if test=" null != account ">
  63. and `account` like concat('%', #{account},'%')
  64. </if>
  65. <if test=" null != reminderstatus ">
  66. and `reminderstatus` = #{reminderstatus}
  67. </if>
  68. <if test=" null != reminder ">
  69. and `reminder` = #{reminder}
  70. </if>
  71. <if test=" null != phone ">
  72. and `phone` like concat('%', #{phone},'%')
  73. </if>
  74. <if test=" null != notifyurl ">
  75. and `notifyurl` like concat('%', #{notifyurl},'%')
  76. </if>
  77. <if test=" null != smsChannel ">
  78. and `sms_channel` = #{smsChannel}
  79. </if>
  80. <if test=" null != ids ">
  81. and id in
  82. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  83. #{idItem}
  84. </foreach>
  85. </if>
  86. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  87. </sql>
  88. <select id="findList" parameterType="com.iformall.domain.po.WxMsgConfig" resultMap="BaseResultMap">
  89. select
  90. <include refid="allColumns"/>
  91. from wx_msg_config
  92. <include refid="dynamicWhereConditions" />
  93. </select>
  94. <update id="updateRemains" parameterType="com.iformall.domain.po.WxMsgConfig">
  95. update wx_msg_config set remains = if(remains - #{remains} &lt; 0,0,remains - #{remains})
  96. where 1=1
  97. <if test=" null != tenantId and '' != tenantId">
  98. and `tenant_id` = #{tenantId}
  99. </if>
  100. <if test=" null != parentTenantId and '' != parentTenantId">
  101. and `parent_tenant_id` = #{parentTenantId}
  102. </if>
  103. </update>
  104. </mapper>