|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.iformall.mapper.WxMsgConfigMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxMsgConfig">
- <id column="id" jdbcType="BIGINT" property="id" />
- <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
- <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
- <result column="secret" jdbcType="VARCHAR" property="secret" />
- <result column="publickey" jdbcType="VARCHAR" property="publickey" />
- <result column="bid" jdbcType="VARCHAR" property="bid" />
- <result column="recharge" jdbcType="BIGINT" property="recharge" />
- <result column="remains" jdbcType="BIGINT" property="remains" />
- <result column="total" jdbcType="BIGINT" property="total" />
- <result column="account" jdbcType="VARCHAR" property="account" />
- <result column="reminderstatus" jdbcType="INTEGER" property="reminderstatus" />
- <result column="reminder" jdbcType="BIGINT" property="reminder" />
- <result column="phone" jdbcType="VARCHAR" property="phone" />
- <result column="notifyurl" jdbcType="VARCHAR" property="notifyurl" />
- <result column="modelnotifyurl" jdbcType="VARCHAR" property="modelnotifyurl" />
- <result column="verifynotifyurl" jdbcType="VARCHAR" property="verifynotifyurl" />
- <!-- <result column="appid" jdbcType="VARCHAR" property="appid" />-->
- <result column="sms_channel" jdbcType="SMALLINT" property="smsChannel" />
-
- <result column="product" jdbcType="VARCHAR" property="product" />
- <result column="domain" jdbcType="VARCHAR" property="domain" />
- <result column="region_id" jdbcType="VARCHAR" property="regionId" />
- <result column="endpoint_name" jdbcType="VARCHAR" property="endpointName" />
-
- </resultMap>
-
- <sql id="allColumns">
- `id`,`tenant_id`,`parent_tenant_id`,`secret`,`publickey`,`bid`,`recharge`,`remains`,`total`,`account`,
- `reminderstatus`,`reminder`,`phone`,`notifyurl`,`modelnotifyurl`,`verifynotifyurl`,`sms_channel`,
- `product`,`domain`,`region_id`,`endpoint_name`
- </sql>
-
- <sql id="dynamicWhereConditions">
- where 1 = 1
-
- <if test=" null != id ">
- and `id` = #{id}
-
- </if>
-
- <if test=" null != tenantId and '' != tenantId">
- and `tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and `parent_tenant_id` = #{parentTenantId}
- </if>
-
- <if test=" null != secret ">
- and `secret` like concat('%', #{secret},'%')
-
- </if>
-
- <if test=" null != publickey ">
- and `publickey` like concat('%', #{publickey},'%')
-
- </if>
-
- <if test=" null != bid ">
- and `bid` = #{bid}
-
- </if>
-
- <if test=" null != recharge ">
- and `recharge` = #{recharge}
-
- </if>
-
- <if test=" null != remains ">
- and `remains` = #{remains}
-
- </if>
-
- <if test=" null != total ">
- and `total` = #{total}
-
- </if>
-
- <if test=" null != account ">
- and `account` like concat('%', #{account},'%')
-
- </if>
-
- <if test=" null != reminderstatus ">
- and `reminderstatus` = #{reminderstatus}
-
- </if>
-
- <if test=" null != reminder ">
- and `reminder` = #{reminder}
-
- </if>
-
- <if test=" null != phone ">
- and `phone` like concat('%', #{phone},'%')
-
- </if>
-
- <if test=" null != notifyurl ">
- and `notifyurl` like concat('%', #{notifyurl},'%')
-
- </if>
-
- <if test=" null != smsChannel ">
- and `sms_channel` = #{smsChannel}
-
- </if>
-
- <if test=" null != ids ">
- and id in
- <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- <if test=" null != sortColumns"> order by ${sortColumns} </if>
- </sql>
-
- <select id="findList" parameterType="com.iformall.domain.po.WxMsgConfig" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from wx_msg_config
- <include refid="dynamicWhereConditions" />
- </select>
-
- <update id="updateRemains" parameterType="com.iformall.domain.po.WxMsgConfig">
- update wx_msg_config set remains = if(remains - #{remains} < 0,0,remains - #{remains})
- where 1=1
- <if test=" null != tenantId and '' != tenantId">
- and `tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and `parent_tenant_id` = #{parentTenantId}
- </if>
- </update>
-
-
-
-
- </mapper>
|