404 Star 3.7K Fork 1.3K

GVP京东零售 / hotkey

 / 详情

KeyRecordMapper.statisticsByRule的SQL语法错误

已验收
缺陷
创建于  
2020-11-20 18:13

select列表中rule字段没有出现在分组中

<select id="statisticsByRule"  resultType="com.jd.platform.hotkey.dashboard.model.Statistics">
    select  count(1) as count, app_name as app, val as keyName, rule
    from  hk_key_record
    where type = 0
    <if test="app !=null and app !=''">
      and app_name = #{app}
    </if >
    <if test="key !=null and key !=''">
      and key_name = #{key}
    </if >
    <if test="startTime != null">
      <![CDATA[ and create_time >= #{startTime} and create_time < #{endTime}]]>
    </if>
    GROUP BY app_name, val order by null
  </select>

评论 (2)

kezihehe 创建了缺陷
展开全部操作日志

OK,等控制台开发解决

-- !!! 注意设置sql model 否则可能sql报错 !!!
-- 查询你的sql_model参数:select @@global.sql_mode; 发现ONLY_FULL_GROUP_BY 则会导致报错
-- 解决方式:set @@global.sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'
-- 详情查阅:https://www.cnblogs.com/hjhsblogs/p/11079356.html

kezihehe 任务状态待办的 修改为已验收

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(3)
303698 tianyalei 1578919857 5505436 tangboho 1650537196
Java
1
https://gitee.com/jd-platform-opensource/hotkey.git
git@gitee.com:jd-platform-opensource/hotkey.git
jd-platform-opensource
hotkey
hotkey

搜索帮助