mapper.xml
<mapper namespace="com.xmeport.web.mapper.nexpmanageplat.EhsEntryHeadMapper">
<select id="getStatisticsPage" parameterType="com.xmeport.web.model.vo.nexpmanageplat.EhsEntryHeadVO" resultType="com.xmeport.web.model.vo.nexpmanageplat.EhsEntryHeadVO">
select t.bill_no,
count(t.ass_bill_no) as assBillNum,
count(decode(t.non_trade_check, 'Y', 1, null)) as nonTradeNum,
count(decode(t.new_express_check, 'Y', 1, null)) as newExpressNum,
count(decode(t.ct_check, 'Y', 1, null)) as ctNum,
count(decode(t.real_time_check, 'Y', 1, null)) as realTimeNum,
count(decode(t.review_check, 'Y', 1, null)) as reviewNum,
min(t.agent_name) as agentName
from EHS_ENTRY_HEAD t
where t.check_status='W'
<if test="ehsEntryHeadVO.billNo != null and ehsEntryHeadVO.billNo != ''">
and t.bill_no = #{ehsEntryHeadVO.billNo}
</if>
<if test="ehsEntryHeadVO.agentName != null and ehsEntryHeadVO.agentName != ''">
and instr(t.agent_name, #{ehsEntryHeadVO.agentName}) > 0
</if>
<if test="ehsEntryHeadVO.machineStartDate != null">
and t.machine_date >= to_date(to_char(#{ehsEntryHeadVO.machineStartDate,jdbcType=DATE},'yyyy-MM-dd hh24:mi:ss'),'yyyy-MM-dd hh24:mi:ss')
</if>
<if test="ehsEntryHeadVO.machineEndDate != null">
<![CDATA[ and t.machine_date < to_date(to_char(#{ehsEntryHeadVO.machineEndDate,jdbcType=DATE},'yyyy-MM-dd hh24:mi:ss'),'yyyy-MM-dd hh24:mi:ss')+1 ]]>
</if>
group by t.bill_no
</select>
</mapper>
mapper 接口
IPage<Map<String,Object>> getStatisticsPage(IPage<Map<String,Object>> page,
EhsEntryHeadVO ehsEntryHeadVO);