在mybatis中该sql语句有什么错误<select id="selectJourneyTempDetailListById" resultMap="JourneyTempDetailDtoResult"> select temp_day, GROUP_CONCAT(activity_id) activity_id, GROUP_CONCAT(address_type_cd) address_type_cd, GROUP_CONCAT(activity_type_cd) activity_type_cd, GROUP_CONCAT(presenter_type_cd) presenter_type_cd, from journey_temp_detail where temp_id = #{id} and is_del = '0' group by temp_day </select>
时间: 2024-03-02 17:52:16 浏览: 75
这个 SQL 语句中的错误是缺少了 `SELECT` 关键字。在 `from` 关键字前面应该加上需要查询的列名,比如 `SELECT temp_day, GROUP_CONCAT(activity_id) activity_id, ...`。修改后的 SQL 语句如下:
```xml
<select id="selectJourneyTempDetailListById" resultMap="JourneyTempDetailDtoResult">
SELECT
temp_day,
GROUP_CONCAT(activity_id) activity_id,
GROUP_CONCAT(address_type_cd) address_type_cd,
GROUP_CONCAT(activity_type_cd) activity_type_cd,
GROUP_CONCAT(presenter_type_cd) presenter_type_cd
FROM journey_temp_detail
WHERE temp_id = #{id} AND is_del = '0'
GROUP BY temp_day
</select>
```
注意,在 `WHERE` 子句中使用的参数 `id` 应该在 Java 代码中传入。
阅读全文