MYSQL:
1、报表需要展示连续每天的数据,但业务数据可能是间断的,故关联dim_date表,使日期连续
CREATE TABLE `dim_date` (
`date_key` int(11) NOT NULL,
`date_value` date DEFAULT NULL,
`week_in_year` int(11) DEFAULT NULL,
`week_in_month` int(11) DEFAULT NULL,
`month_number` int(11) DEFAULT NULL,
`quarter_number` int(11) DEFAULT NULL,
`day_in_year` int(11) DEFAULT NULL,
`day_in_month` int(11) DEFAULT NULL,
`year` int(11) DEFAULT NULL,
`month` int(11) DEFAULT NULL,
`day` int(11) DEFAULT NULL,
PRIMARY KEY (`date_key`),
KEY `date_value_idx` (`date_value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2、动态拼接年月日、然后分组
SELECT
<if test="type == 1">
DATE(CONCAT(d.YEAR, '-', d.MONTH, '-', d.DAY))
</if>
<if test="type == 2">
DATE(CONCAT(d.YEAR, '-', d.MONTH, '-1'))
</if>
<if test="type == 3">
DATE(CONCAT(d.YEAR, '-1-1'))
</if>
<if test="type == 4">
DATE(CONCAT(d.YEAR, '-', d.MONTH, '-', d.DAY))
</if>
AS statdate,
SUM(a.order_num) AS order_num,
SUM(a.amount) AS amount,
SUM(a.validincome) AS validincome
FROM
dim_date d LEFT JOIN s_orderscount_day a on d.date_value = a.stat_date
<if test="fcId=='' and groupId==null">
AND a.finance_category_id = -1
</if>
<if test="fcId!='' or groupId!=null">
AND a.finance_category_id != -1
</if>
<if test="channel != null and channel != '' ">
AND a.sale_channel= #{channel}
</if>
<if test="fcId != null and fcId != ''">
AND FIND_IN_SET(a.finance_category_id, #{fcId})
</if>
<if test="fcId!='' or groupId!=null">
LEFT JOIN products p
ON
a.finance_category_id = p.oldid and a.product_group_id = p.groupid
</if>
<if test="groupId != null and groupId != '' ">
AND a.finance_category_id != -1
AND p.groupid = #{groupId}
</if>
WHERE 1=1
AND d.date_value <![CDATA[>=]]> #{startTime}
AND d.date_value <![CDATA[<=]]> #{endTime}
GROUP BY
statdate
相关推荐
使用java8+springboot+mybatis生成日期维度数据,项目下载到本地导入idea即可使用
SSAS Analyzer报表常用到的日期条件简版Dim_Date表结构。
这有两个文件,分别为inception_v3_weights_tf_dim_ordering_tf_kernels.h5, inception_v3_weights_tf_dim_ordering_tf_kernels_notop.h5
inception_v3_weights_tf_dim_ordering_tf_kernels_notop.h5 可用于keras,tensorflow.keras,特征提取与迁移学习
deeplabv3_mobilenetv2_tf_dim_ordering_tf_kernels 预训练模型
inception_v3_weights_tf_dim_ordering_tf_kernels_notop_update Linux下是放在“~/.keras/models/”中 Win下则放在Python的“settings/.keras/models/”中 Windows-weights路径:C:\Users\你的用户名\.keras\models...
resnet50_weights_tf_dim_ordering_tf_kernels_notop Linux下是放在“~/.keras/models/”中 Win下则放在Python的“settings/.keras/models/”中 Windows-weights路径:C:\Users\你的用户名\.keras\models anaconda...
官方h5权重文件,xception_weights_tf_dim_ordering_tf_kernels Linux下是放在“~/.keras/models/”中 windows用户直接将文件放置在:C:\Users\用户名\.keras\models 下即可。官方GitHub下载速度慢,给需要的朋友...
mobilenet_v2_weights_tf_dim_ordering_tf_kernels_1.0_192_no_top.h5,mobilenetv2 tf.keras预训练模型,可用于迁移学习。
resnet50_weights_tf_dim_ordering_tf_kernels_notop.h5 速度快,准确率高,参数不多 50层残差网络模型,权重训练自ImageNet 该模型在Theano和TensorFlow后端均可使用,并接受channels_first和channels_last两种输入...
resnet50_weights_tf_dim_ordering_tf_kernels.h5 速度快,准确率高,参数不多
vgg16_weights_tf_dim_ordering_tf_kernels_notop.rar vgg16 卷积神经网络
inception-v4_weights_tf_dim_ordering_tf_kernels 2.1版本
resnet50_weights_th_dim_ordering_th_kernels_notop.h5 50层残差网络模型,权重训练自ImageNet 该模型在Theano和TensorFlow后端均可使用,并接受channels_first和channels_last两种输入维度顺序 模型的默认输入尺寸:...
mobilenet_v2在imagrnet上的预训练权重文件:mobilenet_v2_weights_tf_dim_ordering_tf_kernels_1.4_224_no_top.h5
inception_v3_weights_tf_dim_ordering_tf_kernels_update.zip Linux下是放在“~/.keras/models/”中 Win下则放在Python的“settings/.keras/models/”中 Windows-weights路径:C:\Users\你的用户名\.keras\models ...
vgg19_weights_tf_dim_ordering_tf_kernels_notop.h5 vgg19_weights_th_dim_ordering_tf_kernels_notop.h5
vgg19_weights_tf_dim_ordering_tf_kernels_notop vgg19_weights_tf_dim_ordering_tf_kernels_notop vgg19_weights_tf_dim_ordering_tf_kernels_notop vgg19_weights_tf_dim_ordering_tf_kernels_notop
resnet101_weights_tf_dim_ordering_tf_kernels_notop