一条整的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
添加回答
举报
0/150
提交
取消