//mapper.xml
<select id="queryWx1" resultMap="BaseResultMap" parameterType="com.run.rsis.specialsubject.entity.Wx1Entity">
select * from wx1 t1
<where>
<if test="id !=null">and t1.id =#{id}</if>
<if test="type !=null">and t1.type =#{type}</if>
<if test="value !=null">and t1.value =#{value}</if>
</where>
order by id
</select>
//在Controller中
wx1EntityDao.queryWx1(wx1Entity);有结果 使用PageHelper.startPage(currentPage, pageSize); PageInfo<Wx1Entity> pageInfo = new PageInfo<>(wx1EntityMapper.queryWx1(wx1Entity));时报错 ### SQL: SELECT * FROM ( SELECT TMP_PAGE.*, ROWNUM ROW_ID FROM ( select * from wx1 t1 WHERE t1.type =? and t1.value =? order by id ) TMP_PAGE) WHERE ROW_ID <= ? AND ROW_ID > ? ### Cause: java.sql.SQLSyntaxErrorException: Every derived table must have its own alias ; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: Every derived table must have its own alias] with root cause java.sql.SQLSyntaxErrorException: Every derived table must have its own alias
pardon110