|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <?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.WxMsgCallbackMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxMsgCallback">
- <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="batch_no" jdbcType="VARCHAR" property="batchNo" />
- <result column="phone" jdbcType="VARCHAR" property="phone" />
- <result column="begintime" jdbcType="INTEGER" property="begintime" />
- <result column="endtime" jdbcType="INTEGER" property="endtime" />
- <result column="status" jdbcType="INTEGER" property="status" />
- <result column="status_msg" jdbcType="VARCHAR" property="statusMsg" />
- <result column="sign" jdbcType="VARCHAR" property="sign" />
- <result column="createtime" jdbcType="TIMESTAMP" property="createtime" />
- <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" />
- <result column="callback_id" jdbcType="BIGINT" property="callbackId" />
- <result column="msg_id" jdbcType="BIGINT" property="msgId" />
- <result column="business_id" jdbcType="BIGINT" property="businessId"/>
-
- </resultMap>
-
- <sql id="allColumns">
- `id`,`tenant_id`,`parent_tenant_id`,`batch_no`,`phone`,`begintime`,`endtime`,`status`,`status_msg`,`sign`,`createtime`,`updatetime`,`msg_id`,`callback_id`,`business_id`
- </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 != batchNo ">
- and `batch_no` like concat('%', #{batchNo},'%')
-
- </if>
-
- <if test=" null != phone and phone!=''">
- and `phone` like concat('%', #{phone},'%')
-
- </if>
-
- <if test=" null != begintime ">
- and `begintime` = #{begintime}
-
- </if>
-
- <if test=" null != endtime ">
- and `endtime` = #{endtime}
-
- </if>
-
- <if test=" null != status ">
- and `status` = #{status}
-
- </if>
-
- <if test=" null != statusMsg ">
- and `status_msg` like concat('%', #{statusMsg},'%')
-
- </if>
-
- <if test=" null != sign ">
- and `sign` like concat('%', #{sign},'%')
-
- </if>
-
- <if test=" null != createtime ">
- and `createtime` = #{createtime}
-
- </if>
- <if test="createStartTime != null">
- AND `createtime` >= #{createStartTime}
- </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.WxMsgCallback" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from wx_msg_callback
- <include refid="dynamicWhereConditions" />
- </select>
-
-
- <select id="queryCallbackByBatchNoAndPhone" parameterType="com.iformall.domain.po.WxMsgCallback"
- resultMap="BaseResultMap">
- select * from wx_msg_callback where batch_no=#{batchNo} and phone=#{phone}
- </select>
-
-
- <select id="queryMsgSendTotal" parameterType="hashmap" resultType="int">
- select count(*) from wx_msg_callback where msg_id=#{msgId} and status=#{status}
- </select>
-
- <update id="updateByBatchNo" parameterType="com.iformall.domain.po.WxMsgCallback">
- update wx_msg_callback set status=#{status},status_msg=#{statusMsg} where `batch_no` = #{batchNo}
- </update>
-
- </mapper>
|