You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.5 KiB
39 lines
1.5 KiB
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
<mapper namespace="com.epmet.dao.stats.DimDateDao">
|
|
|
|
<!--最新的按日维度-->
|
|
<select id="getLatestDim" resultType="com.epmet.dto.stats.DimDateDTO">
|
|
SELECT *
|
|
FROM dim_date
|
|
WHERE DEL_FLAG = 0
|
|
ORDER BY ID DESC
|
|
LIMIT 1
|
|
</select>
|
|
|
|
<insert id="insertOne" parameterType="com.epmet.entity.stats.DimDateEntity">
|
|
INSERT INTO dim_date
|
|
(ID, DATE_NAME, DAY_OF_WEEK, DAY_OF_WEEK_NAME, WEEK_ID, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME)
|
|
VALUES
|
|
(#{id}, #{dateName}, #{dayOfWeek}, #{dayOfWeekName}, #{weekId}, #{delFlag}, #{revision}, #{createdBy}, #{createdTime}, #{updatedBy}, #{updatedTime})
|
|
</insert>
|
|
|
|
<select id="selectDimTime" parameterType="java.lang.String" resultType="com.epmet.dto.group.result.DimTimeResultDTO">
|
|
SELECT
|
|
dd.id AS dateId,
|
|
dd.week_id AS weekId,
|
|
dd.month_id AS monthId,
|
|
dm.quarter_id AS quarterId,
|
|
dm.year_id AS yearId
|
|
FROM
|
|
dim_date dd
|
|
LEFT JOIN dim_week dw ON dw.id = dd.week_id
|
|
AND dw.del_flag = 0
|
|
LEFT JOIN dim_month dm ON dm.id = dd.month_id
|
|
AND dm.del_flag = 0
|
|
WHERE
|
|
dd.del_flag = 0
|
|
AND dd.id = #{dateId}
|
|
</select>
|
|
</mapper>
|