feat: 移植工程
This commit is contained in:
42
home-service/src/main/resources/mapper/PlanMapper.xml
Normal file
42
home-service/src/main/resources/mapper/PlanMapper.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?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.cxx.home.dao.PlanDao">
|
||||
<select id="queryPlan" resultType="com.cxx.common.dto.plan.PlanDto">
|
||||
SELECT id AS id,
|
||||
title AS title,
|
||||
content AS content,
|
||||
date AS date,
|
||||
start_time AS startTime,
|
||||
end_time AS endTime,
|
||||
alter_time AS alterTime,
|
||||
task_id AS taskId,
|
||||
tag AS tag,
|
||||
is_top AS isTop,
|
||||
priority AS priority,
|
||||
completed AS completed
|
||||
FROM plan
|
||||
<where>
|
||||
<if test="query.planType eq 'completed'">
|
||||
completed = 1
|
||||
</if>
|
||||
<if test="query.planType eq 'notCompleted'">
|
||||
completed = 0
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY
|
||||
<if test="query.orderType eq 'priority'">
|
||||
priority,
|
||||
</if>
|
||||
completed,
|
||||
is_top DESC,
|
||||
date DESC
|
||||
</select>
|
||||
|
||||
<select id="queryPlanStats" resultType="com.cxx.common.dto.plan.PlanStatsDto">
|
||||
SELECT COUNT(*) AS totalCount,
|
||||
IFNULL(SUM(completed), 0) AS completedCount,
|
||||
IFNULL(SUM(CASE WHEN completed = 0 AND date <![CDATA[ >]]> CURDATE() THEN 1 ELSE 0 END), 0) AS currentCount,
|
||||
IFNULL(SUM(CASE WHEN completed = 0 AND date <![CDATA[ >]]> CURDATE() THEN 1 ELSE 0 END), 0) AS remainCount
|
||||
FROM plan
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user