zhuguifei
2025-04-28 442928123f63ee497d766f9a7a14f0a6ee067e25
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?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="org.jeecg.modules.weekly.mapper.WekRecordMapper">
    <insert id="insertBatch">
        INSERT INTO wek_record
        ( id,xq, xm,wbs,gzms,gzjd,gzgs,week,ksrq,jsrq,type,plan,create_by,create_time,update_by,update_time)
        VALUES
        <foreach collection="wekRecords" item="wek" separator=",">
            (#{wek.id},
            #{wek.xq},#{wek.xm},#{wek.wbs},#{wek.gzms},#{wek.gzjd},#{wek.gzgs},#{wek.week},#{wek.ksrq},#{wek.jsrq},
            #{wek.type},#{wek.plan},#{wek.createBy},#{wek.createTime},#{wek.updateBy},#{wek.updateTime})
        </foreach>
    </insert>
 
 
    <select id="queryYearWeekGroup" resultType="java.util.HashMap">
        SELECT `year`,week from wek_record where 1 = 1
        <if test="user!=null and user!=''">
            and user = #{user}
        </if>
        <if test="xm!=null and xm!=''">
            and xm = #{xm}
        </if>
        <if test="type!=null and type!=''">
            and type = #{type}
        </if>
        GROUP BY `year`,week ORDER BY `year` desc ,week desc
 
    </select>
 
 
    <select id="queryAllXmYearWeekGroup" resultType="java.util.HashMap">
        SELECT `year`, week
        from wek_record
        where 1 = 1
          and type = 0
          and xm is not null
        GROUP BY `year`, week
        ORDER BY `year` desc, week desc
 
    </select>
 
 
    <select id="queryDepartUsers" resultType="java.lang.String">
        select a.username from sys_user a
        join sys_user_depart b on b.user_id = a.id join sys_depart c on b.dep_id = c.id where 1 = 1
 
 
        <if test="orgCode!=null and orgCode!=''">
            and c.org_code like '${orgCode}%'
        </if>
 
 
    </select>
 
    <select id="queryProjectList" resultType="org.jeecg.modules.weekly.entity.ProProject">
        SELECT * from pro_project WHERE 1 = 1
 
        <if test="xmmc!=null and xmmc!=''">
            and xmmc like '%${xmmc}%'
        </if>
 
        <if test="xmbh!=null and xmbh!=''">
            and xmbh like '%${xmbh}%'
        </if>
 
 
    </select>
 
 
    <select id="statisticsList" resultType="org.jeecg.modules.weekly.entity.WekRecord">
        SELECT * from wek_record WHERE 1 = 1 and type in (0,1)
 
 
        <if test="xm!=null and xm!=''">
            and xm in
            <foreach item="item" index="index" collection="xm.split(',')"  open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
 
        <if test="user!=null and user!=''">
            and user in
            <foreach item="item" index="index" collection="user.split(',')"  open="(" separator="," close=")">
                #{item}
            </foreach>
 
        </if>
 
        <if test="sweek!=null and sweek!=''">
            and year_week  &gt;=  (${syear}*100 + ${sweek})
 
        </if>
 
        <if test="eweek!=null and eweek!=''">
            and year_week  &lt;=   (${eyear}*100  + ${eweek})
        </if>
 
 
    </select>
 
 
    <select id="queryUserInfoByName" resultType="java.util.HashMap">
        SELECT a.realname ,a.post,c.depart_name departname  from sys_user a
        join sys_user_depart b on a.id = b.user_id
        join sys_depart c on b.dep_id = c.id
        WHERE a.username = #{user}
    </select>
 
 
    <select id="queryUsersInfoByNames" resultType="java.util.HashMap">
        SELECT a.username,a.realname ,a.post,c.depart_name departname  from sys_user a
        join sys_user_depart b on a.id = b.user_id
        join sys_depart c on b.dep_id = c.id
        WHERE 1 = 1 and   a.username in
        <foreach collection="list" item="item" open="("  separator="," close=")">
            #{item}
        </foreach>
    </select>
 
 
 
</mapper>