<?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.zhongzheng.modules.activity.mapper.ActivityConfigurationUseMapper">

    <resultMap type="com.zhongzheng.modules.activity.domain.ActivityConfigurationUse" id="ActivityConfigurationUseResult">
        <result property="userId" column="user_id"/>
        <result property="configurationId" column="configuration_id"/>
        <result property="activityType" column="activity_type"/>
        <result property="use" column="use"/>
        <result property="createTime" column="create_time"/>
    </resultMap>

    <select id="queryByUse" parameterType="com.zhongzheng.modules.activity.bo.ActivityConfigurationUseAddBo" resultType="int">
        select COUNT(user_id) FROM activity_configuration_use where 1=1
        and user_id=#{userId}
    </select>

    <select id="countConfig" parameterType="map" resultType="int">
        select COUNT(user_id) FROM activity_configuration_use where 1=1
        and configuration_id = #{id}
    </select>
</mapper>