SSM, an entire sql statement is passed in to report an error.

A whole sql statement is passed in to report an error. If you want to understand the cause of this problem,

method:

public List < daily_defray_total > complexSqlQuery (String sql) {
return ddtMapper.complexSqlQuery (sql);
}

pass in the whole sql: here

String defrayTotalSql = " SELECT * FROM daily_defray_total ";
    List<daily_defray_total> dailyDefrayTotalList = dailyDefrayTotalMapper.complexSqlQuery(defrayTotalSql);



in the xml file, both 1 and 2 have tried
1
< select id= "complexSqlQuery" resultMap= "BaseResultMap" parameterType= "String" >-sharp {0}
< / select >

2
< select id= "complexSqlQuery" resultMap= "BaseResultMap" parameterType= "java.lang.String" >-sharp {sql,jdbcType=VARCHAR}
< / select >

error

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

is it really a grammatical error, or is it not introduced at all

Ssm
Mar.05,2021

The

SQL statement does not use the * sign, but the field of the table,
String defrayTotalSql = "SELECT u_id FROM daily_defray_total";

< select id= "complexSqlQuery" resultMap= "BaseResultMap" parameterType= "String" >
${value}
< / select >


1. I haven't seen the parameter type is String,. It seems that there is only java.lang.String.
2. Pass a parameter you want to receive with a parameter.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36130-2b34a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36130-2b34a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?