mapper如下
<resultMap id="personWorkHourCountMap" type="com.supwisdom.core.att.vo.PersonWorkHourCountVo" >
<result column="personId" property="personId"/>
<result column="name" property="name"/>
<result column="stuempNo" property="stuempNo"/>
<result column="deptName" property="deptName"/>
<result column="workDays" property="workDays"/>
<result column="late" property="late"/>
<result column="leaveEarly" property="leaveEarly"/>
<result column="timeStart" property="timeStart"/>
<result column="timeEnd" property="timeEnd"/>
<collection property="attDayStartList" column="{personId=personId,timeStart=timeStart,timeEnd=timeEnd}" select="findByPersonId" />
</resultMap>
<select id="personWorkHourCount" resultMap="personWorkHourCountMap">
select aa.id personId,
( select t.name from tb_person t where t.id = aa.id ) name,
( select t1.stuemp_no from tb_person t1 where t1.id = aa.id ) stuempNo,
( select td.dept_name from tb_person t2, tb_dept td where t2.dept_id = td.dept_id and t2.id = aa.id ) deptName,
count( aa.id ) workDays,
#{attDayStartDto.timeStart} timeStart,#{attDayStartDto.timeEnd} timeEnd
from
(
select
tp.id,
tads.result
from
tb_att_day_stat tads,
tb_person tp
where
tp.id = tads.person_id
<if test="attDayStartDto.timeStart != null and attDayStartDto.timeStart != ''">
AND tads.att_date <![CDATA[ >= ]]> #{attDayStartDto.timeStart}
</if>
<if test="attDayStartDto.timeEnd != null and attDayStartDto.timeEnd != ''">
AND tads.att_date <![CDATA[ <= ]]> #{attDayStartDto.timeEnd}
</if>
<if test="attDayStartDto.deptId != null and attDayStartDto.deptId != ''">
AND tp.dept_id = #{attDayStartDto.deptId}
</if>
<if test="attDayStartDto.deptIds != null and attDayStartDto.deptIds != ''">
AND tp.dept_id in
<foreach collection="attDayStartDto.deptIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="attDayStartDto.stuempNo != null and attDayStartDto.stuempNo != ''">
AND tp.stuemp_no = #{attDayStartDto.stuempNo}
</if>
<if test="attDayStartDto.name != null and attDayStartDto.name != ''">
<bind name="name_" value="'%' + attDayStartDto.name + '%'" />
AND tp.name LIKE #{name_}
</if>
order by
tp.id
) aa
group by
aa.id
</select>
根据收集到的jdbc 协议发现
入参为
而server 到client 协议为
出入参内容不一致
按照现场的使用方式在本地搭建简化环境验证发现确实存才问题
猜测为绑定变量异常,使用纯jdbc 测试发现确实如此
发现此问题为gbase8s 数据库早期版本问题 ,现有版本均已修复