一条整的sql语句传入报错,想搞懂这个问题的原因,
方法:
public List<daily_defray_total> complexSqlQuery(String sql){
return ddtMapper.complexSqlQuery(sql);
}
这里传入整条sql:
String defrayTotalSql = " SELECT * FROM daily_defray_total "; List<daily_defray_total> dailyDefrayTotalList = dailyDefrayTotalMapper.complexSqlQuery(defrayTotalSql);
在xml文件里 ,1和2都试过
1
<select id="complexSqlQuery" resultMap="BaseResultMap"parameterType="String"> #{0}
</select>
2
<select id="complexSqlQuery" resultMap="BaseResultMap" parameterType="java.lang.String"> #{sql,jdbcType=VARCHAR}
</select>
报错
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' SELECT * FROM daily_defray_total '' at line 1
元芳怎么了
largeQ