PushDetectionDataMapper.xml
904 Bytes
<?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.subsidy.mapper.PushDetectionDataMapper">
<select id="insertData">
insert into push_detection_data (class_id,check_type,member_id,create_date)
VALUES (#{classId}, #{checkType}, #{memberId}, #{createDate})
</select>
<select id="activityList" resultType="long">
SELECT
t2.id 活跃度id
FROM
activity_detection t2
LEFT JOIN push_detection_data t1 ON t1.class_id = t2.class_id
AND t1.member_id = t2.member_id
AND t1.create_date = t2.create_date
WHERE
t2.delete_date IS NULL
AND DATE_FORMAT( DATE_ADD( t2.create_date, INTERVAL 1 DAY ), '%Y-%m-%d' ) = DATE_FORMAT( NOW(), '%Y-%m-%d' )
AND t1.create_date IS NULL
</select>
</mapper>