1.mapperExt.java中定义的方法:
List<EvidenceOppugnCount> countByTypeUserIdList(@Param(value = "caseId") Long caseId,
@Param(value = "list") List<Long> userIdList,
@Param(value = "refId") Long refId, @Param(value = "type") String type);
2.mapperExt.xml中对应的方法:
<select id="countByTypeUserIdList" resultMap="evidenceOppugnCountMap">
select type,
refid ,
count(distinct case when user_id in
<foreach collection="list" item="userid" index="index"
open="(" close=")" separator=",">
#{userid}
</foreach>
then concat(type,refid,user_id) end) as iAnswerCount,
count(distinct case when user_id not in
<foreach collection