<?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="org.linlinjava.jz.db.dao.JzBuiltListCountMapper">
    <select id="campaignsCount" resultType="org.linlinjava.jz.db.domain.JzBuiltListCount">
        select cast(count(1) as char(10)) as count,b.name,b.id
                from jz_built_list a join jz_campaign b on a.campaign_id=b.id
                where a.user_id=#{userId,jdbcType=INTEGER} and a.next_call_time &lt; Now() and a.call_result &lt; 10
        group by b.name,b.id
    </select>
</mapper>