You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

36 lines
1.9 KiB

<?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.epmet.dao.heart.IcUserDemandServiceDao">
<resultMap type="com.epmet.entity.heart.IcUserDemandServiceEntity" id="icUserDemandServiceMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="demandRecId" column="DEMAND_REC_ID"/>
<result property="serviceType" column="SERVICE_TYPE"/>
<result property="serverId" column="SERVER_ID"/>
<result property="serviceStartTime" column="SERVICE_START_TIME"/>
<result property="serviceEndTime" column="SERVICE_END_TIME"/>
<result property="finishDesc" column="FINISH_DESC"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="listDemandServeTimes" resultType="com.epmet.dto.heart.result.DemandServiceCountResultDTO">
select service.SERVER_ID, SERVICE_TYPE, count(1) as SERVE_TIMES
from ic_user_demand_rec damend
inner join ic_user_demand_service service on (damend.ID = service.DEMAND_REC_ID and service.DEL_FLAG = 0)
inner join volunteer_info v on (service.SERVER_ID = v.USER_ID and v.DEL_FLAG = 0)
where damend.DEL_FLAG = 0
and damend.STATUS = 'finished'
and damend.CUSTOMER_ID = #{customerId}
and service.SERVICE_END_TIME <![CDATA[<]]> #{endTime}
and service.SERVICE_TYPE = #{serviceType}
and v.GRID_ID = #{gridId}
group by service.SERVER_ID, SERVICE_TYPE
</select>
</mapper>