Jelajahi Sumber

老师入驻审核修改

liweifan 2 tahun lalu
induk
melakukan
8826dee028
14 mengubah file dengan 221 tambahan dan 45 penghapusan
  1. 1 1
      cooleshow-auth/auth-server/src/main/java/com/yonge/cooleshow/auth/web/controller/UserController.java
  2. 1 1
      cooleshow-common/src/main/java/com/yonge/cooleshow/common/enums/UserLockFlag.java
  3. 3 5
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/ActivityPlanController.java
  4. 8 0
      cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/TeacherAuthEntryRecordController.java
  5. 11 7
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/TeacherAuthEntryRecordDao.java
  6. 36 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/SaveOrUpdateRewardDto.java
  7. 23 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/AuthEntryRecordSearch.java
  8. 3 2
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/ActivityPlanService.java
  9. 4 0
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/TeacherAuthEntryRecordService.java
  10. 9 2
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/ActivityPlanServiceImpl.java
  11. 4 3
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/StudentServiceImpl.java
  12. 10 1
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TeacherAuthEntryRecordServiceImpl.java
  13. 11 2
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/TeacherAuthEntryRecordVo.java
  14. 97 20
      cooleshow-user/user-biz/src/main/resources/config/mybatis/TeacherAuthEntryRecordMapper.xml

+ 1 - 1
cooleshow-auth/auth-server/src/main/java/com/yonge/cooleshow/auth/web/controller/UserController.java

@@ -353,7 +353,7 @@ public class UserController extends BaseController {
             return failed("非法操作");
         }
         //退出对应用户
-        if (UserLockFlag.LOCK.equals(lockFlag)) {
+        if (UserLockFlag.LOCKED.equals(lockFlag)) {
             loginOut(sysUser, sysUserType);
         }
         //sysUser.setLockFlag(lockFlag.getCode());

+ 1 - 1
cooleshow-common/src/main/java/com/yonge/cooleshow/common/enums/UserLockFlag.java

@@ -8,7 +8,7 @@ import com.yonge.toolset.base.enums.BaseEnum;
  */
 public enum UserLockFlag implements BaseEnum<Integer, UserLockFlag> {
 
-	NORMAL(0, "正常"), LOCK(1, "锁定");
+	NORMAL(0, "正常"), LOCKED(1, "锁定");
 
 	@EnumValue
 	private int code;

+ 3 - 5
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/ActivityPlanController.java

@@ -4,6 +4,7 @@ import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
 import com.yonge.cooleshow.auth.api.entity.SysUser;
 import com.yonge.cooleshow.biz.dal.dto.ActivityPlanDto;
 import com.yonge.cooleshow.biz.dal.dto.ActivityPlanRewardDto;
+import com.yonge.cooleshow.biz.dal.dto.SaveOrUpdateRewardDto;
 import com.yonge.cooleshow.common.controller.BaseController;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -121,17 +122,14 @@ public class ActivityPlanController extends BaseController {
     @PostMapping("/saveOrUpdateReward")
     @ApiOperation(value = "修改奖品")
     @PreAuthorize("@pcs.hasPermissions('activityPlan/saveOrUpdateReward')")
-    public HttpResponseResult saveOrUpdateReward(@Validated @RequestBody List<ActivityPlanRewardDto> updateRewardDtoList) {
+    public HttpResponseResult saveOrUpdateReward(@Validated @RequestBody SaveOrUpdateRewardDto saveOrUpdateRewardDto) {
         SysUser user = sysUserFeignService.queryUserInfo();
         if (user == null || null == user.getId()) {
             return failed(HttpStatus.FORBIDDEN, "请登录");
         }
 
-        if (CollectionUtils.isEmpty(updateRewardDtoList)) {
-            return failed("参数异常");
-        }
         try {
-            return HttpResponseResult.succeed(activityPlanService.saveOrUpdateReward(updateRewardDtoList));
+            return HttpResponseResult.succeed(activityPlanService.saveOrUpdateReward(saveOrUpdateRewardDto));
         } catch (BizException e) {
             return HttpResponseResult.failed(e.getMessage());
         } catch (Exception e) {

+ 8 - 0
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/TeacherAuthEntryRecordController.java

@@ -47,6 +47,14 @@ public class TeacherAuthEntryRecordController extends BaseController {
         return succeed(PageUtil.pageInfo(pages));
     }
 
+    @PostMapping("/historyPage")
+    @ApiOperation(value = "查询分页", notes = "传入AuthEntryRecordSearch")
+    @PreAuthorize("@pcs.hasPermissions('teacherAuthEntryRecord/page')")
+    public HttpResponseResult<PageInfo<TeacherAuthEntryRecordVo>> historyPage(@RequestBody AuthEntryRecordSearch search) {
+        IPage<TeacherAuthEntryRecordVo> pages = teacherAuthEntryRecordService.historyPage(PageUtil.getPage(search), search);
+        return succeed(PageUtil.pageInfo(pages));
+    }
+
     @PostMapping("/doAuth")
     @ApiOperation(value = "审核", notes = "传入authOperaDto")
     @PreAuthorize("@pcs.hasPermissions('teacherAuthEntryRecord/doAuth')")

+ 11 - 7
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/TeacherAuthEntryRecordDao.java

@@ -11,12 +11,6 @@ import com.yonge.cooleshow.biz.dal.vo.TeacherAuthEntryRecordVo;
 import org.apache.ibatis.annotations.Param;
 
 public interface TeacherAuthEntryRecordDao extends BaseMapper<TeacherAuthEntryRecord>{
-
-	/**
-	 * 自定义分页
-	 */
-	List<TeacherAuthEntryRecordVo> selectPage(@Param("page")IPage page,@Param("param") AuthEntryRecordSearch search);
-
 	/***
 	 * 根据老师id查询详情
 	 * @author liweifan
@@ -24,7 +18,17 @@ public interface TeacherAuthEntryRecordDao extends BaseMapper<TeacherAuthEntryRe
 	 * @updateTime 2022/3/21 13:43
 	 * @return: com.yonge.cooleshow.biz.dal.vo.TeacherAuthEntryRecordVo
 	 */
-    TeacherAuthEntryRecordVo detail(@Param("id") Long id);
+	TeacherAuthEntryRecordVo detail(@Param("id") Long id);
+
+	TeacherAuthEntryRecordVo lastDetil(@Param("id") Long id,@Param("userId") Long userId);
+
+	/**
+	 * 自定义分页
+	 */
+	List<TeacherAuthEntryRecordVo> selectPage(@Param("page")IPage page,@Param("param") AuthEntryRecordSearch search);
+
+	List<TeacherAuthEntryRecordVo> historyPage(@Param("page")IPage page,@Param("param")  AuthEntryRecordSearch search);
+
 	/***
 	 * 查询最近一条申请记录
 	 * @author liweifan

+ 36 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/SaveOrUpdateRewardDto.java

@@ -0,0 +1,36 @@
+package com.yonge.cooleshow.biz.dal.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.util.List;
+
+@ApiModel(value = "SaveOrUpdateRewardDto对象", description = "修改奖品对象")
+public class SaveOrUpdateRewardDto implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("活动id")
+    @NotNull(message = "活动id不能为空")
+    private Long activityId;
+
+    @ApiModelProperty("奖品集合")
+    private List<ActivityPlanRewardDto> updateRewardDtoList;
+
+    public Long getActivityId() {
+        return activityId;
+    }
+
+    public void setActivityId(Long activityId) {
+        this.activityId = activityId;
+    }
+
+    public List<ActivityPlanRewardDto> getUpdateRewardDtoList() {
+        return updateRewardDtoList;
+    }
+
+    public void setUpdateRewardDtoList(List<ActivityPlanRewardDto> updateRewardDtoList) {
+        this.updateRewardDtoList = updateRewardDtoList;
+    }
+}

+ 23 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/AuthEntryRecordSearch.java

@@ -1,7 +1,9 @@
 package com.yonge.cooleshow.biz.dal.dto.search;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
+import com.yonge.cooleshow.biz.dal.enums.AuthTypeEnum;
 import com.yonge.toolset.base.page.QueryInfo;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -14,9 +16,11 @@ import java.util.Date;
  * @Data: 2022/3/21 15:26
  */
 @ApiModel(value = "AuthEntryRecordSearch", description = "审核列表查询")
-public class AuthEntryRecordSearch extends QueryInfo{
+public class AuthEntryRecordSearch extends QueryInfo {
     @ApiModelProperty(value = "老师编号/名称/电话")
     private String search;
+    @ApiModelProperty(value = "用户id")
+    private Long userId;
     @ApiModelProperty(value = "审批人")
     private String verifyUser;
     @ApiModelProperty(value = "申请开始时间")
@@ -29,6 +33,8 @@ public class AuthEntryRecordSearch extends QueryInfo{
     private Date endTime;
     @ApiModelProperty(value = "审核状态  UNPAALY、未申请 DOING、审核中 PASS、通过 UNPASS、不通过")
     private AuthStatusEnum authStatus;
+    @ApiModelProperty("认证审核类型 ADD 新增 MODIFY 修改")
+    private AuthTypeEnum teacherAuthType;
 
     public String getSearch() {
         return search;
@@ -38,6 +44,14 @@ public class AuthEntryRecordSearch extends QueryInfo{
         this.search = search;
     }
 
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
     public String getVerifyUser() {
         return verifyUser;
     }
@@ -69,4 +83,12 @@ public class AuthEntryRecordSearch extends QueryInfo{
     public void setAuthStatus(AuthStatusEnum authStatus) {
         this.authStatus = authStatus;
     }
+
+    public AuthTypeEnum getTeacherAuthType() {
+        return teacherAuthType;
+    }
+
+    public void setTeacherAuthType(AuthTypeEnum teacherAuthType) {
+        this.teacherAuthType = teacherAuthType;
+    }
 }

+ 3 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/ActivityPlanService.java

@@ -8,6 +8,7 @@ import com.yonge.cooleshow.biz.dal.dto.ActivityPlanDto;
 
 import com.yonge.cooleshow.auth.api.entity.SysUser;
 import com.yonge.cooleshow.biz.dal.dto.ActivityPlanRewardDto;
+import com.yonge.cooleshow.biz.dal.dto.SaveOrUpdateRewardDto;
 import com.yonge.cooleshow.biz.dal.dto.req.OrderReq;
 
 import com.yonge.cooleshow.biz.dal.vo.ActivityPlanVo;
@@ -103,8 +104,8 @@ public interface ActivityPlanService extends IService<ActivityPlan>  {
 
 	/**
 	 * 变更活动奖品
-	 * @param updateRewardDtoList
+	 * @param saveOrUpdateRewardDto
 	 * @return
 	 */
-    Boolean saveOrUpdateReward(List<ActivityPlanRewardDto> updateRewardDtoList);
+    Boolean saveOrUpdateReward(SaveOrUpdateRewardDto saveOrUpdateRewardDto);
 }

+ 4 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/TeacherAuthEntryRecordService.java

@@ -33,6 +33,9 @@ public interface TeacherAuthEntryRecordService extends IService<TeacherAuthEntry
  	 * @date 2022-03-18
      */
     IPage<TeacherAuthEntryRecordVo> selectPage(IPage<TeacherAuthEntryRecordVo> page, AuthEntryRecordSearch search);
+
+    IPage<TeacherAuthEntryRecordVo> historyPage(IPage<TeacherAuthEntryRecordVo> page, AuthEntryRecordSearch search);
+
     /***
      * 审核
      * @author liweifan
@@ -59,4 +62,5 @@ public interface TeacherAuthEntryRecordService extends IService<TeacherAuthEntry
      * @return: com.yonge.cooleshow.biz.dal.entity.TeacherAuthEntryRecord
      */
     TeacherAuthEntryRecordVo getLastRecordByUserId(Long userId);
+
 }

+ 9 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/ActivityPlanServiceImpl.java

@@ -11,6 +11,7 @@ import com.yonge.cooleshow.biz.dal.dao.ActivityPlanEvaluationDao;
 import com.yonge.cooleshow.biz.dal.dao.ActivityRewardChangeStockDao;
 import com.yonge.cooleshow.biz.dal.dto.ActivityPlanDto;
 import com.yonge.cooleshow.biz.dal.dto.ActivityPlanRewardDto;
+import com.yonge.cooleshow.biz.dal.dto.SaveOrUpdateRewardDto;
 import com.yonge.cooleshow.biz.dal.dto.req.OrderPayReq;
 import com.yonge.cooleshow.biz.dal.dto.search.OrderSearch;
 import com.yonge.cooleshow.biz.dal.entity.ActivityPlanEvaluation;
@@ -470,12 +471,18 @@ public class ActivityPlanServiceImpl extends ServiceImpl<ActivityPlanDao, Activi
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public Boolean saveOrUpdateReward(List<ActivityPlanRewardDto> updateRewardDtoList) {
-        Long activityId = updateRewardDtoList.get(0).getActivityId();
+    public Boolean saveOrUpdateReward(SaveOrUpdateRewardDto saveOrUpdateRewardDto) {
+        Long activityId = saveOrUpdateRewardDto.getActivityId();
+        List<ActivityPlanRewardDto> updateRewardDtoList = saveOrUpdateRewardDto.getUpdateRewardDtoList();
+
+        if(CollectionUtils.isNotEmpty(updateRewardDtoList)){
+            updateRewardDtoList = new ArrayList<>();
+        }
 
         for (ActivityPlanRewardDto rewardDto : updateRewardDtoList) {
             activityPlanRewardService.saveOrUpdateReward(rewardDto);
         }
+
         //还有删除的
         List<Long> rewardIds = updateRewardDtoList.stream().map(ActivityPlanRewardDto::getRewardId).collect(Collectors.toList());
         List<ActivityPlanReward> delList = activityPlanRewardService.getDelRewardList(activityId, rewardIds);

+ 4 - 3
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/StudentServiceImpl.java

@@ -31,6 +31,7 @@ import com.yonge.cooleshow.biz.dal.entity.Student;
 import com.yonge.cooleshow.biz.dal.dao.StudentDao;
 import com.yonge.cooleshow.biz.dal.service.StudentService;
 
+import javax.annotation.Resource;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
 
@@ -43,11 +44,11 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, Student> impleme
     private StudentTotalService totalService;
     @Autowired
     private ImUserFriendService imUserFriendService;
-    @Autowired
+    @Resource
     private UserBindingTeacherDao userBindingTeacherDao;
     @Autowired
     private StudentService studentService;
-    @Autowired
+    @Resource
     private TeacherDao teacherDao;
 
     @Override
@@ -172,7 +173,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, Student> impleme
         if (null == detail) {
             return HttpResponseResult.failed("未找老师信息");
         }
-        if (UserLockFlag.LOCK.equals(detail.getLockFlag())) {
+        if (UserLockFlag.LOCKED.equals(detail.getLockFlag())) {
             return HttpResponseResult.failed("老师被锁定");
         }
         if (null == old || (null != isUpdate && isUpdate)) {

+ 10 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TeacherAuthEntryRecordServiceImpl.java

@@ -59,7 +59,11 @@ public class TeacherAuthEntryRecordServiceImpl extends ServiceImpl<TeacherAuthEn
 
     @Override
     public TeacherAuthEntryRecordVo detail(Long id) {
-        return baseMapper.detail(id);
+        TeacherAuthEntryRecordVo detail = baseMapper.detail(id);
+        //查询上一次的提交
+        TeacherAuthEntryRecordVo lastDetil = baseMapper.lastDetil(id,detail.getUserId());
+        detail.setLastDetil(lastDetil);
+        return detail;
     }
 
     @Override
@@ -68,6 +72,11 @@ public class TeacherAuthEntryRecordServiceImpl extends ServiceImpl<TeacherAuthEn
     }
 
     @Override
+    public IPage<TeacherAuthEntryRecordVo> historyPage(IPage<TeacherAuthEntryRecordVo> page, AuthEntryRecordSearch search) {
+        return page.setRecords(baseMapper.historyPage(page, search));
+    }
+
+    @Override
     @Transactional(rollbackFor = Exception.class)
     public HttpResponseResult<Boolean> doAuth(AuthOperaReq authOperaReq, SysUser sysUser) throws Exception {
         Long[] ids = StringUtil.toLongArray(StringPool.COMMA, authOperaReq.getId());

+ 11 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/TeacherAuthEntryRecordVo.java

@@ -34,6 +34,9 @@ public class TeacherAuthEntryRecordVo extends TeacherAuthEntryRecord {
     @ApiModelProperty("用户名")
     private String username;
 
+    @ApiModelProperty("上一次的审核对象")
+    private TeacherAuthEntryRecordVo lastDetil;
+
     public String getUsername() {
         return username;
     }
@@ -70,8 +73,6 @@ public class TeacherAuthEntryRecordVo extends TeacherAuthEntryRecord {
         }
     }
 
-    
-
     public String getPhone() {
         return phone;
     }
@@ -95,4 +96,12 @@ public class TeacherAuthEntryRecordVo extends TeacherAuthEntryRecord {
     public void setVerifyUser(String verifyUser) {
         this.verifyUser = verifyUser;
     }
+
+    public TeacherAuthEntryRecordVo getLastDetil() {
+        return lastDetil;
+    }
+
+    public void setLastDetil(TeacherAuthEntryRecordVo lastDetil) {
+        this.lastDetil = lastDetil;
+    }
 }

+ 97 - 20
cooleshow-user/user-biz/src/main/resources/config/mybatis/TeacherAuthEntryRecordMapper.xml

@@ -40,6 +40,46 @@
         , t.update_time_ as "updateTime"
         </sql>
 
+    <select id="detail" resultType="com.yonge.cooleshow.biz.dal.vo.TeacherAuthEntryRecordVo">
+        select
+            <include refid="baseColumns"/>,
+            ifnull(u.real_name_,u.username_) as realName,
+            u.id_card_no_ as idCardNo,
+            u.phone_ as phone,
+            u.username_ as username,
+            u.gender_ as gender,
+            (
+                SELECT GROUP_CONCAT(name_ ORDER by locate(id_,t.subject_id_)) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
+            ) as subjectName,
+            (
+                SELECT u.username_ FROM sys_user u WHERE u.id_ = t.verify_user_id_
+            ) as verifyUser
+        from teacher_auth_entry_record t
+        left join sys_user u on t.user_id_ = u.id_
+        where u.del_flag_ = 0 and t.id_ = #{id}
+    </select>
+
+    <select id="lastDetil" resultType="com.yonge.cooleshow.biz.dal.vo.TeacherAuthEntryRecordVo">
+        select
+            <include refid="baseColumns"/>,
+            ifnull(u.real_name_,u.username_) as realName,
+            u.id_card_no_ as idCardNo,
+            u.phone_ as phone,
+            u.username_ as username,
+            u.gender_ as gender,
+            (
+                SELECT GROUP_CONCAT(name_ ORDER by locate(id_,t.subject_id_)) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
+            ) as subjectName,
+            (
+                SELECT u.username_ FROM sys_user u WHERE u.id_ = t.verify_user_id_
+            ) as verifyUser
+        from teacher_auth_entry_record t
+        left join sys_user u on t.user_id_ = u.id_
+        where u.del_flag_ = 0 and t.user_id_ = #{userId}
+            and t.id_ != #{id}
+        order by t.create_time_ desc limit 1
+    </select>
+
     <!-- 分页查询 -->
     <select id="selectPage" resultType = "com.yonge.cooleshow.biz.dal.vo.TeacherAuthEntryRecordVo">
         SELECT
@@ -53,52 +93,89 @@
             (
                 SELECT GROUP_CONCAT(name_ ORDER by locate(id_,t.subject_id_)) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
             ) as subjectName
-        FROM teacher_auth_entry_record t
+        FROM (
+            select user_id_,max(id_) as id_ from teacher_auth_entry_record group by user_id_
+        ) a
+        left join teacher_auth_entry_record t on a.id_ = t.id_
         left join sys_user u on t.user_id_ = u.id_
         left join sys_user v on t.verify_user_id_ = v.id_
         <where>
             u.del_flag_ = 0
             <if test="null != param.search and '' != param.search">
                 AND (
-                    t.user_id_ LIKE CONCAT('%', #{param.search}, '%') or
-                    u.real_name_ LIKE CONCAT('%', #{param.search}, '%') or
-                    u.phone_ LIKE CONCAT('%', #{param.search}, '%')
+                t.user_id_ LIKE CONCAT('%', #{param.search}, '%') or
+                u.real_name_ LIKE CONCAT('%', #{param.search}, '%') or
+                u.phone_ LIKE CONCAT('%', #{param.search}, '%')
                 )
             </if>
+            <if test="null != param.userId">
+                AND t.user_id_ = #{param.userId}
+            </if>
             <if test="null != param.verifyUser and '' != param.verifyUser">
                 AND v.username_ LIKE CONCAT('%', #{param.verifyUser}, '%')
             </if>
-            <if test="param.startTime !=null">
+            <if test="param.startTime != null">
                 <![CDATA[AND t.create_time_ >= #{param.startTime} ]]>
             </if>
-            <if test="param.endTime !=null">
+            <if test="param.endTime != null">
                 <![CDATA[AND t.create_time_ < #{param.endTime} ]]>
             </if>
-            <if test="param.authStatus !=null">
+            <if test="param.authStatus != null">
                 AND t.teacher_auth_status_ = #{param.authStatus}
             </if>
+            <if test="param.teacherAuthType != null">
+                AND t.teacher_auth_type_ = #{param.teacherAuthType}
+            </if>
         </where>
         order by field(t.teacher_auth_status_,'DOING') desc, t.create_time_ desc
     </select>
 
-    <select id="detail" resultType="com.yonge.cooleshow.biz.dal.vo.TeacherAuthEntryRecordVo">
-        select
-        	<include refid="baseColumns"/>,
+    <select id="historyPage" resultType="com.yonge.cooleshow.biz.dal.vo.TeacherAuthEntryRecordVo">
+        SELECT
+            <include refid="baseColumns"/>,
             ifnull(u.real_name_,u.username_) as realName,
-			u.id_card_no_ as idCardNo,
-			u.phone_ as phone,
+            u.id_card_no_ as idCardNo,
+            u.phone_ as phone,
             u.username_ as username,
-			u.gender_ as gender,
-			(
-                SELECT GROUP_CONCAT(name_ ORDER by locate(id_,t.subject_id_)) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
-            ) as subjectName,
+            u.gender_ as gender,
+            v.username_ as verifyUser,
             (
-                SELECT u.username_ FROM sys_user u WHERE u.id_ = t.verify_user_id_
-            ) as verifyUser
-        from teacher_auth_entry_record t
+                SELECT GROUP_CONCAT(name_ ORDER by locate(id_,t.subject_id_)) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
+            ) as subjectName
+        FROM teacher_auth_entry_record t
         left join sys_user u on t.user_id_ = u.id_
-        where u.del_flag_ = 0 and t.id_ = #{id}
+        left join sys_user v on t.verify_user_id_ = v.id_
+        <where>
+            u.del_flag_ = 0
+            <if test="null != param.search and '' != param.search">
+                AND (
+                t.user_id_ LIKE CONCAT('%', #{param.search}, '%') or
+                u.real_name_ LIKE CONCAT('%', #{param.search}, '%') or
+                u.phone_ LIKE CONCAT('%', #{param.search}, '%')
+                )
+            </if>
+            <if test="null != param.userId">
+                AND t.user_id_ = #{param.userId}
+            </if>
+            <if test="null != param.verifyUser and '' != param.verifyUser">
+                AND v.username_ LIKE CONCAT('%', #{param.verifyUser}, '%')
+            </if>
+            <if test="param.startTime != null">
+                <![CDATA[AND t.create_time_ >= #{param.startTime} ]]>
+            </if>
+            <if test="param.endTime != null">
+                <![CDATA[AND t.create_time_ < #{param.endTime} ]]>
+            </if>
+            <if test="param.authStatus != null">
+                AND t.teacher_auth_status_ = #{param.authStatus}
+            </if>
+            <if test="param.teacherAuthType != null">
+                AND t.teacher_auth_type_ = #{param.teacherAuthType}
+            </if>
+        </where>
+        order by field(t.teacher_auth_status_,'DOING') desc, t.create_time_ desc
     </select>
+
     <select id="getLastRecordByUserId" resultType="com.yonge.cooleshow.biz.dal.vo.TeacherAuthEntryRecordVo">
         select
             <include refid="baseColumns"/>,