wwl 4 жил өмнө
parent
commit
8361f86ee4

+ 2 - 1
hzgzpt-service/src/main/java/com/miaxis/school/dto/SchoolClassTypePcDTO.java

@@ -2,6 +2,7 @@ package com.miaxis.school.dto;
 
 import com.miaxis.common.annotation.Excel;
 import com.miaxis.common.core.domain.BaseBusinessEntity;
+import com.miaxis.common.core.domain.BaseQueryEntity;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -14,7 +15,7 @@ import lombok.Data;
  */
 @Data
 @ApiModel(value = "SchoolClassType", description = "pc驾校班型对象入参")
-public class SchoolClassTypePcDTO extends BaseBusinessEntity{
+public class SchoolClassTypePcDTO extends BaseQueryEntity {
 
     /** 班级名称 */
     @ApiModelProperty(value = "班级名称")

+ 2 - 0
hzgzpt-service/src/main/java/com/miaxis/school/service/impl/SchoolClassTypeServiceImpl.java

@@ -4,6 +4,7 @@ package com.miaxis.school.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.miaxis.common.annotation.DataScope;
 import com.miaxis.school.domain.SchoolClassType;
 import com.miaxis.school.dto.SchoolClassTypePcDTO;
 import com.miaxis.school.mapper.SchoolClassTypeMapper;
@@ -32,6 +33,7 @@ public class SchoolClassTypeServiceImpl extends ServiceImpl<SchoolClassTypeMappe
      * pc班型查询列表
      */
     @Override
+    @DataScope(deptAlias ="s")
     public List<SchoolClassTypePcVO> queryList(SchoolClassTypePcDTO schoolClassTypePcDTO) {
         return schoolClassTypeMapper.queryList(schoolClassTypePcDTO);
     }

+ 16 - 14
hzgzpt-service/src/main/resources/mapper/school/SchoolClassTypeMapper.xml

@@ -30,23 +30,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <!--pc班型查询列表-->
     <select id="queryList" resultType="com.miaxis.school.vo.SchoolClassTypePcVO">
         SELECT
-        s.`id`,
-        s.`class_name` as className,
-        s.`total_price` as totalPrice,
-        s.`train`,
-        s.`pxcx`,
-        s.`pay_type` AS payType,
-        s.`create_time` as createTime
+        sc.`id`,
+        sc.`class_name` as className,
+        sc.`total_price` as totalPrice,
+        sc.`train`,
+        sc.`pxcx`,
+        sc.`pay_type` AS payType,
+        sc.`create_time` as createTime
         FROM
-        school_class_type s
-        LEFT JOIN school_info si ON si.inscode = s.inscode
+        school_class_type sc
+        JOIN school_info s ON s.inscode = sc.inscode
         <where>
-            <if test="className != null  and className != ''"> and s.`class_name` like concat('%', #{className}, '%')</if>
-            <if test="totalPrice != null  and totalPrice != ''"> and s.total_price = #{totalPrice}</if>
-            <if test="train != null  and train != ''"> and s.train = #{train}</if>
-            <if test="payType != null  and payType != ''"> and s.pay_type = #{payType}</if>
-            <if test="pxcx != null  and pxcx != ''"> and s.pxcx = #{pxcx}</if>
+            <if test="className != null  and className != ''"> and sc.`class_name` like concat('%', #{className}, '%')</if>
+            <if test="totalPrice != null  and totalPrice != ''"> and sc.total_price = #{totalPrice}</if>
+            <if test="train != null  and train != ''"> and sc.train = #{train}</if>
+            <if test="payType != null  and payType != ''"> and sc.pay_type = #{payType}</if>
+            <if test="pxcx != null  and pxcx != ''"> and sc.pxcx = #{pxcx}</if>
         </where>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
     </select>
 
 </mapper>