<?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.yifu.cloud.plus.v1.yifu.social.mapper.TSocialWarnMapper">

	<select id="getSocialAlertToWx"  resultType="com.yifu.cloud.plus.v1.yifu.social.vo.TSocialAlert">
		select
		       d.CREATE_BY createBy,d.CREATE_NAME createName
		     ,sum(if(d.SOCIAL_HANDLE_STATUS in ('2','3'),1,0)) socialNum
		     ,sum(if(d.FUND_HANDLE_STATUS = '2',1,0)) fundNum
		from t_dispatch_info d
		where d.CREATE_TIME >= CONCAT(DATE_SUB(CURDATE(), INTERVAL 1 DAY), ' 00:00:00')
		and d.CREATE_TIME <![CDATA[ <= ]]> CONCAT(CURDATE(), ' 00:00:00')
		and (d.SOCIAL_HANDLE_STATUS in ('2','3') or d.FUND_HANDLE_STATUS = '2')
		GROUP BY d.CREATE_BY
	</select>

</mapper>
