zhangbin před 4 roky
rodič
revize
354c74f766

+ 107 - 0
hzgzpt-admin/src/main/java/com/miaxis/app/controller/coach/CoachInfoController.java

@@ -0,0 +1,107 @@
+package com.miaxis.app.controller.coach;
+
+import com.miaxis.app.coach.domain.CoachInfo;
+import com.miaxis.app.coach.service.ICoachInfoService;
+import com.miaxis.common.annotation.Log;
+import com.miaxis.common.core.controller.BaseController;
+import com.miaxis.common.core.domain.Response;
+import com.miaxis.common.core.page.ResponsePageInfo;
+import com.miaxis.common.enums.BusinessTypeEnum;
+import com.miaxis.common.utils.poi.ExcelUtil;
+import io.swagger.annotations.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 【教练】Controller
+ *
+ * @author miaxis
+ * @date 2021-01-07
+ */
+@RestController
+@RequestMapping("/coach/info")
+@Api(tags={"【app-教练】"})
+public class CoachInfoController extends BaseController{
+    @Autowired
+    private ICoachInfoService coachInfoService;
+
+    /**
+     * 查询教练列表
+     */
+    //@PreAuthorize("@ss.hasPermi('coach:info:list')")
+    @GetMapping("/list")
+    @ApiOperation("查询教练列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
+            @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
+    })
+    public ResponsePageInfo<CoachInfo> list(@ModelAttribute CoachInfo coachInfo){
+        startPage();
+        List<CoachInfo> list = coachInfoService.selectCoachInfoList(coachInfo);
+        return toResponsePageInfo(list);
+    }
+
+    /**
+     * 导出教练列表
+     */
+   // @PreAuthorize("@ss.hasPermi('coach:info:export')")
+    @Log(title = "教练", businessType = BusinessTypeEnum.EXPORT)
+    @GetMapping("/export")
+    @ApiOperation("导出教练列表Excel")
+    public Response<String> export(@ModelAttribute CoachInfo coachInfo){
+        List<CoachInfo> list = coachInfoService.selectCoachInfoList(coachInfo);
+        ExcelUtil<CoachInfo> util = new ExcelUtil<CoachInfo>(CoachInfo.class);
+        return util.exportExcel(list, "info");
+    }
+
+    /**
+     * 获取教练详细信息
+     */
+    //@PreAuthorize("@ss.hasPermi('coach:info:query')")
+    @GetMapping(value = "/{coachnum}")
+    @ApiOperation("获取教练详细信息")
+    public Response<CoachInfo> getInfo(
+            @ApiParam(name = "coachnum", value = "教练参数", required = true)
+            @PathVariable("coachnum") String coachnum
+    ){
+        return Response.success(coachInfoService.selectCoachInfoById(coachnum));
+    }
+
+    /**
+     * 新增教练
+     */
+    //@PreAuthorize("@ss.hasPermi('coach:info:add')")
+    @Log(title = "教练", businessType = BusinessTypeEnum.INSERT)
+    @PostMapping
+    @ApiOperation("新增教练")
+    public Response<Integer> add(@RequestBody CoachInfo coachInfo){
+        return toResponse(coachInfoService.insertCoachInfo(coachInfo));
+    }
+
+    /**
+     * 修改教练
+     */
+    //@PreAuthorize("@ss.hasPermi('coach:info:edit')")
+    @Log(title = "教练", businessType = BusinessTypeEnum.UPDATE)
+    @PutMapping
+    @ApiOperation("修改教练")
+    public Response<Integer> edit(@RequestBody CoachInfo coachInfo){
+        return toResponse(coachInfoService.updateCoachInfo(coachInfo));
+    }
+
+    /**
+     * 删除教练
+     */
+    //@PreAuthorize("@ss.hasPermi('coach:info:remove')")
+    @Log(title = "教练", businessType = BusinessTypeEnum.DELETE)
+	@DeleteMapping("/{coachnums}")
+    @ApiOperation("删除教练")
+    public  Response<Integer> remove(
+            @ApiParam(name = "coachnums", value = "教练ids参数", required = true)
+            @PathVariable String[] coachnums
+    ){
+        return toResponse(coachInfoService.deleteCoachInfoByIds(coachnums));
+    }
+}

+ 3 - 3
hzgzpt-service-app/src/main/java/com/miaxis/app/coach/domain/CoachEvaluate.java

@@ -45,15 +45,15 @@ public class CoachEvaluate extends BaseBusinessEntity {
 
     /** 场地星级 */
     @Excel(name = "场地星级")
-    @TableField("area_starts")
+    @TableField("area_stars")
     @ApiModelProperty(value = "场地星级")
-    private Long areaStarts;
+    private Long areaStars;
 
     /** 总体星级1-5 */
     @Excel(name = "总体星级1-5")
     @TableField("totel_starts")
     @ApiModelProperty(value = "总体星级1-5")
-    private Long totelStarts;
+    private Long totelStars;
 
     /** 评价内容 */
     @Excel(name = "评价内容")

+ 263 - 0
hzgzpt-service-app/src/main/java/com/miaxis/app/coach/domain/CoachInfo.java

@@ -0,0 +1,263 @@
+package com.miaxis.app.coach.domain;
+
+import com.miaxis.common.core.domain.BaseBusinessEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.miaxis.common.annotation.Excel;
+import com.miaxis.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+/**
+ * 教练对象 coach_info
+ *
+ * @author miaxis
+ * @date 2021-01-07
+ */
+@Data
+@TableName("coach_info")
+@ApiModel(value = "CoachInfo", description = "教练对象 coach_info")
+public class CoachInfo extends BaseBusinessEntity {
+    private static final long serialVersionUID = 1L;
+
+    /** 教练员全国统一编号 */
+    @TableId(value = "coachnum")
+    @ApiModelProperty(value = "教练员全国统一编号")
+    private String coachnum;
+
+    /** 教练员性名 */
+    @Excel(name = "教练员性名")
+    @TableField("name")
+    @ApiModelProperty(value = "教练员性名")
+    private String name;
+
+    /** 性别 :1男  2女 */
+    @Excel(name = "性别 :1男  2女")
+    @TableField("sex")
+    @ApiModelProperty(value = "性别 :1男  2女")
+    private Long sex;
+
+    /** 驾校全国统一编号 */
+    @Excel(name = "驾校全国统一编号")
+    @TableField("inscode")
+    @ApiModelProperty(value = "驾校全国统一编号")
+    private String inscode;
+
+    /** 身份证明号码 */
+    @Excel(name = "身份证明号码")
+    @TableField("idcard")
+    @ApiModelProperty(value = "身份证明号码")
+    private String idcard;
+
+    /** 手机号码 */
+    @Excel(name = "手机号码")
+    @TableField("mobile")
+    @ApiModelProperty(value = "手机号码")
+    private String mobile;
+
+    /** 地址 */
+    @Excel(name = "地址")
+    @TableField("address")
+    @ApiModelProperty(value = "地址")
+    private String address;
+
+    /** 教练员头像ID */
+    @Excel(name = "教练员头像ID")
+    @TableField("photo")
+    @ApiModelProperty(value = "教练员头像ID")
+    private Long photo;
+
+    /** 准驾车型 */
+    @Excel(name = "准驾车型")
+    @TableField("dripermitted")
+    @ApiModelProperty(value = "准驾车型")
+    private String dripermitted;
+
+    /** 准教车型 */
+    @Excel(name = "准教车型")
+    @TableField("teachpermitted")
+    @ApiModelProperty(value = "准教车型")
+    private String teachpermitted;
+
+    /** 地区编号 */
+    @Excel(name = "地区编号")
+    @TableField("district")
+    @ApiModelProperty(value = "地区编号")
+    private String district;
+
+    /** 供职状态:0:在职 1离职
+            1:离职
+            供职状态:0:在职
+            1:离职
+            
+            1:离职
+             */
+    @Excel(name = "供职状态:0:在职 1离职")
+    @TableField("employstatus")
+    @ApiModelProperty(value = "供职状态:0:在职 1离职")
+    private Long employstatus;
+    /** 停训 1-停训 0-启用 */
+    @Excel(name = "停训 1-停训 0-启用")
+    @TableField("stop_train")
+    @ApiModelProperty(value = "停训 1-停训 0-启用")
+    private Long stopTrain;
+
+    /** 微信号 */
+    @Excel(name = "微信号")
+    @TableField("wechar")
+    @ApiModelProperty(value = "微信号")
+    private String wechar;
+
+    /** 微信openid */
+    @Excel(name = "微信openid")
+    @TableField("openid")
+    @ApiModelProperty(value = "微信openid")
+    private String openid;
+
+    /** 点赞数 */
+    @Excel(name = "点赞数")
+    @TableField("fabulous")
+    @ApiModelProperty(value = "点赞数")
+    private Long fabulous;
+
+    public void setCoachnum(String coachnum){
+        this.coachnum = coachnum;
+    }
+
+    public String getCoachnum(){
+        return coachnum;
+    }
+    public void setName(String name){
+        this.name = name;
+    }
+
+    public String getName(){
+        return name;
+    }
+    public void setSex(Long sex){
+        this.sex = sex;
+    }
+
+    public Long getSex(){
+        return sex;
+    }
+    public void setInscode(String inscode){
+        this.inscode = inscode;
+    }
+
+    public String getInscode(){
+        return inscode;
+    }
+    public void setIdcard(String idcard){
+        this.idcard = idcard;
+    }
+
+    public String getIdcard(){
+        return idcard;
+    }
+    public void setMobile(String mobile){
+        this.mobile = mobile;
+    }
+
+    public String getMobile(){
+        return mobile;
+    }
+    public void setAddress(String address){
+        this.address = address;
+    }
+
+    public String getAddress(){
+        return address;
+    }
+    public void setPhoto(Long photo){
+        this.photo = photo;
+    }
+
+    public Long getPhoto(){
+        return photo;
+    }
+    public void setDripermitted(String dripermitted){
+        this.dripermitted = dripermitted;
+    }
+
+    public String getDripermitted(){
+        return dripermitted;
+    }
+    public void setTeachpermitted(String teachpermitted){
+        this.teachpermitted = teachpermitted;
+    }
+
+    public String getTeachpermitted(){
+        return teachpermitted;
+    }
+    public void setDistrict(String district){
+        this.district = district;
+    }
+
+    public String getDistrict(){
+        return district;
+    }
+    public void setEmploystatus(Long employstatus){
+        this.employstatus = employstatus;
+    }
+
+    public Long getEmploystatus(){
+        return employstatus;
+    }
+    public void setStopTrain(Long stopTrain){
+        this.stopTrain = stopTrain;
+    }
+
+    public Long getStopTrain(){
+        return stopTrain;
+    }
+    public void setWechar(String wechar){
+        this.wechar = wechar;
+    }
+
+    public String getWechar(){
+        return wechar;
+    }
+    public void setOpenid(String openid){
+        this.openid = openid;
+    }
+
+    public String getOpenid(){
+        return openid;
+    }
+    public void setFabulous(Long fabulous){
+        this.fabulous = fabulous;
+    }
+
+    public Long getFabulous(){
+        return fabulous;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("coachnum", getCoachnum())
+            .append("name", getName())
+            .append("sex", getSex())
+            .append("inscode", getInscode())
+            .append("idcard", getIdcard())
+            .append("mobile", getMobile())
+            .append("address", getAddress())
+            .append("photo", getPhoto())
+            .append("dripermitted", getDripermitted())
+            .append("teachpermitted", getTeachpermitted())
+            .append("district", getDistrict())
+            .append("employstatus", getEmploystatus())
+            .append("stopTrain", getStopTrain())
+            .append("wechar", getWechar())
+            .append("openid", getOpenid())
+            .append("createTime", getCreateTime())
+            .append("updateTime", getUpdateTime())
+            .append("fabulous", getFabulous())
+            .toString();
+    }
+}

+ 61 - 0
hzgzpt-service-app/src/main/java/com/miaxis/app/coach/mapper/CoachInfoMapper.java

@@ -0,0 +1,61 @@
+package com.miaxis.app.coach.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.miaxis.app.coach.domain.CoachInfo;
+
+/**
+ * 教练Mapper接口
+ *
+ * @author miaxis
+ * @date 2021-01-07
+ */
+public interface CoachInfoMapper extends BaseMapper<CoachInfo> {
+    /**
+     * 查询教练
+     *
+     * @param coachnum 教练ID
+     * @return 教练
+     */
+    public CoachInfo selectCoachInfoById(String coachnum);
+
+    /**
+     * 查询教练列表
+     *
+     * @param coachInfo 教练
+     * @return 教练集合
+     */
+    public List<CoachInfo> selectCoachInfoList(CoachInfo coachInfo);
+
+    /**
+     * 新增教练
+     *
+     * @param coachInfo 教练
+     * @return 结果
+     */
+    public int insertCoachInfo(CoachInfo coachInfo);
+
+    /**
+     * 修改教练
+     *
+     * @param coachInfo 教练
+     * @return 结果
+     */
+    public int updateCoachInfo(CoachInfo coachInfo);
+
+    /**
+     * 删除教练
+     *
+     * @param coachnum 教练ID
+     * @return 结果
+     */
+    public int deleteCoachInfoById(String coachnum);
+
+    /**
+     * 批量删除教练
+     *
+     * @param coachnums 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteCoachInfoByIds(String[] coachnums);
+}

+ 61 - 0
hzgzpt-service-app/src/main/java/com/miaxis/app/coach/service/ICoachInfoService.java

@@ -0,0 +1,61 @@
+package com.miaxis.app.coach.service;
+
+import java.util.List;
+import com.miaxis.app.coach.domain.CoachInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 教练Service接口
+ * 
+ * @author miaxis
+ * @date 2021-01-07
+ */
+public interface ICoachInfoService extends IService<CoachInfo>{
+    /**
+     * 查询教练
+     * 
+     * @param coachnum 教练ID
+     * @return 教练
+     */
+    public CoachInfo selectCoachInfoById(String coachnum);
+
+    /**
+     * 查询教练列表
+     * 
+     * @param coachInfo 教练
+     * @return 教练集合
+     */
+    public List<CoachInfo> selectCoachInfoList(CoachInfo coachInfo);
+
+    /**
+     * 新增教练
+     * 
+     * @param coachInfo 教练
+     * @return 结果
+     */
+    public int insertCoachInfo(CoachInfo coachInfo);
+
+    /**
+     * 修改教练
+     * 
+     * @param coachInfo 教练
+     * @return 结果
+     */
+    public int updateCoachInfo(CoachInfo coachInfo);
+
+    /**
+     * 批量删除教练
+     * 
+     * @param coachnums 需要删除的教练ID
+     * @return 结果
+     */
+    public int deleteCoachInfoByIds(String[] coachnums);
+
+    /**
+     * 删除教练信息
+     * 
+     * @param coachnum 教练ID
+     * @return 结果
+     */
+    public int deleteCoachInfoById(String coachnum);
+}

+ 90 - 0
hzgzpt-service-app/src/main/java/com/miaxis/app/coach/service/impl/CoachInfoServiceImpl.java

@@ -0,0 +1,90 @@
+package com.miaxis.app.coach.service.impl;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.miaxis.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.miaxis.app.coach.mapper.CoachInfoMapper;
+import com.miaxis.app.coach.domain.CoachInfo;
+import com.miaxis.app.coach.service.ICoachInfoService;
+
+/**
+ * 教练Service业务层处理
+ *
+ * @author miaxis
+ * @date 2021-01-07
+ */
+@Service
+public class CoachInfoServiceImpl extends ServiceImpl<CoachInfoMapper, CoachInfo> implements ICoachInfoService {
+    @Autowired
+    private CoachInfoMapper coachInfoMapper;
+
+    /**
+     * 查询教练
+     *
+     * @param coachnum 教练ID
+     * @return 教练
+     */
+    @Override
+    public CoachInfo selectCoachInfoById(String coachnum){
+        return coachInfoMapper.selectCoachInfoById(coachnum);
+    }
+
+    /**
+     * 查询教练列表
+     *
+     * @param coachInfo 教练
+     * @return 教练
+     */
+    @Override
+    public List<CoachInfo> selectCoachInfoList(CoachInfo coachInfo){
+        return coachInfoMapper.selectCoachInfoList(coachInfo);
+    }
+
+    /**
+     * 新增教练
+     *
+     * @param coachInfo 教练
+     * @return 结果
+     */
+    @Override
+    public int insertCoachInfo(CoachInfo coachInfo){
+        coachInfo.setCreateTime(DateUtils.getNowDate());
+        return coachInfoMapper.insertCoachInfo(coachInfo);
+    }
+
+    /**
+     * 修改教练
+     *
+     * @param coachInfo 教练
+     * @return 结果
+     */
+    @Override
+    public int updateCoachInfo(CoachInfo coachInfo){
+        coachInfo.setUpdateTime(DateUtils.getNowDate());
+        return coachInfoMapper.updateCoachInfo(coachInfo);
+    }
+
+    /**
+     * 批量删除教练
+     *
+     * @param coachnums 需要删除的教练ID
+     * @return 结果
+     */
+    @Override
+    public int deleteCoachInfoByIds(String[] coachnums){
+        return coachInfoMapper.deleteCoachInfoByIds(coachnums);
+    }
+
+    /**
+     * 删除教练信息
+     *
+     * @param coachnum 教练ID
+     * @return 结果
+     */
+    @Override
+    public int deleteCoachInfoById(String coachnum){
+        return coachInfoMapper.deleteCoachInfoById(coachnum);
+    }
+}

+ 4 - 4
hzgzpt-service-app/src/main/resources/mapper/coach/CoachEvaluateMapper.xml

@@ -8,9 +8,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="id"    column="id"    />
         <result property="userId"    column="user_id"    />
         <result property="coachnum"    column="coachnum"    />
-        <result property="attitudeStarts"    column="attitude_starts"    />
-        <result property="areaStarts"    column="area_starts"    />
-        <result property="totelStarts"    column="totel_starts"    />
+        <result property="attitudeStars"    column="attitude_stars"    />
+        <result property="areaStars"    column="area_stars"    />
+        <result property="totelStars"    column="totel_stars"    />
         <result property="content"    column="content"    />
         <result property="labelIds"    column="label_ids"    />
         <result property="createTime"    column="create_time"    />
@@ -20,7 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectCoachEvaluateVo">
-        select id, user_id, coachnum, attitude_starts, area_starts, totel_starts, content, label_ids, create_time, is_anonymous, update_time, status from coach_evaluate
+        select id, user_id, coachnum, attitude_starts, area_stars, totel_stars, content, label_ids, create_time, is_anonymous, update_time, status from coach_evaluate
     </sql>
 
     

+ 154 - 0
hzgzpt-service-app/src/main/resources/mapper/coach/CoachInfoMapper.xml

@@ -0,0 +1,154 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.miaxis.app.coach.mapper.CoachInfoMapper">
+    
+    <resultMap type="CoachInfo" id="CoachInfoResult">
+        <result property="coachnum"    column="coachnum"    />
+        <result property="name"    column="name"    />
+        <result property="sex"    column="sex"    />
+        <result property="inscode"    column="inscode"    />
+        <result property="idcard"    column="idcard"    />
+        <result property="mobile"    column="mobile"    />
+        <result property="address"    column="address"    />
+        <result property="photo"    column="photo"    />
+        <result property="dripermitted"    column="dripermitted"    />
+        <result property="teachpermitted"    column="teachpermitted"    />
+        <result property="district"    column="district"    />
+        <result property="employstatus"    column="employstatus"    />
+        <result property="stopTrain"    column="stop_train"    />
+        <result property="wechar"    column="wechar"    />
+        <result property="openid"    column="openid"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="fabulous"    column="fabulous"    />
+    </resultMap>
+
+    <select id="selectCoachInfoUrlList" parameterType="CoachInfo" resultMap="CoachInfoResult">
+        SELECT c.*,ci.file_url,ce.totel_starts,
+        (2 * 6378.137 * ASIN(SQRT(POW( SIN( PI( ) * ( 120- s.poi_lon ) / 360 ), 2 ) + COS( PI( ) * 34 / 180 ) * COS( s.poi_lat * PI( ) / 180 ) * POW( SIN( PI( ) * ( 34- s.poi_lat ) / 360 ), 2 )) ) ) AS distance FROM coach_info c
+        join school_info s
+        on c.inscode = s.inscode
+        LEFT JOIN  coach_images ci
+        ON c.photo = ci.id
+        left join coach_evaluate ce
+        on c.coachnum = ce.coachnum
+        <where>
+            <if test="teachpermitted != null  and teachpermitted != ''"> and teachpermitted = #{teachpermitted}</if>
+            <if test="sex != null  and sex != ''"> and sex = #{sex}</if>
+            <if test="starts != null  coachnum sex != ''"> and ce.totel_starts = #{starts}</if>
+        </where>
+    </select>
+
+
+    <sql id="selectCoachInfoVo">
+        select coachnum, name, sex, inscode, idcard, mobile, address, photo, dripermitted, teachpermitted, district, employstatus, stop_train, wechar, openid, create_time, update_time, fabulous from coach_info
+    </sql>
+
+    <select id="selectCoachInfoList" parameterType="CoachInfo" resultMap="CoachInfoResult">
+        <include refid="selectCoachInfoVo"/>
+        <where>  
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="sex != null "> and sex = #{sex}</if>
+            <if test="inscode != null  and inscode != ''"> and inscode = #{inscode}</if>
+            <if test="idcard != null  and idcard != ''"> and idcard = #{idcard}</if>
+            <if test="mobile != null  and mobile != ''"> and mobile = #{mobile}</if>
+            <if test="address != null  and address != ''"> and address = #{address}</if>
+            <if test="photo != null "> and photo = #{photo}</if>
+            <if test="dripermitted != null  and dripermitted != ''"> and dripermitted = #{dripermitted}</if>
+            <if test="teachpermitted != null  and teachpermitted != ''"> and teachpermitted = #{teachpermitted}</if>
+            <if test="district != null  and district != ''"> and district = #{district}</if>
+            <if test="employstatus != null "> and employstatus = #{employstatus}</if>
+            <if test="stopTrain != null "> and stop_train = #{stopTrain}</if>
+            <if test="wechar != null  and wechar != ''"> and wechar = #{wechar}</if>
+            <if test="openid != null  and openid != ''"> and openid = #{openid}</if>
+            <if test="fabulous != null "> and fabulous = #{fabulous}</if>
+        </where>
+    </select>
+    
+    <select id="selectCoachInfoById" parameterType="String" resultMap="CoachInfoResult">
+        <include refid="selectCoachInfoVo"/>
+        where coachnum = #{coachnum}
+    </select>
+        
+    <insert id="insertCoachInfo" parameterType="CoachInfo">
+        insert into coach_info
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="coachnum != null">coachnum,</if>
+            <if test="name != null">name,</if>
+            <if test="sex != null">sex,</if>
+            <if test="inscode != null">inscode,</if>
+            <if test="idcard != null">idcard,</if>
+            <if test="mobile != null">mobile,</if>
+            <if test="address != null">address,</if>
+            <if test="photo != null">photo,</if>
+            <if test="dripermitted != null">dripermitted,</if>
+            <if test="teachpermitted != null">teachpermitted,</if>
+            <if test="district != null">district,</if>
+            <if test="employstatus != null">employstatus,</if>
+            <if test="stopTrain != null">stop_train,</if>
+            <if test="wechar != null">wechar,</if>
+            <if test="openid != null">openid,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="fabulous != null">fabulous,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="coachnum != null">#{coachnum},</if>
+            <if test="name != null">#{name},</if>
+            <if test="sex != null">#{sex},</if>
+            <if test="inscode != null">#{inscode},</if>
+            <if test="idcard != null">#{idcard},</if>
+            <if test="mobile != null">#{mobile},</if>
+            <if test="address != null">#{address},</if>
+            <if test="photo != null">#{photo},</if>
+            <if test="dripermitted != null">#{dripermitted},</if>
+            <if test="teachpermitted != null">#{teachpermitted},</if>
+            <if test="district != null">#{district},</if>
+            <if test="employstatus != null">#{employstatus},</if>
+            <if test="stopTrain != null">#{stopTrain},</if>
+            <if test="wechar != null">#{wechar},</if>
+            <if test="openid != null">#{openid},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="fabulous != null">#{fabulous},</if>
+         </trim>
+    </insert>
+
+    <update id="updateCoachInfo" parameterType="CoachInfo">
+        update coach_info
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="name != null">name = #{name},</if>
+            <if test="sex != null">sex = #{sex},</if>
+            <if test="inscode != null">inscode = #{inscode},</if>
+            <if test="idcard != null">idcard = #{idcard},</if>
+            <if test="mobile != null">mobile = #{mobile},</if>
+            <if test="address != null">address = #{address},</if>
+            <if test="photo != null">photo = #{photo},</if>
+            <if test="dripermitted != null">dripermitted = #{dripermitted},</if>
+            <if test="teachpermitted != null">teachpermitted = #{teachpermitted},</if>
+            <if test="district != null">district = #{district},</if>
+            <if test="employstatus != null">employstatus = #{employstatus},</if>
+            <if test="stopTrain != null">stop_train = #{stopTrain},</if>
+            <if test="wechar != null">wechar = #{wechar},</if>
+            <if test="openid != null">openid = #{openid},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="fabulous != null">fabulous = #{fabulous},</if>
+        </trim>
+        where coachnum = #{coachnum}
+    </update>
+
+    <delete id="deleteCoachInfoById" parameterType="String">
+        delete from coach_info where coachnum = #{coachnum}
+    </delete>
+
+    <delete id="deleteCoachInfoByIds" parameterType="String">
+        delete from coach_info where coachnum in 
+        <foreach item="coachnum" collection="array" open="(" separator="," close=")">
+            #{coachnum}
+        </foreach>
+    </delete>
+    
+</mapper>