Explorar el Código

新增未过期数据查询方法

xuxiaofei hace 3 años
padre
commit
288e079a9b

+ 12 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabSecurityApplyController.java

@@ -750,4 +750,16 @@ public class LabSecurityApplyController extends BaseController
         byte[] data =  outStream.toByteArray();
         return data;
     }
+
+    /***
+     * 安全准入未过期的数据
+     * @param labSecurityApply
+     * @return
+     */
+    @GetMapping(value = "/getValidApply")
+    public ResultData  selectValidApply( LabSecurityApply labSecurityApply)
+    {
+        List<LabSecurityApply> list = labSecurityApplyService.selectValidApply(labSecurityApply);
+        return ResultData.success(list);
+    }
 }

+ 7 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/LabSecurityApplyMapper.java

@@ -134,4 +134,11 @@ public interface LabSecurityApplyMapper
 
 
     List<Map<String, Long>> selectApplyListBySubIds(@Param("subIds") List<Long> subIds);
+
+    /**
+     * 未过期的数据
+     * @param labSecurityApply
+     * @return
+     */
+    List<LabSecurityApply>  selectValidApply(LabSecurityApply labSecurityApply);
 }

+ 6 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/ILabSecurityApplyService.java

@@ -165,4 +165,10 @@ public interface ILabSecurityApplyService
      */
     List<LabSecurityApplyVO> selectLabSecurityApplyListByTime(LabSecurityApplyVO labSecurityApplyVO);
 
+    /**
+     * 未过期的数据
+     * @param labSecurityApply
+     * @return
+     */
+    List<LabSecurityApply>  selectValidApply(LabSecurityApply labSecurityApply);
 }

+ 11 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabSecurityApplyServiceImpl.java

@@ -469,4 +469,15 @@ public class LabSecurityApplyServiceImpl implements ILabSecurityApplyService
     public List<LabSecurityApplyVO> selectLabSecurityApplyListByTime(LabSecurityApplyVO labSecurityApplyVO) {
         return labSecurityApplyMapper.selectLabSecurityApplyListByTime(labSecurityApplyVO);
     }
+
+    /**
+     * 未过期的数据
+     *
+     * @param labSecurityApply
+     * @return
+     */
+    @Override
+    public List<LabSecurityApply> selectValidApply(LabSecurityApply labSecurityApply) {
+        return labSecurityApplyMapper.selectValidApply(labSecurityApply);
+    }
 }

+ 12 - 0
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabSecurityApplyMapper.xml

@@ -591,4 +591,16 @@
         </if>
     </select>
 
+    <!--未过期的申请 -->
+    <select id="selectValidApply" parameterType="com.zd.laboratory.domain.LabSecurityApply" resultMap="LabSecurityApplyResult">
+        <include refid="selectLabSecurityApplyVo"/>
+        where t.audit_status = 2 and t.valid_end_time >= now()
+        <if test="userId!=null">
+            and t.user_id=#{userId}
+        </if>
+        <if test="subjectId!=null">
+            and t.subject_id=#{subjectId}
+        </if>
+    </select>
+
 </mapper>