WeCustomerMessageOriginalMapper.xml 2.32 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="com.linkwechat.wecom.mapper.WeCustomerMessageOriginalMapper">
    <select id="selectCustomerMessagePushs" resultType="com.linkwechat.wecom.domain.vo.CustomerMessagePushVo">
        SELECT
        wcmo.push_type,
        wcmo.message_type,
        wcmo.push_range,
        wcm.create_by sender,
        wcmo.create_time sendTime,
        wcm.message_id,
        wcm.content,
        wcm.chat_type,
        wcm.setting_time,
        wcm.expect_send,
        wcm.actual_send,
        wcm.timed_task,
        wcm.msgid
        FROM
        we_customer_messageOriginal wcmo
        LEFT JOIN we_customer_message wcm ON wcmo.message_original_Id = wcm.original_id
        <where>
            <if test="content!=null and content!=''">
                AND wcm.content LIKE CONCAT('%',#{content},'%')
            </if>
            <if test="pushType!=null and pushType!=''">
                AND wcmo.push_type=#{pushType}
            </if>
            <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
                AND date_format(wcmo.create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
            </if>

            <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
                AND date_format(wcmo.create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
            </if>
            <if test="sender!=null and sender!=''">
                AND wcm.create_by=#{sender}
            </if>
        </where>
    </select>
    <select id="findCustomerMessagePushDetail"
            resultType="com.linkwechat.wecom.domain.vo.CustomerMessagePushVo">
        SELECT
        wcmo.push_type,
        wcmo.message_type,
        wcmo.push_range,
        wcm.create_by sender,
        wcmo.create_time sendTime,
        wcm.message_id,
        wcm.content,
        wcm.msgid,
        wcm.chat_type,
        wcm.setting_time,
        wcm.expect_send,
        wcm.actual_send,
        wcm.timed_task
        FROM
        we_customer_messageOriginal wcmo
        LEFT JOIN we_customer_message wcm ON wcmo.message_original_Id = wcm.original_id
        <where>
            wcm.message_id=#{messageId}
        </where>
    </select>
</mapper>