增加代理商,活动,代理商员工关,代理商活动参与者相关功能

This commit is contained in:
Wang 2025-12-30 11:52:08 +08:00
parent 1c8a002d95
commit f1262aed51
14 changed files with 599 additions and 7 deletions

View File

@ -0,0 +1,50 @@
package com.seer.teach.mp.admin.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.seer.teach.common.PageListBean;
import com.seer.teach.common.ResultBean;
import com.seer.teach.common.annotation.LogPrint;
import com.seer.teach.mp.admin.controller.req.AgentActivityLogQueryReq;
import com.seer.teach.mp.admin.controller.resp.AdminAgentActivityLogResp;
import com.seer.teach.mp.admin.service.IAdminAgentActivityLogService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@LogPrint
@RequiredArgsConstructor
@RestController
@Tag(name = "管理端 - 代理商活动操作日志")
@RequestMapping("/mp/agent/activity/log")
public class AdminAgentActivityLogController {
private final IAdminAgentActivityLogService adminAgentActivityLogService;
@Operation(summary = "代理商活动操作日志列表")
@GetMapping("/page-list")
@SaCheckPermission("mp:admin:agent:activity:log:list")
public ResultBean<PageListBean<AdminAgentActivityLogResp>> pageList(AgentActivityLogQueryReq query) {
return ResultBean.success(adminAgentActivityLogService.pageList(query));
}
@Operation(summary = "详情")
@GetMapping("/{id}")
@SaCheckPermission("mp:admin:agent:activity:log:get")
public ResultBean<AdminAgentActivityLogResp> getLog(@PathVariable Integer id) {
return ResultBean.success(adminAgentActivityLogService.getById(id));
}
@Operation(summary = "删除")
@DeleteMapping
@SaCheckPermission("mp:admin:agent:activity:log:delete")
public ResultBean<Boolean> delete(@RequestBody List<Integer> ids) {
boolean result = true;
for (Integer id : ids) {
result &= adminAgentActivityLogService.deleteLog(id);
}
return ResultBean.success(result);
}
}

View File

@ -0,0 +1,72 @@
package com.seer.teach.mp.admin.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.seer.teach.common.PageListBean;
import com.seer.teach.common.ResultBean;
import com.seer.teach.common.annotation.LogPrint;
import com.seer.teach.mp.admin.controller.req.AgentActivityParticipantQueryReq;
import com.seer.teach.mp.admin.controller.resp.AdminAgentActivityParticipantResp;
import com.seer.teach.mp.admin.service.IAdminAgentActivityParticipantService;
import com.seer.teach.mp.entity.MpAgentActivityParticipantEntity;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@LogPrint
@RequiredArgsConstructor
@RestController
@Tag(name = "管理端 - 代理商活动参与记录")
@RequestMapping("/mp/agent/activity/participant")
public class AdminAgentActivityParticipantController {
private final IAdminAgentActivityParticipantService adminAgentActivityParticipantService;
@Operation(summary = "代理商活动参与记录列表")
@GetMapping("/page-list")
@SaCheckPermission("mp:admin:agent:activity:participant:list")
public ResultBean<PageListBean<AdminAgentActivityParticipantResp>> pageList(AgentActivityParticipantQueryReq query) {
return ResultBean.success(adminAgentActivityParticipantService.pageList(query));
}
@Operation(summary = "详情")
@GetMapping("/{id}")
@SaCheckPermission("mp:admin:agent:activity:participant:get")
public ResultBean<AdminAgentActivityParticipantResp> getParticipant(@PathVariable Integer id) {
return ResultBean.success(adminAgentActivityParticipantService.getById(id));
}
@Operation(summary = "新增")
@PostMapping
@SaCheckPermission("mp:admin:agent:activity:participant:save")
public ResultBean<Boolean> save(@RequestBody MpAgentActivityParticipantEntity participantEntity) {
return ResultBean.success(adminAgentActivityParticipantService.saveParticipant(participantEntity));
}
@Operation(summary = "更新")
@PutMapping
@SaCheckPermission("mp:admin:agent:activity:participant:update")
public ResultBean<Boolean> update(@RequestBody MpAgentActivityParticipantEntity participantEntity) {
return ResultBean.success(adminAgentActivityParticipantService.updateParticipant(participantEntity));
}
@Operation(summary = "删除")
@DeleteMapping
@SaCheckPermission("mp:admin:agent:activity:participant:delete")
public ResultBean<Boolean> delete(@RequestBody List<Integer> ids) {
boolean result = true;
for (Integer id : ids) {
result &= adminAgentActivityParticipantService.deleteParticipant(id);
}
return ResultBean.success(result);
}
}

View File

@ -0,0 +1,44 @@
package com.seer.teach.mp.admin.controller.req;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 代理商活动操作日志查询请求对象
*
* @author
* @since 2025-12-30
*/
@Data
@Schema(name = "代理商活动操作日志查询请求对象")
public class AgentActivityLogQueryReq {
@Min(value = 1, message = "页码必须大于0")
@Schema(description = "页码")
private Integer pageNum = 1;
@Min(value = 1, message = "每页数量必须大于0")
@Schema(description = "每页数量")
private Integer pageSize = 10;
@Schema(description = "活动ID")
private Integer activityId;
@Schema(description = "操作人ID")
private Integer operatorId;
@Schema(description = "操作类型")
private String operationType;
@Schema(description = "开始时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime startTime;
@Schema(description = "结束时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime endTime;
}

View File

@ -0,0 +1,33 @@
package com.seer.teach.mp.admin.controller.req;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import lombok.Data;
/**
* 代理商活动参与记录查询请求对象
*
* @author
* @since 2025-12-30
*/
@Data
@Schema(name = "代理商活动参与记录查询请求对象")
public class AgentActivityParticipantQueryReq {
@Min(value = 1, message = "页码必须大于0")
@Schema(description = "页码")
private Integer pageNum = 1;
@Min(value = 1, message = "每页数量必须大于0")
@Schema(description = "每页数量")
private Integer pageSize = 10;
@Schema(description = "活动ID")
private Integer activityId;
@Schema(description = "代理商ID")
private Integer agentId;
@Schema(description = "家长ID")
private Integer parentId;
}

View File

@ -0,0 +1,47 @@
package com.seer.teach.mp.admin.controller.resp;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 代理商活动操作日志响应对象
*
* @author
* @since 2025-12-30
*/
@Data
@Schema(name = "代理商活动操作日志响应对象")
public class AdminAgentActivityLogResp {
@Schema(description = "日志ID")
private Integer id;
@Schema(description = "活动ID")
private Integer activityId;
@Schema(description = "操作人ID")
private Integer operatorId;
@Schema(description = "操作类型")
private String operationType;
@Schema(description = "操作描述")
private String description;
@Schema(description = "操作前数据")
private String beforeData;
@Schema(description = "操作后数据")
private String afterData;
@Schema(description = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTime;
@Schema(description = "更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updateTime;
}

View File

@ -0,0 +1,35 @@
package com.seer.teach.mp.admin.controller.resp;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 代理商活动参与记录响应对象
*
* @author
* @since 2025-12-30
*/
@Data
@Schema(name = "代理商活动参与记录响应对象")
public class AdminAgentActivityParticipantResp {
@Schema(description = "参与记录ID")
private Integer id;
@Schema(description = "活动ID")
private Integer activityId;
@Schema(description = "代理商ID")
private Integer agentId;
@Schema(description = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTime;
@Schema(description = "更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updateTime;
}

View File

@ -10,9 +10,9 @@ import org.mapstruct.factory.Mappers;
import java.util.List; import java.util.List;
@Mapper @Mapper
public interface AdminAgentActivityConvert { public interface AdminActivityConvert {
AdminAgentActivityConvert INSTANCE = Mappers.getMapper(AdminAgentActivityConvert.class); AdminActivityConvert INSTANCE = Mappers.getMapper(AdminActivityConvert.class);
MpActivityEntity convert(MpActivityReq req); MpActivityEntity convert(MpActivityReq req);

View File

@ -0,0 +1,18 @@
package com.seer.teach.mp.admin.convert;
import com.seer.teach.mp.admin.controller.resp.AdminAgentActivityParticipantResp;
import com.seer.teach.mp.entity.MpAgentActivityParticipantEntity;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.List;
@Mapper
public interface AdminAgentActivityParticipantConvert {
AdminAgentActivityParticipantConvert INSTANCE = Mappers.getMapper(AdminAgentActivityParticipantConvert.class);
AdminAgentActivityParticipantResp convertToResp(MpAgentActivityParticipantEntity entity);
List<AdminAgentActivityParticipantResp> convertToRespList(List<MpAgentActivityParticipantEntity> entity);
}

View File

@ -0,0 +1,41 @@
package com.seer.teach.mp.admin.service;
import com.seer.teach.common.PageListBean;
import com.seer.teach.mp.admin.controller.req.AgentActivityLogQueryReq;
import com.seer.teach.mp.admin.controller.resp.AdminAgentActivityLogResp;
import com.seer.teach.mp.entity.MpAgentActivityLogEntity;
/**
* <p>
* 代理商活动操作日志表 管理端服务类
* </p>
*
* @author
* @since 2025-12-30
*/
public interface IAdminAgentActivityLogService {
/**
* 分页查询代理商活动操作日志列表管理端
*
* @param query 查询条件
* @return 代理商活动操作日志分页列表
*/
PageListBean<AdminAgentActivityLogResp> pageList(AgentActivityLogQueryReq query);
/**
* 根据ID获取代理商活动操作日志详情管理端
*
* @param id 日志ID
* @return 操作日志详情
*/
AdminAgentActivityLogResp getById(Integer id);
/**
* 根据ID删除代理商活动操作日志管理端
*
* @param id 日志ID
* @return 操作是否成功
*/
boolean deleteLog(Integer id);
}

View File

@ -0,0 +1,57 @@
package com.seer.teach.mp.admin.service;
import com.seer.teach.common.PageListBean;
import com.seer.teach.mp.admin.controller.req.AgentActivityParticipantQueryReq;
import com.seer.teach.mp.admin.controller.resp.AdminAgentActivityParticipantResp;
import com.seer.teach.mp.entity.MpAgentActivityParticipantEntity;
/**
* <p>
* 代理商活动参与记录表 管理端服务类
* </p>
*
* @author
* @since 2025-12-30
*/
public interface IAdminAgentActivityParticipantService {
/**
* 分页查询代理商活动参与记录列表管理端
*
* @param query 查询条件
* @return 代理商活动参与记录分页列表
*/
PageListBean<AdminAgentActivityParticipantResp> pageList(AgentActivityParticipantQueryReq query);
/**
* 创建代理商活动参与记录管理端
*
* @param entity 参与记录实体
* @return 操作是否成功
*/
boolean saveParticipant(MpAgentActivityParticipantEntity entity);
/**
* 更新代理商活动参与记录管理端
*
* @param entity 参与记录实体
* @return 操作是否成功
*/
boolean updateParticipant(MpAgentActivityParticipantEntity entity);
/**
* 根据ID删除代理商活动参与记录管理端
*
* @param id 参与记录ID
* @return 操作是否成功
*/
boolean deleteParticipant(Integer id);
/**
* 根据ID获取代理商活动参与记录详情管理端
*
* @param id 参与记录ID
* @return 参与记录详情
*/
AdminAgentActivityParticipantResp getById(Integer id);
}

View File

@ -8,7 +8,7 @@ import com.seer.teach.mp.admin.controller.req.MpActivityQueryReq;
import com.seer.teach.mp.admin.controller.req.MpActivityReq; import com.seer.teach.mp.admin.controller.req.MpActivityReq;
import com.seer.teach.mp.admin.controller.resp.AdminActivityResp; import com.seer.teach.mp.admin.controller.resp.AdminActivityResp;
import com.seer.teach.mp.admin.service.IAdminActivityService; import com.seer.teach.mp.admin.service.IAdminActivityService;
import com.seer.teach.mp.admin.convert.AdminAgentActivityConvert; import com.seer.teach.mp.admin.convert.AdminActivityConvert;
import com.seer.teach.mp.entity.MpActivityEntity; import com.seer.teach.mp.entity.MpActivityEntity;
import com.seer.teach.mp.service.IMpActivityService; import com.seer.teach.mp.service.IMpActivityService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -37,12 +37,12 @@ public class AdminActivityServiceImpl implements IAdminActivityService {
var pageResult = agentActivityService.page(page, new LambdaQueryWrapper<>(MpActivityEntity.class) var pageResult = agentActivityService.page(page, new LambdaQueryWrapper<>(MpActivityEntity.class)
.like(StringUtils.isNotBlank(query.getActivityName()), MpActivityEntity::getActivityName, query.getActivityName()) .like(StringUtils.isNotBlank(query.getActivityName()), MpActivityEntity::getActivityName, query.getActivityName())
.eq(Objects.nonNull(query.getStatus()), MpActivityEntity::getStatus, query.getStatus())); .eq(Objects.nonNull(query.getStatus()), MpActivityEntity::getStatus, query.getStatus()));
return PageConverterUtils.convertPageListBean(pageResult, AdminAgentActivityConvert.INSTANCE::convertToRespList); return PageConverterUtils.convertPageListBean(pageResult, AdminActivityConvert.INSTANCE::convertToRespList);
} }
@Override @Override
public boolean saveOrUpdateActivity(MpActivityReq request) { public boolean saveOrUpdateActivity(MpActivityReq request) {
MpActivityEntity entity = AdminAgentActivityConvert.INSTANCE.convert(request); MpActivityEntity entity = AdminActivityConvert.INSTANCE.convert(request);
return agentActivityService.saveOrUpdateActivity(entity); return agentActivityService.saveOrUpdateActivity(entity);
} }
@ -54,6 +54,6 @@ public class AdminActivityServiceImpl implements IAdminActivityService {
@Override @Override
public AdminActivityResp getById(Integer id) { public AdminActivityResp getById(Integer id) {
MpActivityEntity entity = agentActivityService.getById(id); MpActivityEntity entity = agentActivityService.getById(id);
return AdminAgentActivityConvert.INSTANCE.convertToResp(entity); return AdminActivityConvert.INSTANCE.convertToResp(entity);
} }
} }

View File

@ -0,0 +1,97 @@
package com.seer.teach.mp.admin.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.seer.teach.common.PageListBean;
import com.seer.teach.mp.admin.controller.req.AgentActivityLogQueryReq;
import com.seer.teach.mp.admin.controller.resp.AdminAgentActivityLogResp;
import com.seer.teach.mp.admin.service.IAdminAgentActivityLogService;
import com.seer.teach.mp.entity.MpAgentActivityLogEntity;
import com.seer.teach.mp.service.IMpAgentActivityLogService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 代理商活动操作日志表 管理端服务实现类
* </p>
*
* @author
* @since 2025-12-30
*/
@Service
@RequiredArgsConstructor
public class AdminAgentActivityLogServiceImpl implements IAdminAgentActivityLogService {
private final IMpAgentActivityLogService mpAgentActivityLogService;
@Override
public PageListBean<AdminAgentActivityLogResp> pageList(AgentActivityLogQueryReq query) {
Page<MpAgentActivityLogEntity> page = new Page<>(query.getPageNum(), query.getPageSize());
LambdaQueryWrapper<MpAgentActivityLogEntity> wrapper = new LambdaQueryWrapper<>();
// 根据活动ID查询
if (query.getActivityId() != null) {
wrapper.eq(MpAgentActivityLogEntity::getActivityId, query.getActivityId());
}
// 根据操作人ID查询
if (query.getOperatorId() != null) {
wrapper.eq(MpAgentActivityLogEntity::getOperatorId, query.getOperatorId());
}
// 根据操作类型查询
if (query.getOperationType() != null && !query.getOperationType().isEmpty()) {
wrapper.eq(MpAgentActivityLogEntity::getOperationType, query.getOperationType());
}
// 根据创建时间范围查询
if (query.getStartTime() != null) {
wrapper.ge(MpAgentActivityLogEntity::getCreateTime, query.getStartTime());
}
if (query.getEndTime() != null) {
wrapper.le(MpAgentActivityLogEntity::getCreateTime, query.getEndTime());
}
IPage<MpAgentActivityLogEntity> result = mpAgentActivityLogService.page(page, wrapper);
// 转换为响应对象
List<AdminAgentActivityLogResp> records = result.getRecords().stream()
.map(this::convertToResp)
.toList();
return new PageListBean<>(result.getTotal(), records);
}
@Override
public AdminAgentActivityLogResp getById(Integer id) {
MpAgentActivityLogEntity entity = mpAgentActivityLogService.getById(id);
return convertToResp(entity);
}
@Override
public boolean deleteLog(Integer id) {
return mpAgentActivityLogService.removeById(id);
}
/**
* 将实体转换为响应对象
*/
private AdminAgentActivityLogResp convertToResp(MpAgentActivityLogEntity entity) {
AdminAgentActivityLogResp resp = new AdminAgentActivityLogResp();
resp.setId(entity.getId());
resp.setActivityId(entity.getActivityId());
resp.setOperatorId(entity.getOperatorId());
resp.setOperationType(entity.getOperationType());
resp.setDescription(entity.getDescription());
resp.setBeforeData(entity.getBeforeData());
resp.setAfterData(entity.getAfterData());
resp.setCreateTime(entity.getCreateTime());
resp.setUpdateTime(entity.getUpdateTime());
return resp;
}
}

View File

@ -0,0 +1,99 @@
package com.seer.teach.mp.admin.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.seer.teach.common.PageListBean;
import com.seer.teach.common.utils.PageConverterUtils;
import com.seer.teach.mp.admin.controller.req.AgentActivityParticipantQueryReq;
import com.seer.teach.mp.admin.controller.resp.AdminAgentActivityParticipantResp;
import com.seer.teach.mp.admin.convert.AdminAgentActivityParticipantConvert;
import com.seer.teach.mp.admin.service.IAdminAgentActivityParticipantService;
import com.seer.teach.mp.entity.MpAgentActivityParticipantEntity;
import com.seer.teach.mp.mapper.MpAgentActivityParticipantMapper;
import com.seer.teach.mp.service.IMpAgentActivityParticipantService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.List;
/**
* <p>
* 代理商活动参与记录表 管理端服务实现类
* </p>
*
* @author
* @since 2025-12-30
*/
@Service
@RequiredArgsConstructor
public class AdminAgentActivityParticipantServiceImpl implements IAdminAgentActivityParticipantService {
private final IMpAgentActivityParticipantService mpAgentActivityParticipantService;
@Override
public PageListBean<AdminAgentActivityParticipantResp> pageList(AgentActivityParticipantQueryReq query) {
Page<MpAgentActivityParticipantEntity> page = new Page<>(query.getPageNum(), query.getPageSize());
LambdaQueryWrapper<MpAgentActivityParticipantEntity> wrapper = new LambdaQueryWrapper<>();
// 根据活动ID查询
if (query.getActivityId() != null) {
wrapper.eq(MpAgentActivityParticipantEntity::getActivityId, query.getActivityId());
}
// 根据代理商ID查询
if (query.getAgentId() != null) {
wrapper.eq(MpAgentActivityParticipantEntity::getAgentId, query.getAgentId());
}
IPage<MpAgentActivityParticipantEntity> result = mpAgentActivityParticipantService.page(page, wrapper);
return PageConverterUtils.convertPageListBean(result, AdminAgentActivityParticipantConvert.INSTANCE::convertToRespList);
}
@Override
public boolean saveParticipant(MpAgentActivityParticipantEntity entity) {
// 检查是否已存在相同的活动代理商和家长记录
LambdaQueryWrapper<MpAgentActivityParticipantEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(MpAgentActivityParticipantEntity::getActivityId, entity.getActivityId())
.eq(MpAgentActivityParticipantEntity::getAgentId, entity.getAgentId())
.eq(MpAgentActivityParticipantEntity::getParentId, entity.getParentId());
long count = mpAgentActivityParticipantService.count(wrapper);
if (count > 0) {
throw new RuntimeException("该代理商活动参与记录已存在");
}
return mpAgentActivityParticipantService.save(entity);
}
@Override
public boolean updateParticipant(MpAgentActivityParticipantEntity entity) {
// 检查是否存在相同的活动代理商和家长记录排除当前记录
LambdaQueryWrapper<MpAgentActivityParticipantEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(MpAgentActivityParticipantEntity::getActivityId, entity.getActivityId())
.eq(MpAgentActivityParticipantEntity::getAgentId, entity.getAgentId())
.eq(MpAgentActivityParticipantEntity::getParentId, entity.getParentId())
.ne(MpAgentActivityParticipantEntity::getId, entity.getId());
long count = mpAgentActivityParticipantService.count(wrapper);
if (count > 0) {
throw new RuntimeException("该代理商活动参与记录已存在");
}
return mpAgentActivityParticipantService.updateById(entity);
}
@Override
public boolean deleteParticipant(Integer id) {
return mpAgentActivityParticipantService.removeById(id);
}
@Override
public AdminAgentActivityParticipantResp getById(Integer id) {
MpAgentActivityParticipantEntity entity = mpAgentActivityParticipantService.getById(id);
return AdminAgentActivityParticipantConvert.INSTANCE.convertToResp(entity);
}
}

View File

@ -59,7 +59,6 @@ CREATE TABLE `mp_agent_activity_participants` (
`id` int NOT NULL AUTO_INCREMENT COMMENT '参与记录ID', `id` int NOT NULL AUTO_INCREMENT COMMENT '参与记录ID',
`activity_id` int NOT NULL COMMENT '活动ID', `activity_id` int NOT NULL COMMENT '活动ID',
`agent_id` int NOT NULL COMMENT '代理商ID', `agent_id` int NOT NULL COMMENT '代理商ID',
`parent_id` int NOT NULL COMMENT '家长ID对应user表的ID',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`create_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '创建人', `create_by` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_german2_ci NULL DEFAULT NULL COMMENT '创建人',
`update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间', `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',