ScrmBatchMomentMapper.xml 4.21 KB
<?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="cn.com.glsx.entmicro.mapper.ScrmBatchMomentMapper">
    <resultMap id="BaseResultMap" type="cn.com.glsx.entmicro.entity.wechatcloudcontrol.batchmoment.ScrmBatchMoment">
        <!--
          WARNING - @mbg.generated
        -->
        <id column="id" jdbcType="INTEGER" property="id"/>
        <result column="created_by" jdbcType="INTEGER" property="createdBy"/>
        <result column="created_time" jdbcType="TIMESTAMP" property="createdTime"/>
        <result column="updated_by" jdbcType="INTEGER" property="updatedBy"/>
        <result column="updated_time" jdbcType="TIMESTAMP" property="updatedTime"/>
        <result column="del_flag" jdbcType="TINYINT" property="delFlag"/>
        <result column="moment_name" jdbcType="VARCHAR" property="momentName"/>
        <result column="uuid" jdbcType="VARCHAR" property="uuid"/>
        <result column="send_type" jdbcType="INTEGER" property="sendType"/>
        <result column="send_time" jdbcType="TIMESTAMP" property="sendTime"/>
        <result column="send_status" jdbcType="INTEGER" property="sendStatus"/>
        <result column="status" jdbcType="INTEGER" property="status"/>
        <result column="err_msg" jdbcType="VARCHAR" property="errMsg"/>
        <result column="merchant_id" jdbcType="INTEGER" property="merchantId"/>
        <result column="merchant_name" jdbcType="VARCHAR" property="merchantName"/>
    </resultMap>

    <resultMap id="BaseResultMap1" type="cn.com.glsx.entmicro.model.response.wechatcloudcontrol.batchmoment.BatchMomentRpcResponse">
        <id column="id" jdbcType="INTEGER" property="id"/>
        <result column="created_by" jdbcType="INTEGER" property="createdBy"/>
        <result column="created_time" jdbcType="TIMESTAMP" property="createdTime"/>
        <result column="updated_by" jdbcType="INTEGER" property="updatedBy"/>
        <result column="updated_time" jdbcType="TIMESTAMP" property="updatedTime"/>
        <result column="del_flag" jdbcType="TINYINT" property="delFlag"/>
        <result column="moment_name" jdbcType="VARCHAR" property="momentName"/>
        <result column="uuid" jdbcType="VARCHAR" property="uuid"/>
        <result column="send_type" jdbcType="INTEGER" property="sendType"/>
        <result column="send_time" jdbcType="TIMESTAMP" property="sendTime"/>
        <result column="send_status" jdbcType="INTEGER" property="sendStatus"/>
        <result column="status" jdbcType="INTEGER" property="status"/>
        <result column="err_msg" jdbcType="VARCHAR" property="errMsg"/>
        <result column="merchant_id" jdbcType="INTEGER" property="merchantId"/>
        <result column="merchant_name" jdbcType="VARCHAR" property="merchantName"/>
        <result column="customerType" jdbcType="VARCHAR" property="merchantName"/>
    </resultMap>
    <sql id="Base_Column_List">
        id, created_by, created_time, updated_by, updated_time, del_flag, moment_name, uuid,
        send_type, send_time, send_status, `status`, err_msg, merchant_id, merchant_name
    </sql>
    <select id="batchMomentConditionPage" resultMap="BaseResultMap1">
        select
        <include refid="Base_Column_List"/>
        from scrm_batch_moment
        <where>
            del_flag=0
            <if test="condition != null">
                <if test="condition.sendType != null">
                    and send_type = #{condition.sendType}
                </if>
                <if test="condition.taskName !=null and condition.taskName != ''">
                    and moment_name like CONCAT('%',#{condition.taskName},'%')
                </if>
                <if test="condition.merchantName !=null and condition.merchantName != ''">
                    and merchant_name like CONCAT('%',#{condition.merchantName},'%')
                </if>
                <if test="condition.startTime != null">
                    and send_time <![CDATA[ >=]]> #{condition.startTime}
                </if>
                <if test="condition.endTime != null">
                    and send_time <![CDATA[ <=]]> #{condition.endTime}
                </if>
            </if>
        </where>
        order by created_time desc
    </select>
</mapper>