소스 검색

班级接口增加查询条件

dzx 1 년 전
부모
커밋
a6004042dc

+ 21 - 0
src/main/java/com/xjrsoft/module/base/dto/BaseClassPageDto.java

@@ -28,4 +28,25 @@ public class BaseClassPageDto extends PageInput {
     @ApiModelProperty("班级类型")
     private String classType;
 
+    @ApiModelProperty("机构id")
+    private Long orgId;
+
+    @ApiModelProperty("班级代码")
+    private String code;
+
+    @ApiModelProperty("教室id")
+    private Long classroomId;
+
+    @ApiModelProperty("班主人名称")
+    private Long teacherId;
+
+    @ApiModelProperty("在读状态(1: 在读 2: 毕业)")
+    private Integer isGraduate;
+
+    @ApiModelProperty("是否订单班(1: 是 0: 否)")
+    private Integer isOrderClass;
+
+    @ApiModelProperty("招生类型(xjr_dictionary_item[enroll_type])")
+    private String enrollType;
+
 }

+ 3 - 0
src/main/java/com/xjrsoft/module/base/vo/BaseClassPageVo.java

@@ -50,4 +50,7 @@ public class BaseClassPageVo {
     @ApiModelProperty("班级类型")
     private String classTypeCn;
 
+    @ApiModelProperty("机构名称")
+    private String orgName;
+
 }

+ 23 - 1
src/main/resources/mapper/base/BaseClass.xml

@@ -25,12 +25,13 @@
         LEFT JOIN base_student_school_roll a2 ON a1.id = a2.user_id
         WHERE a1.delete_mark = 0 AND a2.delete_mark = 0
         AND a2.class_id = t1.id AND a2.stduy_status = 'FB3001'
-        AND a2.archives_status = 'FB2901') AS not_stay_count FROM base_class t1
+        AND a2.archives_status = 'FB2901') AS not_stay_count,t7.name AS org_name FROM base_class t1
         LEFT JOIN xjr_user t2 ON t1.teacher_id = t2.id
         LEFT JOIN xjr_dictionary_detail t3 ON t3.code = t1.enroll_type AND t3.item_id = 2023000000000000027
         LEFT JOIN xjr_dictionary_detail t5 ON t5.code = t1.class_type AND t5.item_id = 1784405535724978177
         LEFT JOIN base_grade t4 ON t1.grade_id = t4.id
         LEFT JOIN base_classroom t6 ON t1.classroom_id = t6.id
+        LEFT JOIN xjr_department t7 ON t1.org_id = t7.id
         WHERE t1.delete_mark = 0
         <if test="dto.name != null and dto.name != ''">
             and t1.name like concat('%', #{dto.name}, '%')
@@ -47,6 +48,27 @@
         <if test="dto.classType != null and dto.classType != ''">
             and t1.class_type = #{dto.classType}
         </if>
+        <if test="dto.isOrderClass != null">
+            and t1.is_order_class = #{dto.isOrderClass}
+        </if>
+        <if test="dto.isGraduate != null">
+            and t1.is_graduate = #{dto.isGraduate}
+        </if>
+        <if test="dto.teacherId != null">
+            and t1.teacher_id = #{dto.teacherId}
+        </if>
+        <if test="dto.orgId != null">
+            and t1.org_id = #{dto.orgId}
+        </if>
+        <if test="dto.classroomId != null">
+            and t1.classroom_id = #{dto.classroomId}
+        </if>
+        <if test="dto.code != null and dto.code != ''">
+            and t6.code like concat('%', #{dto.code}, '%')
+        </if>
+        <if test="dto.enrollType != null and dto.enrollType != ''">
+            and t6.enroll_type = #{dto.enroll_type}
+        </if>
     </select>
 
 </mapper>

+ 1 - 1
src/main/resources/sqlScript/200240428_sql.sql

@@ -4,7 +4,7 @@ DELIMITER $$
 CREATE
     PROCEDURE createCom()
 BEGIN
-    IF NOT EXISTS(SELECT 1 FROM information_schema.columns  WHERE table_name='system_update_message' AND COLUMN_NAME = 'release_date') THEN
+    IF NOT EXISTS(SELECT 1 FROM information_schema.columns  WHERE table_name='base_class' AND COLUMN_NAME = 'class_type') THEN
 ALTER TABLE `base_class`   
   ADD COLUMN `class_type` VARCHAR(50) NULL   COMMENT '班级类型(xjr_dictionary_item[class_type])' AFTER `is_graduate`;
     END IF;