|
@@ -1,30 +1,46 @@
|
|
|
<?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.tzld.piaoquan.growth.common.dao.mapper.ext.WeComUserMapperExt">
|
|
|
- <resultMap id="BaseResultMap" type="com.tzld.piaoquan.growth.common.model.po.WeComUser">
|
|
|
- <id column="id" jdbcType="BIGINT" property="id" />
|
|
|
- <result column="corp_id" jdbcType="BIGINT" property="corpId" />
|
|
|
- <result column="external_user_id" jdbcType="VARCHAR" property="externalUserId" />
|
|
|
- <result column="union_id" jdbcType="VARCHAR" property="unionId" />
|
|
|
- <result column="external_user_id_3rd_party" jdbcType="VARCHAR" property="externalUserId3rdParty" />
|
|
|
- <result column="type" jdbcType="INTEGER" property="type" />
|
|
|
- <result column="name" jdbcType="VARCHAR" property="name" />
|
|
|
- <result column="avatar" jdbcType="VARCHAR" property="avatar" />
|
|
|
- <result column="gender" jdbcType="INTEGER" property="gender" />
|
|
|
- <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
|
|
|
- <result column="group_msg_disabled" jdbcType="TINYINT" property="groupMsgDisabled" />
|
|
|
- <result column="created_at" jdbcType="BIGINT" property="createdAt" />
|
|
|
- <result column="updated_at" jdbcType="BIGINT" property="updatedAt" />
|
|
|
- <result column="deleted_at" jdbcType="BIGINT" property="deletedAt" />
|
|
|
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
- <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
|
|
- </resultMap>
|
|
|
|
|
|
- <select id="getGroupSendUserByDate" resultMap="BaseResultMap">
|
|
|
- select wcu.*
|
|
|
+ <select id="countGroupSendUserByDate" resultType="java.lang.Integer">
|
|
|
+ select count(1)
|
|
|
from we_com_user wcu
|
|
|
- join we_com_send_message wcsm on wcsm.user_id = wcu.id
|
|
|
+ join we_com_send_msg_result wcsmr on wcsmr.user_id = wcu.id
|
|
|
+ join we_com_special_send_message wcssm on wcssm.user_id = wcsmr.user_id and wcssm.staff_id = wcsmr.staff_id
|
|
|
+ join we_com_staff wcs on wcs.id = wcssm.staff_id
|
|
|
where wcu.group_msg_disabled > 0
|
|
|
- and wcsm.create_time between #{start} and #{end}
|
|
|
+ and wcssm.is_send = 1
|
|
|
+ and wcsmr.create_time between #{start} and #{end}
|
|
|
+ and wcssm.pre_send_date = #{preSendDate}
|
|
|
+ <if test="carrierIds != null and carrierIds.size() > 0">
|
|
|
+ and wcs.carrier_id in
|
|
|
+ <foreach collection="carrierIds" item="item" index="index" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getGroupSendUserByDate" resultType="com.tzld.piaoquan.growth.common.model.vo.WeComUserVo">
|
|
|
+ select wcu.corp_id as corpId, wcu.external_user_id as externalUserId, wcu.union_id as unionId,
|
|
|
+ wcu.external_user_id_3rd_party as externalUserId3rdParty, wcu.type as type, wcu.name as name,
|
|
|
+ wcu.avatar as avatar, wcu.gender as gender, wcs.carrier_id as carrierId, wcsmr.status as status,
|
|
|
+ wcsmr.send_time as sendTime
|
|
|
+ from we_com_user wcu
|
|
|
+ join we_com_send_msg_result wcsmr on wcsmr.user_id = wcu.id
|
|
|
+ join we_com_special_send_message wcssm on wcssm.user_id = wcsmr.user_id and wcssm.staff_id = wcsmr.staff_id
|
|
|
+ join we_com_staff wcs on wcs.id = wcssm.staff_id
|
|
|
+ where wcu.group_msg_disabled > 0
|
|
|
+ and wcssm.is_send = 1
|
|
|
+ and wcsmr.create_time between #{start} and #{end}
|
|
|
+ and wcssm.pre_send_date = #{preSendDate}
|
|
|
+ <if test="carrierIds != null and carrierIds.size() > 0">
|
|
|
+ and wcs.carrier_id in
|
|
|
+ <foreach collection="carrierIds" item="item" index="index" open="(" close=")" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="pageSize != null and pageSize > 0">
|
|
|
+ limit #{offset}, #{pageSize}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
</mapper>
|