哥,你就不能把脚本放上来。你这样让我们怎么改?
===========
以MySQL为例-参考语法:
select * from where FROM_UNIXTIME(d.dt,"%Y%m") = DATE_FORMAT('${日期控件}',"%Y%m") -- 直接转换成年月相等;
====
SELECT
a.id AS pipeId,
a. NAME AS pipeName,
ifnull(SUM(d.`sumDayFlow`), 0) AS DayFlow,
ifnull(SUM(d.`sumFlow`), 0) AS `CountFlow`,
ifnull(SUM(d.`sumFlow`), 0) - ifnull(SUM(d.`sumDayFlow`), 0) AS NightFlow,
d.dt
FROM
`aws_tarch_pipe_info` a
LEFT JOIN `aws_tarch_client` b ON a.id = b.pipeId
LEFT JOIN `aws_tarch_cjq` c ON b.id = c.clientId
LEFT JOIN `aws_tarch_sign_day` d ON b.id = d.clientId
-- 直接转换成【年-月】相等
AND FROM_UNIXTIME(d.dt, "%Y-%m") = DATE_FORMAT('${日期控件}', "%Y-%m")
AND d.clientId = b.id
WHERE
a.type = 1
GROUP BY
a.id