Quellcode durchsuchen

院校增加适用考生类型,前台绑定时过滤

mingfu vor 1 Woche
Ursprung
Commit
4dd7c3eea7

+ 2 - 0
ie-admin/src/main/java/com/ruoyi/web/controller/front/UserController.java

@@ -3,6 +3,7 @@ package com.ruoyi.web.controller.front;
 import com.alibaba.fastjson2.JSONObject;
 import com.ruoyi.common.annotation.Anonymous;
 import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.content.VistorContextHolder;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.entity.SysUser;
@@ -176,6 +177,7 @@ public class UserController extends BaseController {
         DzSchool dzSchool = new DzSchool();
         dzSchool.setCampus(false);
         dzSchool.setName(keyword);
+        dzSchool.setExamTypes(VistorContextHolder.getContext().getExamType().name());
         startPage();
         List<DzSchool> list = dzSchoolService.selectDzSchoolList(dzSchool);
         return getDataTable(list);

+ 12 - 0
ie-system/src/main/java/com/ruoyi/dz/domain/DzSchool.java

@@ -28,6 +28,10 @@ public class DzSchool extends BaseEntity
     @Excel(name = "机构ID")
     private Long deptId;
 
+    /** 机构ID */
+    @Excel(name = "适用考生类型")
+    private String examTypes;
+
     /** 用户ID */
     @Excel(name = "用户ID")
     private Long userId;
@@ -58,6 +62,14 @@ public class DzSchool extends BaseEntity
 
     private Boolean campus;
 
+    public String getExamTypes() {
+        return examTypes;
+    }
+
+    public void setExamTypes(String examTypes) {
+        this.examTypes = examTypes;
+    }
+
     public Long getUserId() {
         return userId;
     }

+ 5 - 0
ie-system/src/main/resources/mapper/dz/DzSchoolMapper.xml

@@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="id"    column="id"    />
         <result property="name"    column="name"    />
         <result property="deptId"    column="dept_id"    />
+        <result property="examTypes"    column="exam_types"    />
         <result property="location"    column="location"    />
         <result property="remark"    column="remark"    />
         <result property="pro"    column="pro"    />
@@ -45,6 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null ">
                 AND (t1.dept_id = #{deptId} OR t1.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
             </if>
+            <if test="examTypes != null  and examTypes != ''"> and (t1.exam_types is null or t.exam_types = #{examTypes})</if>
             <if test="location != null  and location != ''"> and t1.location = #{location}</if>
             <if test="pro != null "> and t1.pro = #{pro}</if>
             <if test="city != null "> and t1.city = #{city}</if>
@@ -76,6 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="name != null">name,</if>
             <if test="deptId != null">dept_id,</if>
+            <if test="examTypes != null">exam_types,</if>
             <if test="location != null">location,</if>
             <if test="remark != null">remark,</if>
             <if test="pro != null">pro,</if>
@@ -88,6 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="name != null">#{name},</if>
             <if test="deptId != null">#{deptId},</if>
+            <if test="examTypes != null">#{examTypes},</if>
             <if test="location != null">#{location},</if>
             <if test="remark != null">#{remark},</if>
             <if test="pro != null">#{pro},</if>
@@ -104,6 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="SET" suffixOverrides=",">
             <if test="name != null">name = #{name},</if>
             <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="examTypes != null">exam_types = #{examTypes},</if>
             <if test="location != null">location = #{location},</if>
             <if test="remark != null">remark = #{remark},</if>
             <if test="pro != null">pro = #{pro},</if>