jiangbiao 3 сар өмнө
parent
commit
4b9aaa18b3

+ 11 - 1
master/src/main/java/com/ruoyi/project/training/controller/TTrainingbccController.java

@@ -269,7 +269,17 @@ public class TTrainingbccController extends BaseController {
         PictureRenderData plantMgr = null;
         TTrainingbccDevice tTrainingbccDevice = new TTrainingbccDevice();
         tTrainingbccDevice.setRegularId(trainingbcc.getId());
-        List<TTrainingbccDevice> list = tTrainingbccDeviceMapper.selectTTrainingbccDeviceList(tTrainingbccDevice);
+        List<TTrainingbccDevice> list = tTrainingbccDeviceMapper.sortSelectTTrainingbccDeviceList(tTrainingbccDevice);
+        for (int i = 0; i < list.size(); i++) {
+            TTrainingbccDevice t1 = list.get(i);
+            for (int j = i+1; j < list.size(); j++) {
+                TTrainingbccDevice t2 = list.get(j);
+                if (t1.getName().equals(t2.getName())) {
+                    t1.setName(t1.getName() +"1");
+                    t2.setName(t2.getName() + "2");
+                }
+            }
+        }
         for (int i = 0; i < list.size(); i++) {
             //如果当前行为偶数,直接开始下一行
             if (i % 2 != 0) {

+ 1 - 0
master/src/main/java/com/ruoyi/project/training/mapper/TTrainingbccDeviceMapper.java

@@ -27,6 +27,7 @@ public interface TTrainingbccDeviceMapper
      * @return 人员-装置级培训关系集合
      */
     public List<TTrainingbccDevice> selectTTrainingbccDeviceList(TTrainingbccDevice tTrainingbccDevice);
+    public List<TTrainingbccDevice> sortSelectTTrainingbccDeviceList(TTrainingbccDevice tTrainingbccDevice);
 
     /**
      * 新增人员-装置级培训关系

+ 27 - 0
master/src/main/resources/mybatis/training/TTrainingbccDeviceMapper.xml

@@ -54,6 +54,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         order by d.exam_state, d.start_date
     </select>
 
+    <select id="sortSelectTTrainingbccDeviceList" parameterType="TTrainingbccDevice" resultMap="TTrainingbccDeviceResult">
+        select d.id,s.name , d.staff_id, d.regular_id, d.start_date, d.remarks, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.supplementary, d.learn_state, d.exam_state, d.exam_id,d.exam_num, d.learn_time from t_trainingbcc_device d
+        left join t_staffmgr s on s.staffid = d.staff_id
+        left join t_trainingbcc t on t.id = d.regular_id and t.DEL_FLAG = 0
+        Left join SYS_DICT_DATA s0 on s.UNIT = s0.DICT_VALUE and s0.DICT_TYPE ='STAFF_UNIT'
+        LEFT JOIN SYS_DICT_DATA s2 on s.ACTUALPOST = s2.DICT_VALUE and s2.DICT_TYPE = 'ACTUALPOST'
+        LEFT JOIN SYS_DICT_DATA s1 on s.team = s1.DICT_VALUE and s1.DICT_TYPE = 'TEAM_DIVIDE'
+        <where>
+            <if test="staffId != null  and staffId != ''"> and d.staff_id = #{staffId} and d.exam_state != 1 and ((ADD_MONTHS(TRUNC(SYSDATE, 'MM'), 1) > t.course_startdate and t.course_enddate >= SYSDATE) or (d.supplementary = 1 and d.exam_state = 0))  </if>
+            <if test="regularId != null "> and d.regular_id = #{regularId}</if>
+            <if test="startDate != null "> and d.start_date = #{startDate}</if>
+            <if test="remarks != null  and remarks != ''"> and d.remarks = #{remarks}</if>
+            <if test="createrCode != null  and createrCode != ''"> and d.creater_code = #{createrCode}</if>
+            <if test="createdate != null "> and d.createdate = #{createdate}</if>
+            <if test="updaterCode != null  and updaterCode != ''"> and d.updater_code = #{updaterCode}</if>
+            <if test="updatedate != null "> and d.updatedate = #{updatedate}</if>
+            <if test="supplementary != null  and supplementary != ''"> and d.supplementary = #{supplementary}</if>
+            <if test="learnState != null "> and d.learn_state = #{learnState}</if>
+            <if test="examState != null "> and d.exam_state = #{examState}</if>
+            <if test="examId != null "> and d.exam_id = #{examId}</if>
+            <if test="learnTime != null "> and d.learn_time = #{learnTime}</if>
+            <if test="trainingType != null and trainingType != ''">and t.training_type = #{trainingType}</if>
+            and d.del_flag = 0
+        </where>
+        ORDER BY d.del_flag, s0.DICT_SORT, s1.DICT_SORT ,s2.DICT_SORT
+    </select>
+
     <select id="selectTTrainingbccDeviceById" parameterType="Long" resultMap="TTrainingbccDeviceResult">
         <include refid="selectTTrainingbccDeviceVo"/>
         where d.id = #{id}