mybatis 分组 group by
<sql id="selectSql">
<if test="orderState != null">
"ORDER_STATE" = #{orderState}
</if>
<if test="gameName != null and gameName!=''">
AND "GAME_NAME" = #{gameName}
</if>
<if test="statementStartTime != null">
<![CDATA[
AND "END_TIME" >= #{statementStartTime}
]]>
</if>
<if test="statementEndTime != null">
<![CDATA[
AND "END_TIME" <= #{statementEndTime}
]]>
</if>
</sql>
<!-- 查询符合条件的实体对象 -->
<select id="selectByGameProp" parameterType="map" resultMap="BaseResultMap" resultType="com.wzitech.gamegold.funds.entity.gameTradingEO">
SELECT SUM("TOTAL_PRICE")"ORDER_TOTAL", COUNT("ORDER_ID") "TRADING_NUM", SUM("TOTAL_PRICE")*#{disCount} "COMMISSION","GAME_NAME","REGION","SERVER"
FROM "TBL_GAMEGOLD_ORDERS"
<where>
<include refid="selectSql"/>
</where>
GROUP BY "GAME_NAME","REGION", "SERVER"
<if test="ORDERBY != null and ORDERBY != ''">
ORDER BY "${ORDERBY}"
</if>
<if test="ORDER != null and ORDER != ''">
${ORDER}
</if>
<if test="limit != null">
LIMIT #{limit}
</if>
<if test="start != null">
OFFSET #{start}
</if>
</select>
为什么一直报错, 说ERROR: column "TBL_GAMEGOLD_ORDERS.END_TIME" must appear in the GROUP BY clause or be used in an aggregate function
位置:364