shiyunteng
2026-10-23 c5ea85558fea4d82b5368073c598a30f905c4bdc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?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.by4cloud.platformx.business.mapper.AnnualPlanMapper">
 
  <resultMap id="annualPlanMap" type="com.by4cloud.platformx.business.entity.AnnualPlan">
        <id property="id" column="id"/>
        <result property="compId" column="comp_id"/>
        <result property="planType" column="plan_type"/>
        <result property="aprAmount" column="apr_amount"/>
        <result property="augAmount" column="aug_amount"/>
        <result property="decAmount" column="dec_amount"/>
        <result property="febAmount" column="feb_amount"/>
        <result property="janAmount" column="jan_amount"/>
        <result property="julAmount" column="jul_amount"/>
        <result property="junAmount" column="jun_amount"/>
        <result property="marAmount" column="mar_amount"/>
        <result property="mayAmount" column="may_amount"/>
        <result property="novAmount" column="nov_amount"/>
        <result property="octAmount" column="oct_amount"/>
        <result property="planYear" column="plan_year"/>
        <result property="sepAmount" column="sep_amount"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="delFlag" column="del_flag"/>
  </resultMap>
    <select id="selectPlanYear" resultType="com.by4cloud.platformx.business.vo.AnnualPlanTotalVo">
        SELECT
            plan_year,
            IFNULL(sum(jan_amount),0) jan_amount,
            IFNULL(sum(feb_amount),0) feb_amount,
            IFNULL(sum(mar_amount),0) mar_amount,
            IFNULL(sum(apr_amount),0) apr_amount,
            IFNULL(sum(may_amount),0) may_amount,
            IFNULL(sum(jun_amount),0) jun_amount,
            IFNULL(sum(jul_amount),0) jul_amount,
            IFNULL(sum(aug_amount),0) aug_amount,
            IFNULL(sum(sep_amount),0) sep_amount,
            IFNULL(sum(oct_amount),0) oct_amount,
            IFNULL(sum(nov_amount),0) nov_amount,
            IFNULL(sum(dec_amount),0) dec_amount
        FROM
            annual_plan
        WHERE
            del_flag = '0'
          and plan_type = #{planType}
          AND plan_year = #{curYear}
        GROUP BY
            plan_year
    </select>
</mapper>