<?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.ozs.pm.mapper.PmDemandExpertRefMapper">

    <select id="selectByExpertId" resultType="java.lang.Integer" parameterType="java.lang.Integer">
        select demand_id from pm_demand_expert_ref where expert_id = #{expertId}
    </select>
    <select id="getPmBaseExpertResVoList" resultType="com.ozs.pm.doman.vo.responseVo.PmBaseExpertResVo">
        SELECT
        t.demand_id as demandId,
        DATE_FORMAT(t.access_time,'%Y-%m-%d') accessTime,
        count(1) expertCount
        from pm_demand_expert_ref t
        where t.demand_id = #{demandId}
        group by accessTime
        order by accessTime desc
    </select>

</mapper>
