相当于以下SQL:
SELECT
t.NAME AS companyName,
t1.NAME AS farmName,
t1.address AS farmAddress,
t.culture_count,
t.farm_month,
t.livestock_count,
t.male_cow,
t.mother_cow,
t.remark
-- (SELECT MAX(farm_month) FROM lsd_company) AS farmMonth
FROM
lsd_company t
LEFT JOIN lsd_farm t1 ON (
t1.id = t.farm_id
AND t1.deleted = 0
)
AND t1.tenant_id = 1
WHERE
t.farmmonth = **(SELECT MAX(farm_month) FROM lsdcompany)** AND
t.deleted = 0
AND t.tenant_id = 1
ORDER BY
t.id DESC
报错信息
nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='ew.paramNameValuePairs.MPGENVAL1', mode=IN, javaType=class java.lang.Object, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #1 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #1 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.sql.SQLException: Cannot convert class cn.iocoder.yudao.framework.mybatis.core.query.MPJLambdaWrapperX to SQL type requested due to com.mysql.cj.exceptions.WrongArgumentException - Invalid argument value: java.io.NotSerializableException
当前使用版本(必填,否则不予处理)
1.4.10
该问题是如何引起的?(确定最新版也有问题再提!!!)
where后面加了一个子查询
重现步骤(如果有就写完整)
default List getCompanyList() {
MPJLambdaWrapperX query = new MPJLambdaWrapperX();
相当于以下SQL: SELECT t.NAME AS companyName, t1.NAME AS farmName, t1.address AS farmAddress, t.culture_count, t.farm_month, t.livestock_count, t.male_cow, t.mother_cow, t.remark -- (SELECT MAX(farm_month) FROM lsd_company) AS farmMonth FROM lsd_company t LEFT JOIN lsd_farm t1 ON ( t1.id = t.farm_id AND t1.deleted = 0 ) AND t1.tenant_id = 1 WHERE t.farmmonth = **(SELECT MAX(farm_month) FROM lsdcompany)** AND t.deleted = 0 AND t.tenant_id = 1 ORDER BY t.id DESC
报错信息
nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='ew.paramNameValuePairs.MPGENVAL1', mode=IN, javaType=class java.lang.Object, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #1 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #1 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.sql.SQLException: Cannot convert class cn.iocoder.yudao.framework.mybatis.core.query.MPJLambdaWrapperX to SQL type requested due to com.mysql.cj.exceptions.WrongArgumentException - Invalid argument value: java.io.NotSerializableException