IDEA删除了.iml文件之后,IDE中显示项目错乱。
解决方法:
点击maven,点击刷新即可。
It's likely that neither a Result Type nor a Result Map was specified
这个问题发生在springboot+mybatis中,解析mapper文件时发现函数返回值没有设置。
修改方法举例:
<select id="count" parameterType="student">
select count(*) from t_student_info
</select>
错误原因是没有指定resultType返回参数类型
解决之后:
<select id="count" parameterType="student" resultType="count">
select count(*) from t_student_info
</select>
Springboot+mybatis中,sql 中 count(id)语句返回long型数据
解决方法:
函数声明:
//Dao层函数声明
Map<String, Object> getUpdateLogCnt(@Param("planid") Integer planid);
//mapper中sql
<select id="getUpdateLogCnt" resultType="java.util.Map">
SELECT COUNT(*) as cnt FROM t_log_upgrade WHERE planid = #{planid}
</select>
//service层调用
Map<String, Object> cnt = tposTaskMapper.getUpdateLogCnt(planid);
Long count = (Long)cnt.get("cnt");