报错信息:
Type handler was null on parameter mapping for property 'height[0]'. It was either not specified and/or could not be found for the javaType ([Ljava.lang.Double;) : jdbcType (null) combination.
报错场景:
<select id="selectPageV2"
parameterType="cn.iocoder.yudao.module.matchmaker.controller.admin.infrainfo.vo.InfrainfoPageReqVO"
resultType="cn.iocoder.yudao.module.matchmaker.controller.admin.infrainfo.vo.InfrainfoRespVO">
SELECT
b.id,
b.realname,
b.mobile,
b.user_id,
b.wxno,
b.birthday,
b.sex,
b.nation,
b.height,
b.weight,
b.marriage_history,
b.educational,
b.current_residence,
b.birthplace,
b.last_time,
b.auth,
b.create_time
FROM
matchmaker_collection a LEFT JOIN matchmaker_infrainfo b ON a.collection_id = b.id
<where>
<if test="userId !=null"> and a.user_id = #{userId}</if>
<if test="sex !=null"> and b.sex = #{sex}</if>
<if test="currentResidence !=null"> and b.current_residence = #{currentResidence}</if>
<if test="birthday !=null"> and b.birthday between #{birthday[0]} and #{birthday[1]}</if>
<if test="height !=null and height.length==2" > and b.height between #{height[0]} and #{height[1]}</if>
<if test="educational !=null "> and b.educational = #{educational}</if>
<if test="marriageHistory !=null"> and b.marriage_history = #{marriageHistory}</if>
and b.deleted = 0
</where>
在<if test="birthday !=null"> and b.birthday between #{birthday[0]} and #{birthday[1]}</if>中没有指定javaType的类型。
解决报错:
<if test="birthday !=null"> and b.birthday between #{birthday[0],javaType=java.time.LocalDate} and #{birthday[1],javaType=java.time.LocalDate}</if>
<if test="height !=null and height.length==2" > and b.height between #{height[0],javaType=Double} and #{height[1],javaType=Double}</if>