Browse Source

学习记录时长统计加上参培时长

lamphua 16 hours ago
parent
commit
535da7793e

+ 18
- 7
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcStudyMapper.xml View File

56
     </select>
56
     </select>
57
 
57
 
58
     <select id="selectCmcStudyStatistic" parameterType="CmcStudy" resultMap="CmcStudyResult">
58
     <select id="selectCmcStudyStatistic" parameterType="CmcStudy" resultMap="CmcStudyResult">
59
-        select * from
60
-        (select  u.user_id, u.dept_id, u.nick_name, d.dept_name, sum(s.get_hours) as get_hours, u.status, s.last_time from sys_user as u
59
+        select t.user_id, t.dept_id, t.nick_name, t.dept_name, sum(t.get_hours) as get_hours, t.status, t.last_time from
60
+        (select t1.* from (select  u.user_id, u.dept_id, u.nick_name, d.dept_name, sum(s.get_hours) as get_hours, u.status, s.last_time as last_time from sys_user as u
61
         left join cmc_study as s on u.user_id = s.user_id
61
         left join cmc_study as s on u.user_id = s.user_id
62
         left join sys_dept as d on d.dept_id = u.dept_id
62
         left join sys_dept as d on d.dept_id = u.dept_id
63
-        group by u.user_id) as t
64
         <where>
63
         <where>
65
-            t.status = '0' and t.user_id != 1
66
-            <if test="deptId != null "> and t.dept_id = #{deptId}</if>
67
-            <if test="lastTime != null "> and YEAR(t.last_time) = YEAR(#{lastTime})</if>
64
+            u.status = '0' and u.user_id != 1
65
+            <if test="deptId != null "> and u.dept_id = #{deptId}</if>
66
+            <if test="lastTime != null "> and YEAR(s.last_time) = YEAR(#{lastTime})</if>
67
+        </where>
68
+        group by u.user_id) as t1
69
+        union
70
+        select t2.* from (select u.user_id, u.dept_id, u.nick_name, d.dept_name, sum(ta.hours) as get_hours, u.status, ta.dept_time as last_time from sys_user as u
71
+        left join cmc_train_approval as ta on ta.user_id = u.user_id
72
+        left join sys_dept as d on d.dept_id = u.dept_id
73
+        <where>
74
+            u.status = '0' and u.user_id != 1 and ta.dept_time is not null
75
+            <if test="deptId != null "> and u.dept_id = #{deptId}</if>
76
+            <if test="lastTime != null "> and YEAR(ta.dept_time) = YEAR(#{lastTime})</if>
68
         </where>
77
         </where>
69
-        order by t.get_hours desc, user_id
78
+        group by u.user_id) as t2) as t
79
+        group by t.user_id
80
+        order by get_hours desc, user_id
70
     </select>
81
     </select>
71
 
82
 
72
     <select id="selectCmcStudyByStudyId" parameterType="Integer" resultMap="CmcStudyResult">
83
     <select id="selectCmcStudyByStudyId" parameterType="Integer" resultMap="CmcStudyResult">

+ 3
- 3
oa-ui/src/views/flowable/form/oa/carForm.vue View File

1
 <!--
1
 <!--
2
  * @Author: ysh
2
  * @Author: ysh
3
  * @Date: 2024-02-29 11:44:28
3
  * @Date: 2024-02-29 11:44:28
4
- * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2025-04-15 10:27:30
4
+ * @LastEditors: wrh
5
+ * @LastEditTime: 2025-06-23 09:35:51
6
 -->
6
 -->
7
 
7
 
8
 <template>
8
 <template>
212
               <el-form-item label="车牌号:" prop="cars">
212
               <el-form-item label="车牌号:" prop="cars">
213
                 <el-checkbox-group v-model="form.cars" :disabled="taskName != '安排用车'">
213
                 <el-checkbox-group v-model="form.cars" :disabled="taskName != '安排用车'">
214
                   <el-checkbox :disabled="item.status == 1 ? false : true" :label="item.carId" v-for="item in carList"
214
                   <el-checkbox :disabled="item.status == 1 ? false : true" :label="item.carId" v-for="item in carList"
215
-                    :key="item.carId" :value="item.carId" v-if="item.remark == null">
215
+                    :key="item.carId" :value="item.carId">
216
                     {{ item.licensePlate + (item.brand ? item.brand : '') + (item.series ? item.series : '') }}
216
                     {{ item.licensePlate + (item.brand ? item.brand : '') + (item.series ? item.series : '') }}
217
                   </el-checkbox>
217
                   </el-checkbox>
218
                 </el-checkbox-group>
218
                 </el-checkbox-group>

Loading…
Cancel
Save