<?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.tangguo.mapper.BbsPointsSettingMapper">
	
	<select id="selectPointsCount" resultType="java.lang.Integer">
		SELECT
			COUNT(*)
		FROM
			bbs_user_points_detail
		WHERE
			user_name = #{userName}
		AND
			detail_code = #{operateCode}
		AND
			create_time >= DATE_SUB(CURRENT_TIMESTAMP(), INTERVAL #{days} DAY)
	</select>
	
</mapper>
