Browse Source

短信服务接口、修改用户手机号接口、首页咨询公告相关接口、驾校训练场相关接口

wwl 4 years ago
parent
commit
04c9d26968
21 changed files with 1781 additions and 17 deletions
  1. 27 17
      hzgzpt-admin/src/main/java/com/miaxis/app/controller/user/UserInfoController.java
  2. 217 0
      hzgzpt-admin/src/main/java/com/miaxis/system/controller/common/smsController.java
  3. 116 0
      hzgzpt-admin/src/main/java/com/miaxis/system/controller/system/NewsInfoController.java
  4. 115 0
      hzgzpt-admin/src/main/java/com/miaxis/system/controller/system/SchoolRegionController.java
  5. 5 0
      hzgzpt-admin/src/main/resources/application.yml
  6. 18 0
      hzgzpt-common/src/main/java/com/miaxis/common/constant/Constants.java
  7. 15 0
      hzgzpt-common/src/main/java/com/miaxis/common/core/domain/Response.java
  8. 274 0
      hzgzpt-common/src/main/java/com/miaxis/common/sms/Client.java
  9. 58 0
      hzgzpt-common/src/main/java/com/miaxis/common/sms/MD5Utils.java
  10. 11 0
      hzgzpt-service-app/src/main/java/com/miaxis/app/user/service/IUserInfoService.java
  11. 37 0
      hzgzpt-service-app/src/main/java/com/miaxis/app/user/service/impl/UserInfoServiceImpl.java
  12. 87 0
      hzgzpt-system/src/main/java/com/miaxis/system/domain/NewsInfo.java
  13. 122 0
      hzgzpt-system/src/main/java/com/miaxis/system/domain/SchoolRegion.java
  14. 61 0
      hzgzpt-system/src/main/java/com/miaxis/system/mapper/NewsInfoMapper.java
  15. 61 0
      hzgzpt-system/src/main/java/com/miaxis/system/mapper/SchoolRegionMapper.java
  16. 61 0
      hzgzpt-system/src/main/java/com/miaxis/system/service/INewsInfoService.java
  17. 61 0
      hzgzpt-system/src/main/java/com/miaxis/system/service/ISchoolRegionService.java
  18. 90 0
      hzgzpt-system/src/main/java/com/miaxis/system/service/impl/NewsInfoServiceImpl.java
  19. 90 0
      hzgzpt-system/src/main/java/com/miaxis/system/service/impl/SchoolRegionServiceImpl.java
  20. 118 0
      hzgzpt-system/src/main/resources/mapper/system/NewsInfoMapper.xml
  21. 137 0
      hzgzpt-system/src/main/resources/mapper/system/SchoolRegionMapper.xml

+ 27 - 17
hzgzpt-admin/src/main/java/com/miaxis/app/controller/user/UserInfoController.java

@@ -1,26 +1,21 @@
 package com.miaxis.app.controller.user;
 
-import java.util.List;
-import io.swagger.annotations.*;
-import com.miaxis.common.core.domain.Response;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.bind.annotation.ModelAttribute;
+import com.miaxis.app.user.domain.UserInfo;
+import com.miaxis.app.user.service.IUserInfoService;
 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.domain.entity.SysUser;
+import com.miaxis.common.core.page.ResponsePageInfo;
 import com.miaxis.common.enums.BusinessTypeEnum;
-import com.miaxis.app.user.domain.UserInfo;
-import com.miaxis.app.user.service.IUserInfoService;
+import com.miaxis.common.utils.SecurityUtils;
 import com.miaxis.common.utils.poi.ExcelUtil;
-import com.miaxis.common.core.page.ResponsePageInfo;
+import io.swagger.annotations.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
 
 /**
  * 【用户信息】Controller
@@ -112,4 +107,19 @@ public class UserInfoController extends BaseController{
     ){
         return toResponse(userInfoService.deleteUserInfoByIds(ids));
     }
+
+    /**
+     * 修改用户手机号
+     */
+    @Log(title = "用户信息", businessType = BusinessTypeEnum.UPDATE)
+    @PostMapping("/modifyPhoneNumber")
+    @ApiOperation("修改用户手机号")
+    public Response modifyPhoneNumber(String phone,String verificationCode){
+        //获取当前用户
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        //修改手机号
+        return userInfoService.modifyPhoneNumber(phone,verificationCode,user);
+    }
+
+
 }

+ 217 - 0
hzgzpt-admin/src/main/java/com/miaxis/system/controller/common/smsController.java

@@ -0,0 +1,217 @@
+package com.miaxis.system.controller.common;
+
+import com.miaxis.common.constant.Constants;
+import com.miaxis.common.core.domain.Response;
+import com.miaxis.common.core.domain.ResponseEnum;
+import com.miaxis.common.core.domain.entity.SysUser;
+import com.miaxis.common.sms.Client;
+import com.miaxis.common.utils.SecurityUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.net.URLEncoder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Random;
+import java.util.concurrent.TimeUnit;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @Author wwl
+ * @Date 2020/12/23
+ * @Version 1.0
+ */
+@RestController
+@RequestMapping("/user/info")
+@Api(tags={"【短信服务】Controller"})
+public class smsController {
+
+    private final String MOBILE_REGEX = "^((13[0-9])|(14[0-9])|(15[0-9])|(17[0-9])|(18[0-9])|(19[0-9]))\\d{8}$";//手机号码验证
+    private final Integer SMS_MAX_COUNT = 500 ;//每天系统发送最大次数(预留)
+    private final Integer MAX_COUNT = 5 ;//每个手机号验证发送最大次数
+    private final long SEND_INTERVAL = 2 ;//发送间隔时间
+
+    @Value("${sms_user_name}")
+    private String smsUserName;//用户名
+
+    @Value("${sms_password}")
+    private String smsPassword;//密码
+
+    @Autowired
+    private RedisTemplate redisTemplate;//redis模板引擎
+
+
+    /**
+     * 获取短信验证码
+     * @return
+     */
+    @ApiOperation("获取短信验证码")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "type",value = "login:用户登录验证码、modify:修改手机验证码" ,dataType = "String",required = true),
+            @ApiImplicitParam(name = "phone", value = "手机号码", required = true, dataType = "String")
+    })
+    @PostMapping(value = "/sendVerificationCode")
+    public Response sendVerificationCode(String type,String phone){
+        //获取当前用户
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        //字符编码
+        String charset = "UTF-8";
+
+        //手机号格式验证
+        if(phone.length() != 11){
+            return Response.error(500,"手机格式错误");
+        } else {
+            Pattern pattern = Pattern.compile(MOBILE_REGEX);
+            Matcher matcher = pattern.matcher(phone);
+            if(!matcher.matches()) {
+                return Response.error(500,"手机号格式错误");
+            }
+        }
+        try{
+
+            /**
+             * login:登录验证  modify;修改验证
+             * keyPrefix : 缓存key前缀
+             * verificationCount : 验证次数
+             */
+            Map<String, String> map = new HashMap<>();
+            if (type.equals("login")){
+                map.put("keyPrefix",Constants.SMS_LOGIN_CODE);
+                map.put("verificationCount",Constants.SMS_LOGIN_CODE_COUNT);
+            }
+            if (type.equals("modify")){
+                if (user.getPhonenumber().equals(phone)){
+                    return Response.error(500,"该手机号与当前绑定的手机号相同");
+                }
+                map.put("keyPrefix",Constants.SMS_MODIFY_CODE);
+                map.put("verificationCount",Constants.SMS_MODIFY_CODE_COUNT);
+            }
+
+            //验证手机号
+            Response resultJson = validateMobile(phone,map);
+            if("500".equals(resultJson.getCode().toString())) {
+                return resultJson;
+            }
+
+            // 生成验证码
+             String code="";
+            for (int i=0;i<6;i++){
+                code += new Random().nextInt(10);
+            }
+            String content = "本次验证码:"+code+",验证码两分钟内有效";
+
+            // 调用发送接口
+            Client client = new Client(smsUserName, smsPassword);
+            String content1 = URLEncoder.encode(content, charset);
+            String ecodeContent = URLEncoder.encode(content1, charset);
+            String result = client.mtData(ecodeContent, phone, "", "", "", charset);
+            String strCode = result.split("\n")[0];
+            long codenum = 0;
+            codenum = Long.valueOf(strCode);
+            String Info = null;
+            if (codenum > 0) {//成功提交
+                Info = "发送成功";
+                // 写入缓存中
+                writeCache(phone, code,map);
+                return Response.success(Info);
+
+            } else if (codenum == 0) {
+                Info = "发送失败";
+            } else if (codenum == -1) { // 用户名密码不正确
+                Info = "用户名密码不正确";
+            } else if (codenum == -2) { // 必填选项为空
+                Info = "必填选项为空";
+            } else if (codenum == -3) { // 短信内容0个字节
+                Info = "短信内容0个字节";
+            } else if (codenum == -4) { // 0个有效号码
+                Info = "0个有效号码";
+            } else if (codenum == -5) { // 余额不够
+                Info = "余额不够";
+            } else if (codenum == -10) { // 用户被禁用
+                Info = "用户被禁用";
+            } else if (codenum == -11) { // 短信内容过长
+                Info = "短信内容过长";
+            } else if(codenum == -12){	 //用户无扩展权限
+                Info = "无扩展权限";
+            } else if(codenum == -13){  //IP地址校验错
+                Info = "IP校验错误";
+            } else if(codenum == -14){  //内容解析异常
+                Info = "内容解析异常";
+            } else {
+                Info = "未知错误";
+            }
+
+            return Response.error(500,Info);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return Response.error(ResponseEnum.ERROR);
+        }
+    }
+
+    /**
+     * 手机号验证
+     * @param mobile
+     * @return
+     */
+    private Response validateMobile(final String mobile,Map map){
+
+        if(redisTemplate.hasKey(map.get("verificationCount") + mobile)){
+            // 验证发送时间
+            if (redisTemplate.hasKey(map.get("keyPrefix") + mobile)){
+                return Response.error(500,"验证码还未过期,不能重新发送!");
+            }
+
+            // 验证发送次数
+            Integer count = Integer.valueOf(redisTemplate.opsForValue().get(map.get("verificationCount") + mobile).toString());
+            if(count >= MAX_COUNT) {
+                return Response.error(500,"当前手机号发送验证码次数过多!");
+            }
+        }
+        return Response.success();
+    }
+
+
+    /**
+     * 写入缓存
+     * @param mobile
+     * @param code
+     */
+    private void writeCache(String mobile, String code,Map map){
+
+        //该手机号首次获取验证码
+        if(!redisTemplate.hasKey(map.get("keyPrefix") + mobile) && !redisTemplate.hasKey(map.get("verificationCount") + mobile)){
+            synchronized(this){
+                //设置该手机号验证码 两分钟过期
+                redisTemplate.opsForValue().set(map.get("keyPrefix") + mobile , code, SEND_INTERVAL, TimeUnit.MINUTES);
+                //设置该手机号验证次数 一天过期
+                redisTemplate.opsForValue().set(map.get("verificationCount") + mobile , "1",1,TimeUnit.DAYS);
+            }
+        }
+
+        //多次获取验证码
+        if (redisTemplate.hasKey(map.get("verificationCount") + mobile) && !redisTemplate.hasKey(map.get("keyPrefix") + mobile)){
+            //判断该手机验证次数
+            Integer count = Integer.valueOf(redisTemplate.opsForValue().get(map.get("verificationCount") + mobile).toString());
+            if (count < MAX_COUNT){
+                synchronized(this){
+                    //该手机号验证次数+1 一天过期
+                    redisTemplate.opsForValue().set(map.get("verificationCount") + mobile,String.valueOf(count+1),1,TimeUnit.DAYS);
+                    //设置该手机号验证码 两分钟过期
+                    redisTemplate.opsForValue().set(map.get("keyPrefix") + mobile , code, SEND_INTERVAL, TimeUnit.MINUTES);
+                }
+            }
+        }
+    }
+
+
+
+}

+ 116 - 0
hzgzpt-admin/src/main/java/com/miaxis/system/controller/system/NewsInfoController.java

@@ -0,0 +1,116 @@
+package com.miaxis.system.controller.system;
+
+import java.util.List;
+import io.swagger.annotations.*;
+import com.miaxis.common.core.domain.Response;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import com.miaxis.common.annotation.Log;
+import com.miaxis.common.core.controller.BaseController;
+import com.miaxis.common.enums.BusinessTypeEnum;
+import com.miaxis.system.domain.NewsInfo;
+import com.miaxis.system.service.INewsInfoService;
+import com.miaxis.common.utils.poi.ExcelUtil;
+import com.miaxis.common.core.page.ResponsePageInfo;
+
+/**
+ * 【新闻(首页资讯、通知、公告相关)】Controller
+ *
+ * @author miaxis
+ * @date 2020-12-22
+ */
+@RestController
+@RequestMapping("/system/info")
+@Api(tags={"【新闻(首页资讯、通知、公告相关)】Controller"})
+public class NewsInfoController extends BaseController{
+    @Autowired
+    private INewsInfoService newsInfoService;
+
+    /**
+     * 查询新闻(首页资讯、通知、公告相关)列表
+     */
+    @PreAuthorize("@ss.hasPermi('system: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<NewsInfo> list(@ModelAttribute NewsInfo newsInfo){
+        startPage();
+        List<NewsInfo> list = newsInfoService.selectNewsInfoList(newsInfo);
+//        List<NewsInfo> list = newsInfoService.list();
+        return toResponsePageInfo(list);
+    }
+
+    /**
+     * 导出新闻(首页资讯、通知、公告相关)列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:info:export')")
+    @Log(title = "新闻(首页资讯、通知、公告相关)", businessType = BusinessTypeEnum.EXPORT)
+    @GetMapping("/export")
+    @ApiOperation("导出新闻(首页资讯、通知、公告相关)列表Excel")
+    public Response<String> export(@ModelAttribute NewsInfo newsInfo){
+        List<NewsInfo> list = newsInfoService.selectNewsInfoList(newsInfo);
+        ExcelUtil<NewsInfo> util = new ExcelUtil<NewsInfo>(NewsInfo.class);
+        return util.exportExcel(list, "info");
+    }
+
+    /**
+     * 获取新闻(首页资讯、通知、公告相关)详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:info:query')")
+    @GetMapping(value = "/{id}")
+    @ApiOperation("获取新闻(首页资讯、通知、公告相关)详细信息")
+    public Response<NewsInfo> getInfo(
+            @ApiParam(name = "id", value = "新闻(首页资讯、通知、公告相关)参数", required = true)
+            @PathVariable("id") Long id
+    ){
+        return Response.success(newsInfoService.selectNewsInfoById(id));
+    }
+
+    /**
+     * 新增新闻(首页资讯、通知、公告相关)
+     */
+    @PreAuthorize("@ss.hasPermi('system:info:add')")
+    @Log(title = "新闻(首页资讯、通知、公告相关)", businessType = BusinessTypeEnum.INSERT)
+    @PostMapping
+    @ApiOperation("新增新闻(首页资讯、通知、公告相关)")
+    public Response<Integer> add(@RequestBody NewsInfo newsInfo){
+        return toResponse(newsInfoService.insertNewsInfo(newsInfo));
+    }
+
+    /**
+     * 修改新闻(首页资讯、通知、公告相关)
+     */
+    @PreAuthorize("@ss.hasPermi('system:info:edit')")
+    @Log(title = "新闻(首页资讯、通知、公告相关)", businessType = BusinessTypeEnum.UPDATE)
+    @PutMapping
+    @ApiOperation("修改新闻(首页资讯、通知、公告相关)")
+    public Response<Integer> edit(@RequestBody NewsInfo newsInfo){
+        return toResponse(newsInfoService.updateNewsInfo(newsInfo));
+    }
+
+    /**
+     * 删除新闻(首页资讯、通知、公告相关)
+     */
+    @PreAuthorize("@ss.hasPermi('system:info:remove')")
+    @Log(title = "新闻(首页资讯、通知、公告相关)", businessType = BusinessTypeEnum.DELETE)
+	@DeleteMapping("/{ids}")
+    @ApiOperation("删除新闻(首页资讯、通知、公告相关)")
+    public  Response<Integer> remove(
+            @ApiParam(name = "ids", value = "新闻(首页资讯、通知、公告相关)ids参数", required = true)
+            @PathVariable Long[] ids
+    ){
+        return toResponse(newsInfoService.deleteNewsInfoByIds(ids));
+    }
+}

+ 115 - 0
hzgzpt-admin/src/main/java/com/miaxis/system/controller/system/SchoolRegionController.java

@@ -0,0 +1,115 @@
+package com.miaxis.system.controller.system;
+
+import java.util.List;
+import io.swagger.annotations.*;
+import com.miaxis.common.core.domain.Response;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import com.miaxis.common.annotation.Log;
+import com.miaxis.common.core.controller.BaseController;
+import com.miaxis.common.enums.BusinessTypeEnum;
+import com.miaxis.system.domain.SchoolRegion;
+import com.miaxis.system.service.ISchoolRegionService;
+import com.miaxis.common.utils.poi.ExcelUtil;
+import com.miaxis.common.core.page.ResponsePageInfo;
+
+/**
+ * 【驾校训练场】Controller
+ *
+ * @author miaxis
+ * @date 2020-12-23
+ */
+@RestController
+@RequestMapping("/system/region")
+@Api(tags={"【驾校训练场】Controller"})
+public class SchoolRegionController extends BaseController{
+    @Autowired
+    private ISchoolRegionService schoolRegionService;
+
+    /**
+     * 查询驾校训练场列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:region: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<SchoolRegion> list(@ModelAttribute SchoolRegion schoolRegion){
+        startPage();
+        List<SchoolRegion> list = schoolRegionService.selectSchoolRegionList(schoolRegion);
+        return toResponsePageInfo(list);
+    }
+
+    /**
+     * 导出驾校训练场列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:region:export')")
+    @Log(title = "驾校训练场", businessType = BusinessTypeEnum.EXPORT)
+    @GetMapping("/export")
+    @ApiOperation("导出驾校训练场列表Excel")
+    public Response<String> export(@ModelAttribute SchoolRegion schoolRegion){
+        List<SchoolRegion> list = schoolRegionService.selectSchoolRegionList(schoolRegion);
+        ExcelUtil<SchoolRegion> util = new ExcelUtil<SchoolRegion>(SchoolRegion.class);
+        return util.exportExcel(list, "region");
+    }
+
+    /**
+     * 获取驾校训练场详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:region:query')")
+    @GetMapping(value = "/{id}")
+    @ApiOperation("获取驾校训练场详细信息")
+    public Response<SchoolRegion> getInfo(
+            @ApiParam(name = "id", value = "驾校训练场参数", required = true)
+            @PathVariable("id") Long id
+    ){
+        return Response.success(schoolRegionService.selectSchoolRegionById(id));
+    }
+
+    /**
+     * 新增驾校训练场
+     */
+    @PreAuthorize("@ss.hasPermi('system:region:add')")
+    @Log(title = "驾校训练场", businessType = BusinessTypeEnum.INSERT)
+    @PostMapping
+    @ApiOperation("新增驾校训练场")
+    public Response<Integer> add(@RequestBody SchoolRegion schoolRegion){
+        return toResponse(schoolRegionService.insertSchoolRegion(schoolRegion));
+    }
+
+    /**
+     * 修改驾校训练场
+     */
+    @PreAuthorize("@ss.hasPermi('system:region:edit')")
+    @Log(title = "驾校训练场", businessType = BusinessTypeEnum.UPDATE)
+    @PutMapping
+    @ApiOperation("修改驾校训练场")
+    public Response<Integer> edit(@RequestBody SchoolRegion schoolRegion){
+        return toResponse(schoolRegionService.updateSchoolRegion(schoolRegion));
+    }
+
+    /**
+     * 删除驾校训练场
+     */
+    @PreAuthorize("@ss.hasPermi('system:region:remove')")
+    @Log(title = "驾校训练场", businessType = BusinessTypeEnum.DELETE)
+	@DeleteMapping("/{ids}")
+    @ApiOperation("删除驾校训练场")
+    public  Response<Integer> remove(
+            @ApiParam(name = "ids", value = "驾校训练场ids参数", required = true)
+            @PathVariable Long[] ids
+    ){
+        return toResponse(schoolRegionService.deleteSchoolRegionByIds(ids));
+    }
+}

+ 5 - 0
hzgzpt-admin/src/main/resources/application.yml

@@ -188,3 +188,8 @@ xss:
   excludes: /system/notice/*
   # 匹配链接
   urlPatterns: /system/*,/monitor/*,/tool/*
+
+
+# --------------------------------------------短信验证-------------------------------------
+sms_user_name: "jsjp"
+sms_password: "t7nwh7"

+ 18 - 0
hzgzpt-common/src/main/java/com/miaxis/common/constant/Constants.java

@@ -57,6 +57,24 @@ public class Constants
      */
     public static final String CAPTCHA_CODE_KEY = "captcha_codes:";
 
+    /**
+     * 修改手机号验证码 redis key
+     */
+    public static final String SMS_MODIFY_CODE = "sms:modify:code:";
+    /**
+     * 修改手机号验证码次数 redis key
+     */
+    public static final String SMS_MODIFY_CODE_COUNT = "sms:modify:code:count:";
+
+    /**
+     * 登录短信验证码 redis key
+     */
+    public static final String SMS_LOGIN_CODE = "sms;login;code:";
+    /**
+     * 登录短信验证码次数 redis key
+     */
+    public static final String SMS_LOGIN_CODE_COUNT = "sms;login;code:count:";
+
     /**
      * 登录用户 redis key
      */

+ 15 - 0
hzgzpt-common/src/main/java/com/miaxis/common/core/domain/Response.java

@@ -42,6 +42,11 @@ public class Response<T> {
         this.msg = responseEnum.getMessage();
     }
 
+    private Response(Integer code,String msg){
+        this.code = code;
+        this.msg = msg;
+    }
+
     /**
      * 成功时调用
      * @param
@@ -79,6 +84,16 @@ public class Response<T> {
         return new Response<T>(responseEnum);
     }
 
+    /**
+     * 失败时调用
+     * @param
+     * @param <T>
+     * @return
+     */
+    public static <T> Response error(Integer code,String msg){
+        return new Response<T>(code,msg);
+    }
+
 
 
     public Integer getCode() {

+ 274 - 0
hzgzpt-common/src/main/java/com/miaxis/common/sms/Client.java

@@ -0,0 +1,274 @@
+package com.miaxis.common.sms;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.UnsupportedEncodingException;
+import java.net.URL;
+import java.net.URLConnection;
+
+public class Client {
+
+	/**
+	 * http post方式提交
+	 */
+	private String HttpURL = "http://sms-cly.cn/";
+
+	private String userName = "clyjsjp";
+	private String password = "gvy0p3fv";
+	private String pwd = "miaxis110";
+
+	public Client(){};
+	
+	/**
+	 * 构造函数
+	 * 
+	 * @param username
+	 * @param password
+	 * @throws UnsupportedEncodingException
+	 */
+	public Client(String username, String password) {
+		this.userName = username;
+		this.password = password;
+		this.pwd = MD5Utils.MD5Encode(username + MD5Utils.MD5Encode(password));
+	}
+
+	/**
+	 * 方法名称:getBalance 
+	 * 功 能:获取余额 
+	 * 参 数:无 
+	 * 返 回 值:余额(String)
+	 */
+	public String getBalance() {
+		String result = "";
+		OutputStreamWriter out = null;
+		BufferedReader in = null;
+		StringBuilder params = new StringBuilder();
+		params.append("username=").append(userName)
+			  .append("&password=").append(this.getPwd());
+		try {
+			URL realUrl = new URL(HttpURL + "balanceQuery.do");
+			URLConnection conn = realUrl.openConnection();
+			conn.setRequestProperty("accept", "*/*");
+			conn.setRequestProperty("connection", "Keep-Alive");
+			conn.setDoOutput(true);
+			conn.setDoInput(true);
+			out = new OutputStreamWriter(conn.getOutputStream(), "UTF8");
+			out.write(params.toString());
+			out.flush();
+
+			in = new BufferedReader(new InputStreamReader(
+					conn.getInputStream(), "UTF8"));
+			String line = "";
+			while ((line = in.readLine()) != null) {
+				result += line + "\n";
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return result;
+	}
+
+	/**
+	 * 方法名称:mt 
+	 * 功 能:发送短信
+	 * @param content 发送内容
+	 * @param mobile  发送的手机号码,多个手机号为用半角 , 分开
+	 * @param dstime  定时时间 ,为空时表示立即发送,格式:yyyy-MM-dd HH:mm:ss
+	 * @param msgid   客户自定义消息ID
+	 * @param ext	     用户自定义扩展
+	 * @param msgfmt  提交消息编码格式(UTF-8/GBK)置空时默认是UTF-8
+	 * 返 回 值:若用户自定义消息ID,则返回用户的ID,否则系统随机生成一个任务ID
+	 * @throws UnsupportedEncodingException
+	 */
+	public String mt(String content, String mobile, String dstime,
+			String msgid, String ext, String msgfmt)
+			throws UnsupportedEncodingException {
+		String result = "";
+		OutputStreamWriter out = null;
+		BufferedReader in = null;
+		StringBuilder params = new StringBuilder();
+		params.append("username=").append(userName)
+				.append("&password=").append(this.getPwd())
+				.append("&mobile=").append(mobile)
+				.append("&content=").append(content)
+				.append("&dstime=").append(dstime)
+				.append("&ext=").append(ext)
+				.append("&msgid=").append(msgid)				
+				.append("&msgfmt=").append(msgfmt);
+		try {
+			URL realUrl = new URL(HttpURL + "smsSend.do");
+			URLConnection conn = realUrl.openConnection();
+			conn.setRequestProperty("accept", "*/*");
+			conn.setRequestProperty("connection", "Keep-Alive");
+			conn.setDoOutput(true);
+			conn.setDoInput(true);
+			out = new OutputStreamWriter(conn.getOutputStream(), "UTF8");
+			out.write(params.toString());
+			out.flush();
+
+			in = new BufferedReader(new InputStreamReader(
+					conn.getInputStream(), "UTF8"));
+			String line = "";
+			while ((line = in.readLine()) != null) {
+				result += line + "\n";
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return result;
+	}
+	
+	/**
+	 * 方法名称:mtData
+	 * 功 能:发送个性短信(一个号码对应一条内容)
+	 * 参数:
+	 * @param content 发送内容,同号码个数一致,内容单条编码之后用英文逗号(,)隔开变成串,之后再对整个串进行二次编码,编码方式为UTF-8
+	 * @param mobile  发送的号码,多个号码用英文,分隔
+	 * @param dstime  定时时间
+	 * @param ext	     用户自定义扩展
+	 * @param msgid   用户自定义消息ID
+	 * @param msgfmt  提交消息编码格式
+	 * @return
+	 */
+	public String mtData(String content, String mobile, String dstime, String ext, String msgid, String msgfmt){
+		String result = "";
+		OutputStreamWriter out = null;
+		BufferedReader in = null;
+		StringBuilder params = new StringBuilder();
+		params.append("username=").append(userName)
+				.append("&password=").append(this.getPwd())
+				.append("&mobile=").append(mobile)
+				.append("&content=").append(content)
+				.append("&dstime=").append(dstime)
+				.append("&ext=").append(ext)
+				.append("&msgid=").append(msgid)				
+				.append("&msgfmt=").append(msgfmt);
+		try {
+			URL realUrl = new URL(HttpURL + "sendData.do");
+			URLConnection conn = realUrl.openConnection();
+			conn.setRequestProperty("accept", "*/*");
+			conn.setRequestProperty("connection", "Keep-Alive");
+			conn.setDoOutput(true);
+			conn.setDoInput(true);
+			out = new OutputStreamWriter(conn.getOutputStream(), "UTF8");
+			out.write(params.toString());
+			out.flush();
+
+			in = new BufferedReader(new InputStreamReader(
+					conn.getInputStream(), "UTF8"));
+			String line = "";
+			while ((line = in.readLine()) != null) {
+				result += line + "\n";
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return result;
+	}
+
+	/**
+	 * 方法名称:UpdatePassword 
+	 * 功 能:修改密码 
+	 * 参 数:newPassword(新密码) 
+	 * 返 回 值:状态报告(string)
+	 */
+	public String UpdatePassword(String newPassword) {
+		String result = "";
+		OutputStreamWriter out = null;
+		BufferedReader in = null;
+		StringBuilder params = new StringBuilder();
+		params.append("username=").append(userName)
+			  .append("&password=").append(this.getPwd())
+			  .append("&newpassword=").append(newPassword);
+		try {
+			URL realUrl = new URL(HttpURL + "passwordUpdate.do");
+			URLConnection conn = realUrl.openConnection();
+			conn.setRequestProperty("accept", "*/*");
+			conn.setRequestProperty("connection", "Keep-Alive");
+			conn.setDoOutput(true);
+			conn.setDoInput(true);
+			out = new OutputStreamWriter(conn.getOutputStream(), "UTF8");
+			out.write(params.toString());
+			out.flush();
+
+			in = new BufferedReader(new InputStreamReader(
+					conn.getInputStream(), "UTF8"));
+			String line = "";
+			while ((line = in.readLine()) != null) {
+				result += line + "\n";
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return result;
+	}
+	
+	/**
+	 * 方法名称: getDigest
+	 * 功 能:数字签名(明文MD5加密)
+	 * 参数:
+	 * @param plaintext 明文
+	 * 返回参数:MD5密文
+	 */
+	public String getDigest(String plaintext){
+		String result = "";
+		OutputStreamWriter out = null;
+		BufferedReader in = null;
+		StringBuilder params = new StringBuilder();
+		params.append("plaintext=").append(plaintext);
+		try {
+			URL realUrl = new URL(HttpURL + "md5Digest.do");
+			URLConnection conn = realUrl.openConnection();
+			conn.setRequestProperty("accept", "*/*");
+			conn.setRequestProperty("connection", "Keep-Alive");
+			conn.setDoOutput(true);
+			conn.setDoInput(true);
+			out = new OutputStreamWriter(conn.getOutputStream(), "UTF8");
+			out.write(params.toString());
+			out.flush();
+
+			in = new BufferedReader(new InputStreamReader(
+					conn.getInputStream(), "UTF8"));
+			String line = "";
+			while ((line = in.readLine()) != null) {
+				result += line + "\n";
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return result;
+	}
+	
+	public String getHttpURL() {
+		return HttpURL;
+	}
+
+	public void setHttpURL(String httpURL) {
+		HttpURL = httpURL;
+	}
+
+	public String getUserName() {
+		return userName;
+	}
+
+	public void setUserName(String userName) {
+		this.userName = userName;
+	}
+
+	public String getPassword() {
+		return password;
+	}
+
+	public void setPassword(String password) {
+		this.password = password;
+	}
+
+	public String getPwd() {
+		return pwd;
+	}
+
+	public void setPwd(String pwd) {
+		this.pwd = pwd;
+	}
+}

+ 58 - 0
hzgzpt-common/src/main/java/com/miaxis/common/sms/MD5Utils.java

@@ -0,0 +1,58 @@
+package com.miaxis.common.sms;
+
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+
+public class MD5Utils {
+
+	/**
+	 * 27 md5加密产生,产生128位(bit)的mac 28 将128bit Mac转换成16进制代码 29
+	 * 
+	 * @param strSrc
+	 *            30
+	 * @param key
+	 *            31
+	 * @return 32
+	 */
+	public static String MD5Encode(String strSrc) {
+		return MD5Encode(strSrc, "");
+	}
+
+	/**
+	 * 27 md5加密产生,产生128位(bit)的mac 28 将128bit Mac转换成16进制代码 29
+	 * 
+	 * @param strSrc
+	 *            30
+	 * @param key
+	 *            31
+	 * @return 32
+	 */
+	public static String MD5Encode(String strSrc, String key) {
+
+		try {
+			MessageDigest md5 = MessageDigest.getInstance("MD5");
+			md5.update(strSrc.getBytes("UTF8"));
+			StringBuilder result = new StringBuilder(32);
+			byte[] temp;
+			temp = md5.digest(key.getBytes("UTF8"));
+			for (int i = 0; i < temp.length; i++) {
+				result.append(Integer.toHexString(
+						(0x000000ff & temp[i]) | 0xffffff00).substring(6));
+			}
+			return result.toString();
+		} catch (NoSuchAlgorithmException e) {
+			e.printStackTrace();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return "";
+
+	}
+
+	public static void main(String[] args) throws Exception {
+		String aaa = "wtjn168";
+		String mac128byte = MD5Encode(aaa, "");
+		System.out.println("md5加密结果32 bit------------->:" + mac128byte);
+	}
+
+}

+ 11 - 0
hzgzpt-service-app/src/main/java/com/miaxis/app/user/service/IUserInfoService.java

@@ -3,6 +3,8 @@ package com.miaxis.app.user.service;
 import java.util.List;
 import com.miaxis.app.user.domain.UserInfo;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.miaxis.common.core.domain.Response;
+import com.miaxis.common.core.domain.entity.SysUser;
 
 /**
  * 用户信息Service接口
@@ -58,4 +60,13 @@ public interface IUserInfoService extends IService<UserInfo>{
      * @return 结果
      */
     public int deleteUserInfoById(Long id);
+
+    /**
+     * 修改手机号
+     * @param phone
+     * @param verificationCode
+     * @return
+     */
+    Response modifyPhoneNumber(String phone, String verificationCode,SysUser user);
+
 }

+ 37 - 0
hzgzpt-service-app/src/main/java/com/miaxis/app/user/service/impl/UserInfoServiceImpl.java

@@ -2,12 +2,17 @@ package com.miaxis.app.user.service.impl;
 
 import java.util.List;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.miaxis.common.constant.Constants;
+import com.miaxis.common.core.domain.Response;
+import com.miaxis.common.core.domain.entity.SysUser;
 import com.miaxis.common.utils.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
 import com.miaxis.app.user.mapper.UserInfoMapper;
 import com.miaxis.app.user.domain.UserInfo;
 import com.miaxis.app.user.service.IUserInfoService;
+import org.springframework.transaction.annotation.Transactional;
 
 /**
  * 用户信息Service业务层处理
@@ -20,6 +25,9 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> i
     @Autowired
     private UserInfoMapper userInfoMapper;
 
+    @Autowired
+    private RedisTemplate redisTemplate;
+
     /**
      * 查询用户信息
      *
@@ -87,4 +95,33 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> i
     public int deleteUserInfoById(Long id){
         return userInfoMapper.deleteUserInfoById(id);
     }
+
+    /**
+     * 修改手机号
+     * @param phone
+     * @param verificationCode
+     * @return
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Response modifyPhoneNumber(String phone,String verificationCode,SysUser user) {
+        //查看验证码是否过期
+        if (redisTemplate.hasKey(Constants.SMS_MODIFY_CODE_COUNT + phone) &&
+                !redisTemplate.hasKey(Constants.SMS_MODIFY_CODE + phone)){
+            return Response.error(500,"验证码已过期,请重新验证!");
+        }
+        //比对缓存中的验证码
+        String smsCodeValue = redisTemplate.opsForValue().get(Constants.SMS_MODIFY_CODE + phone).toString();
+        if (!verificationCode.equals(smsCodeValue)){
+            return Response.error(500,"验证码错误,请重新输入");
+        }
+
+        UserInfo userInfo = new UserInfo();
+        userInfo.setId(user.getUserId());
+        userInfo.setMobile(phone);
+        //更新绑定手机号
+        userInfoMapper.updateById(userInfo);
+
+        return Response.success();
+    }
 }

+ 87 - 0
hzgzpt-system/src/main/java/com/miaxis/system/domain/NewsInfo.java

@@ -0,0 +1,87 @@
+package com.miaxis.system.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+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 lombok.Data;
+/**
+ * 新闻(首页资讯、通知、公告相关)对象 news_info
+ *
+ * @author miaxis
+ * @date 2020-12-22
+ */
+@Data
+@TableName("news_info")
+@ApiModel(value = "NewsInfo", description = "新闻(首页资讯、通知、公告相关)对象 news_info")
+public class NewsInfo extends BaseEntity{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    @TableId(value = "id")
+    @ApiModelProperty(value = "$column.columnComment")
+    private Long id;
+
+    /** 标题 */
+    @Excel(name = "标题")
+    @TableField("title")
+    @ApiModelProperty(value = "标题")
+    private String title;
+
+    /** 作者 */
+    @Excel(name = "作者")
+    @TableField("author")
+    @ApiModelProperty(value = "作者")
+    private String author;
+
+    /** 新闻来源 */
+    @Excel(name = "新闻来源")
+    @TableField("source")
+    @ApiModelProperty(value = "新闻来源")
+    private String source;
+
+    /** 是否置顶 0 否 1 是 */
+    @Excel(name = "是否置顶 0 否 1 是")
+    @TableField("is_top")
+    @ApiModelProperty(value = "是否置顶 0 否 1 是")
+    private Integer isTop;
+
+    /** 新闻内容 */
+    @Excel(name = "新闻内容")
+    @TableField("content")
+    @ApiModelProperty(value = "新闻内容")
+    private String content;
+
+    /** 图片id,关联图片地址表  英文逗号隔开 */
+    @Excel(name = "图片id,关联图片地址表  英文逗号隔开")
+    @TableField("img")
+    @ApiModelProperty(value = "图片id,关联图片地址表  英文逗号隔开")
+    private String img;
+
+    /** 类型/ 1、曝光台;2、行业资讯;3、免费回炉;4通知公告 */
+    @Excel(name = "类型/ 1、曝光台;2、行业资讯;3、免费回炉;4通知公告")
+    @TableField("type")
+    @ApiModelProperty(value = "类型/ 1、曝光台;2、行业资讯;3、免费回炉;4通知公告")
+    private Integer type;
+
+    /** 阅读次数 */
+    @Excel(name = "阅读次数")
+    @TableField("read_Num")
+    @ApiModelProperty(value = "阅读次数")
+    private Long readNum;
+
+    /** 逻辑删除标识(1:是;0:否) */
+    @Excel(name = "逻辑删除标识", readConverterExp = "1=:是;0:否")
+    @TableField("removed")
+    @ApiModelProperty(value = "逻辑删除标识(1:是;0:否)")
+    private Integer removed;
+
+
+}

+ 122 - 0
hzgzpt-system/src/main/java/com/miaxis/system/domain/SchoolRegion.java

@@ -0,0 +1,122 @@
+package com.miaxis.system.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.miaxis.common.annotation.Excel;
+import com.miaxis.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+/**
+ * 驾校训练场对象 school_region
+ *
+ * @author miaxis
+ * @date 2020-12-23
+ */
+@Data
+@TableName("school_region")
+@ApiModel(value = "SchoolRegion", description = "驾校训练场对象 school_region")
+public class SchoolRegion extends BaseEntity{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    @TableId(value = "id")
+    @ApiModelProperty(value = "$column.columnComment")
+    private Long id;
+
+    /** 运政ID */
+    @Excel(name = "运政ID")
+    @TableField("school_id")
+    @ApiModelProperty(value = "运政ID")
+    private String schoolId;
+
+    /** 驾校全国统一编号 */
+    @Excel(name = "驾校全国统一编号")
+    @TableField("inscode")
+    @ApiModelProperty(value = "驾校全国统一编号")
+    private String inscode;
+
+    /** 教学区域编号 计时平台顺序编号 */
+    @Excel(name = "教学区域编号 计时平台顺序编号")
+    @TableField("seq")
+    @ApiModelProperty(value = "教学区域编号 计时平台顺序编号")
+    private String seq;
+
+    /** 教学区域名称 */
+    @Excel(name = "教学区域名称")
+    @TableField("name")
+    @ApiModelProperty(value = "教学区域名称")
+    private String name;
+
+    /** 教学区域地址 */
+    @Excel(name = "教学区域地址")
+    @TableField("address")
+    @ApiModelProperty(value = "教学区域地址")
+    private String address;
+
+    /** 教学区域面积 */
+    @Excel(name = "教学区域面积")
+    @TableField("area")
+    @ApiModelProperty(value = "教学区域面积")
+    private Long area;
+
+    /** 教学区域类型 1:第二部分;2:第三部分 */
+    @Excel(name = "教学区域类型 1:第二部分;2:第三部分")
+    @TableField("type")
+    @ApiModelProperty(value = "教学区域类型 1:第二部分;2:第三部分")
+    private Long type;
+
+    /** 培训车型 */
+    @Excel(name = "培训车型")
+    @TableField("vehicletype")
+    @ApiModelProperty(value = "培训车型")
+    private String vehicletype;
+
+    /** 电子围栏 */
+    @Excel(name = "电子围栏")
+    @TableField("polygon")
+    @ApiModelProperty(value = "电子围栏")
+    private String polygon;
+
+    /** 可容纳车辆数 */
+    @Excel(name = "可容纳车辆数")
+    @TableField("totalvehnum")
+    @ApiModelProperty(value = "可容纳车辆数")
+    private Long totalvehnum;
+
+    /** 已投放车辆数 */
+    @Excel(name = "已投放车辆数")
+    @TableField("curvehnum")
+    @ApiModelProperty(value = "已投放车辆数")
+    private Long curvehnum;
+
+    /** 备案状态: 0:未备案 1:已备案 */
+    @Excel(name = "备案状态: 0:未备案 1:已备案")
+    @TableField("status")
+    @ApiModelProperty(value = "备案状态: 0:未备案 1:已备案")
+    private Long status;
+
+    /** 审核状态: 0:待审核 1:同意启用 2:不同意启用 */
+    @Excel(name = "审核状态: 0:待审核 1:同意启用 2:不同意启用")
+    @TableField("crdate")
+    @ApiModelProperty(value = "审核状态: 0:待审核 1:同意启用 2:不同意启用")
+    private Long crdate;
+
+    /** 审核时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd")
+    @TableField("flag")
+    @ApiModelProperty(value = "审核时间")
+    private Date flag;
+
+    /** 区县编号 */
+    @Excel(name = "区县编号")
+    @TableField("area_code")
+    @ApiModelProperty(value = "区县编号")
+    private String areaCode;
+
+}

+ 61 - 0
hzgzpt-system/src/main/java/com/miaxis/system/mapper/NewsInfoMapper.java

@@ -0,0 +1,61 @@
+package com.miaxis.system.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.miaxis.system.domain.NewsInfo;
+
+/**
+ * 新闻(首页资讯、通知、公告相关)Mapper接口
+ *
+ * @author miaxis
+ * @date 2020-12-22
+ */
+public interface NewsInfoMapper extends BaseMapper<NewsInfo> {
+    /**
+     * 查询新闻(首页资讯、通知、公告相关)
+     *
+     * @param id 新闻(首页资讯、通知、公告相关)ID
+     * @return 新闻(首页资讯、通知、公告相关)
+     */
+    public NewsInfo selectNewsInfoById(Long id);
+
+    /**
+     * 查询新闻(首页资讯、通知、公告相关)列表
+     *
+     * @param newsInfo 新闻(首页资讯、通知、公告相关)
+     * @return 新闻(首页资讯、通知、公告相关)集合
+     */
+    public List<NewsInfo> selectNewsInfoList(NewsInfo newsInfo);
+
+    /**
+     * 新增新闻(首页资讯、通知、公告相关)
+     *
+     * @param newsInfo 新闻(首页资讯、通知、公告相关)
+     * @return 结果
+     */
+    public int insertNewsInfo(NewsInfo newsInfo);
+
+    /**
+     * 修改新闻(首页资讯、通知、公告相关)
+     *
+     * @param newsInfo 新闻(首页资讯、通知、公告相关)
+     * @return 结果
+     */
+    public int updateNewsInfo(NewsInfo newsInfo);
+
+    /**
+     * 删除新闻(首页资讯、通知、公告相关)
+     *
+     * @param id 新闻(首页资讯、通知、公告相关)ID
+     * @return 结果
+     */
+    public int deleteNewsInfoById(Long id);
+
+    /**
+     * 批量删除新闻(首页资讯、通知、公告相关)
+     *
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteNewsInfoByIds(Long[] ids);
+}

+ 61 - 0
hzgzpt-system/src/main/java/com/miaxis/system/mapper/SchoolRegionMapper.java

@@ -0,0 +1,61 @@
+package com.miaxis.system.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.miaxis.system.domain.SchoolRegion;
+
+/**
+ * 驾校训练场Mapper接口
+ *
+ * @author miaxis
+ * @date 2020-12-23
+ */
+public interface SchoolRegionMapper extends BaseMapper<SchoolRegion> {
+    /**
+     * 查询驾校训练场
+     *
+     * @param id 驾校训练场ID
+     * @return 驾校训练场
+     */
+    public SchoolRegion selectSchoolRegionById(Long id);
+
+    /**
+     * 查询驾校训练场列表
+     *
+     * @param schoolRegion 驾校训练场
+     * @return 驾校训练场集合
+     */
+    public List<SchoolRegion> selectSchoolRegionList(SchoolRegion schoolRegion);
+
+    /**
+     * 新增驾校训练场
+     *
+     * @param schoolRegion 驾校训练场
+     * @return 结果
+     */
+    public int insertSchoolRegion(SchoolRegion schoolRegion);
+
+    /**
+     * 修改驾校训练场
+     *
+     * @param schoolRegion 驾校训练场
+     * @return 结果
+     */
+    public int updateSchoolRegion(SchoolRegion schoolRegion);
+
+    /**
+     * 删除驾校训练场
+     *
+     * @param id 驾校训练场ID
+     * @return 结果
+     */
+    public int deleteSchoolRegionById(Long id);
+
+    /**
+     * 批量删除驾校训练场
+     *
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteSchoolRegionByIds(Long[] ids);
+}

+ 61 - 0
hzgzpt-system/src/main/java/com/miaxis/system/service/INewsInfoService.java

@@ -0,0 +1,61 @@
+package com.miaxis.system.service;
+
+import java.util.List;
+import com.miaxis.system.domain.NewsInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 新闻(首页资讯、通知、公告相关)Service接口
+ * 
+ * @author miaxis
+ * @date 2020-12-22
+ */
+public interface INewsInfoService extends IService<NewsInfo>{
+    /**
+     * 查询新闻(首页资讯、通知、公告相关)
+     * 
+     * @param id 新闻(首页资讯、通知、公告相关)ID
+     * @return 新闻(首页资讯、通知、公告相关)
+     */
+    public NewsInfo selectNewsInfoById(Long id);
+
+    /**
+     * 查询新闻(首页资讯、通知、公告相关)列表
+     * 
+     * @param newsInfo 新闻(首页资讯、通知、公告相关)
+     * @return 新闻(首页资讯、通知、公告相关)集合
+     */
+    public List<NewsInfo> selectNewsInfoList(NewsInfo newsInfo);
+
+    /**
+     * 新增新闻(首页资讯、通知、公告相关)
+     * 
+     * @param newsInfo 新闻(首页资讯、通知、公告相关)
+     * @return 结果
+     */
+    public int insertNewsInfo(NewsInfo newsInfo);
+
+    /**
+     * 修改新闻(首页资讯、通知、公告相关)
+     * 
+     * @param newsInfo 新闻(首页资讯、通知、公告相关)
+     * @return 结果
+     */
+    public int updateNewsInfo(NewsInfo newsInfo);
+
+    /**
+     * 批量删除新闻(首页资讯、通知、公告相关)
+     * 
+     * @param ids 需要删除的新闻(首页资讯、通知、公告相关)ID
+     * @return 结果
+     */
+    public int deleteNewsInfoByIds(Long[] ids);
+
+    /**
+     * 删除新闻(首页资讯、通知、公告相关)信息
+     * 
+     * @param id 新闻(首页资讯、通知、公告相关)ID
+     * @return 结果
+     */
+    public int deleteNewsInfoById(Long id);
+}

+ 61 - 0
hzgzpt-system/src/main/java/com/miaxis/system/service/ISchoolRegionService.java

@@ -0,0 +1,61 @@
+package com.miaxis.system.service;
+
+import java.util.List;
+import com.miaxis.system.domain.SchoolRegion;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 驾校训练场Service接口
+ * 
+ * @author miaxis
+ * @date 2020-12-23
+ */
+public interface ISchoolRegionService extends IService<SchoolRegion>{
+    /**
+     * 查询驾校训练场
+     * 
+     * @param id 驾校训练场ID
+     * @return 驾校训练场
+     */
+    public SchoolRegion selectSchoolRegionById(Long id);
+
+    /**
+     * 查询驾校训练场列表
+     * 
+     * @param schoolRegion 驾校训练场
+     * @return 驾校训练场集合
+     */
+    public List<SchoolRegion> selectSchoolRegionList(SchoolRegion schoolRegion);
+
+    /**
+     * 新增驾校训练场
+     * 
+     * @param schoolRegion 驾校训练场
+     * @return 结果
+     */
+    public int insertSchoolRegion(SchoolRegion schoolRegion);
+
+    /**
+     * 修改驾校训练场
+     * 
+     * @param schoolRegion 驾校训练场
+     * @return 结果
+     */
+    public int updateSchoolRegion(SchoolRegion schoolRegion);
+
+    /**
+     * 批量删除驾校训练场
+     * 
+     * @param ids 需要删除的驾校训练场ID
+     * @return 结果
+     */
+    public int deleteSchoolRegionByIds(Long[] ids);
+
+    /**
+     * 删除驾校训练场信息
+     * 
+     * @param id 驾校训练场ID
+     * @return 结果
+     */
+    public int deleteSchoolRegionById(Long id);
+}

+ 90 - 0
hzgzpt-system/src/main/java/com/miaxis/system/service/impl/NewsInfoServiceImpl.java

@@ -0,0 +1,90 @@
+package com.miaxis.system.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.system.mapper.NewsInfoMapper;
+import com.miaxis.system.domain.NewsInfo;
+import com.miaxis.system.service.INewsInfoService;
+
+/**
+ * 新闻(首页资讯、通知、公告相关)Service业务层处理
+ *
+ * @author miaxis
+ * @date 2020-12-22
+ */
+@Service
+public class NewsInfoServiceImpl extends ServiceImpl<NewsInfoMapper, NewsInfo> implements INewsInfoService {
+    @Autowired
+    private NewsInfoMapper newsInfoMapper;
+
+    /**
+     * 查询新闻(首页资讯、通知、公告相关)
+     *
+     * @param id 新闻(首页资讯、通知、公告相关)ID
+     * @return 新闻(首页资讯、通知、公告相关)
+     */
+    @Override
+    public NewsInfo selectNewsInfoById(Long id){
+        return newsInfoMapper.selectNewsInfoById(id);
+    }
+
+    /**
+     * 查询新闻(首页资讯、通知、公告相关)列表
+     *
+     * @param newsInfo 新闻(首页资讯、通知、公告相关)
+     * @return 新闻(首页资讯、通知、公告相关)
+     */
+    @Override
+    public List<NewsInfo> selectNewsInfoList(NewsInfo newsInfo){
+        return newsInfoMapper.selectNewsInfoList(newsInfo);
+    }
+
+    /**
+     * 新增新闻(首页资讯、通知、公告相关)
+     *
+     * @param newsInfo 新闻(首页资讯、通知、公告相关)
+     * @return 结果
+     */
+    @Override
+    public int insertNewsInfo(NewsInfo newsInfo){
+        newsInfo.setCreateTime(DateUtils.getNowDate());
+        return newsInfoMapper.insertNewsInfo(newsInfo);
+    }
+
+    /**
+     * 修改新闻(首页资讯、通知、公告相关)
+     *
+     * @param newsInfo 新闻(首页资讯、通知、公告相关)
+     * @return 结果
+     */
+    @Override
+    public int updateNewsInfo(NewsInfo newsInfo){
+        newsInfo.setUpdateTime(DateUtils.getNowDate());
+        return newsInfoMapper.updateNewsInfo(newsInfo);
+    }
+
+    /**
+     * 批量删除新闻(首页资讯、通知、公告相关)
+     *
+     * @param ids 需要删除的新闻(首页资讯、通知、公告相关)ID
+     * @return 结果
+     */
+    @Override
+    public int deleteNewsInfoByIds(Long[] ids){
+        return newsInfoMapper.deleteNewsInfoByIds(ids);
+    }
+
+    /**
+     * 删除新闻(首页资讯、通知、公告相关)信息
+     *
+     * @param id 新闻(首页资讯、通知、公告相关)ID
+     * @return 结果
+     */
+    @Override
+    public int deleteNewsInfoById(Long id){
+        return newsInfoMapper.deleteNewsInfoById(id);
+    }
+}

+ 90 - 0
hzgzpt-system/src/main/java/com/miaxis/system/service/impl/SchoolRegionServiceImpl.java

@@ -0,0 +1,90 @@
+package com.miaxis.system.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.system.mapper.SchoolRegionMapper;
+import com.miaxis.system.domain.SchoolRegion;
+import com.miaxis.system.service.ISchoolRegionService;
+
+/**
+ * 驾校训练场Service业务层处理
+ *
+ * @author miaxis
+ * @date 2020-12-23
+ */
+@Service
+public class SchoolRegionServiceImpl extends ServiceImpl<SchoolRegionMapper, SchoolRegion> implements ISchoolRegionService {
+    @Autowired
+    private SchoolRegionMapper schoolRegionMapper;
+
+    /**
+     * 查询驾校训练场
+     *
+     * @param id 驾校训练场ID
+     * @return 驾校训练场
+     */
+    @Override
+    public SchoolRegion selectSchoolRegionById(Long id){
+        return schoolRegionMapper.selectSchoolRegionById(id);
+    }
+
+    /**
+     * 查询驾校训练场列表
+     *
+     * @param schoolRegion 驾校训练场
+     * @return 驾校训练场
+     */
+    @Override
+    public List<SchoolRegion> selectSchoolRegionList(SchoolRegion schoolRegion){
+        return schoolRegionMapper.selectSchoolRegionList(schoolRegion);
+    }
+
+    /**
+     * 新增驾校训练场
+     *
+     * @param schoolRegion 驾校训练场
+     * @return 结果
+     */
+    @Override
+    public int insertSchoolRegion(SchoolRegion schoolRegion){
+        schoolRegion.setCreateTime(DateUtils.getNowDate());
+        return schoolRegionMapper.insertSchoolRegion(schoolRegion);
+    }
+
+    /**
+     * 修改驾校训练场
+     *
+     * @param schoolRegion 驾校训练场
+     * @return 结果
+     */
+    @Override
+    public int updateSchoolRegion(SchoolRegion schoolRegion){
+        schoolRegion.setUpdateTime(DateUtils.getNowDate());
+        return schoolRegionMapper.updateSchoolRegion(schoolRegion);
+    }
+
+    /**
+     * 批量删除驾校训练场
+     *
+     * @param ids 需要删除的驾校训练场ID
+     * @return 结果
+     */
+    @Override
+    public int deleteSchoolRegionByIds(Long[] ids){
+        return schoolRegionMapper.deleteSchoolRegionByIds(ids);
+    }
+
+    /**
+     * 删除驾校训练场信息
+     *
+     * @param id 驾校训练场ID
+     * @return 结果
+     */
+    @Override
+    public int deleteSchoolRegionById(Long id){
+        return schoolRegionMapper.deleteSchoolRegionById(id);
+    }
+}

+ 118 - 0
hzgzpt-system/src/main/resources/mapper/system/NewsInfoMapper.xml

@@ -0,0 +1,118 @@
+<?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.system.mapper.NewsInfoMapper">
+    
+    <resultMap type="NewsInfo" id="NewsInfoResult">
+        <result property="id"    column="id"    />
+        <result property="title"    column="title"    />
+        <result property="author"    column="author"    />
+        <result property="source"    column="source"    />
+        <result property="isTop"    column="is_top"    />
+        <result property="content"    column="content"    />
+        <result property="img"    column="img"    />
+        <result property="type"    column="type"    />
+        <result property="readNum"    column="read_Num"    />
+        <result property="remark"    column="remark"    />
+        <result property="removed"    column="removed"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectNewsInfoVo">
+        select id, title, author, source, is_top, content, img, type, read_Num, remark, removed, create_by, create_time, update_by, update_time from news_info
+    </sql>
+
+    <select id="selectNewsInfoList" parameterType="NewsInfo" resultMap="NewsInfoResult">
+        <include refid="selectNewsInfoVo"/>
+        <where>  
+            <if test="title != null  and title != ''"> and title = #{title}</if>
+            <if test="author != null  and author != ''"> and author = #{author}</if>
+            <if test="source != null  and source != ''"> and source = #{source}</if>
+            <if test="isTop != null "> and is_top = #{isTop}</if>
+            <if test="content != null  and content != ''"> and content = #{content}</if>
+            <if test="img != null  and img != ''"> and img = #{img}</if>
+            <if test="type != null "> and type = #{type}</if>
+            <if test="readNum != null "> and read_Num = #{readNum}</if>
+            <if test="removed != null "> and removed = #{removed}</if>
+        </where>
+        order by `create_time` desc
+    </select>
+    
+    <select id="selectNewsInfoById" parameterType="Long" resultMap="NewsInfoResult">
+        <include refid="selectNewsInfoVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertNewsInfo" parameterType="NewsInfo" useGeneratedKeys="true" keyProperty="id">
+        insert into news_info
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="title != null">title,</if>
+            <if test="author != null">author,</if>
+            <if test="source != null">source,</if>
+            <if test="isTop != null">is_top,</if>
+            <if test="content != null">content,</if>
+            <if test="img != null">img,</if>
+            <if test="type != null">type,</if>
+            <if test="readNum != null">read_Num,</if>
+            <if test="remark != null">remark,</if>
+            <if test="removed != null">removed,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="title != null">#{title},</if>
+            <if test="author != null">#{author},</if>
+            <if test="source != null">#{source},</if>
+            <if test="isTop != null">#{isTop},</if>
+            <if test="content != null">#{content},</if>
+            <if test="img != null">#{img},</if>
+            <if test="type != null">#{type},</if>
+            <if test="readNum != null">#{readNum},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="removed != null">#{removed},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateNewsInfo" parameterType="NewsInfo">
+        update news_info
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="title != null">title = #{title},</if>
+            <if test="author != null">author = #{author},</if>
+            <if test="source != null">source = #{source},</if>
+            <if test="isTop != null">is_top = #{isTop},</if>
+            <if test="content != null">content = #{content},</if>
+            <if test="img != null">img = #{img},</if>
+            <if test="type != null">type = #{type},</if>
+            <if test="readNum != null">read_Num = #{readNum},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="removed != null">removed = #{removed},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteNewsInfoById" parameterType="Long">
+        delete from news_info where id = #{id}
+    </delete>
+
+    <delete id="deleteNewsInfoByIds" parameterType="String">
+        delete from news_info where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+    
+</mapper>

+ 137 - 0
hzgzpt-system/src/main/resources/mapper/system/SchoolRegionMapper.xml

@@ -0,0 +1,137 @@
+<?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.system.mapper.SchoolRegionMapper">
+    
+    <resultMap type="SchoolRegion" id="SchoolRegionResult">
+        <result property="id"    column="id"    />
+        <result property="schoolId"    column="school_id"    />
+        <result property="inscode"    column="inscode"    />
+        <result property="seq"    column="seq"    />
+        <result property="name"    column="name"    />
+        <result property="address"    column="address"    />
+        <result property="area"    column="area"    />
+        <result property="type"    column="type"    />
+        <result property="vehicletype"    column="vehicletype"    />
+        <result property="polygon"    column="polygon"    />
+        <result property="totalvehnum"    column="totalvehnum"    />
+        <result property="curvehnum"    column="curvehnum"    />
+        <result property="status"    column="status"    />
+        <result property="crdate"    column="crdate"    />
+        <result property="flag"    column="flag"    />
+        <result property="areaCode"    column="area_code"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectSchoolRegionVo">
+        select id, school_id, inscode, seq, name, address, area, type, vehicletype, polygon, totalvehnum, curvehnum, status, crdate, flag, area_code, create_time, update_time from school_region
+    </sql>
+
+    <select id="selectSchoolRegionList" parameterType="SchoolRegion" resultMap="SchoolRegionResult">
+        <include refid="selectSchoolRegionVo"/>
+        <where>  
+            <if test="schoolId != null  and schoolId != ''"> and school_id = #{schoolId}</if>
+            <if test="inscode != null  and inscode != ''"> and inscode = #{inscode}</if>
+            <if test="seq != null  and seq != ''"> and seq = #{seq}</if>
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="address != null  and address != ''"> and address = #{address}</if>
+            <if test="area != null "> and area = #{area}</if>
+            <if test="type != null "> and type = #{type}</if>
+            <if test="vehicletype != null  and vehicletype != ''"> and vehicletype = #{vehicletype}</if>
+            <if test="polygon != null  and polygon != ''"> and polygon = #{polygon}</if>
+            <if test="totalvehnum != null "> and totalvehnum = #{totalvehnum}</if>
+            <if test="curvehnum != null "> and curvehnum = #{curvehnum}</if>
+            <if test="status != null "> and status = #{status}</if>
+            <if test="crdate != null "> and crdate = #{crdate}</if>
+            <if test="flag != null "> and flag = #{flag}</if>
+            <if test="areaCode != null  and areaCode != ''"> and area_code = #{areaCode}</if>
+        </where>
+    </select>
+    
+    <select id="selectSchoolRegionById" parameterType="Long" resultMap="SchoolRegionResult">
+        <include refid="selectSchoolRegionVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertSchoolRegion" parameterType="SchoolRegion">
+        insert into school_region
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="schoolId != null">school_id,</if>
+            <if test="inscode != null">inscode,</if>
+            <if test="seq != null">seq,</if>
+            <if test="name != null">name,</if>
+            <if test="address != null">address,</if>
+            <if test="area != null">area,</if>
+            <if test="type != null">type,</if>
+            <if test="vehicletype != null">vehicletype,</if>
+            <if test="polygon != null">polygon,</if>
+            <if test="totalvehnum != null">totalvehnum,</if>
+            <if test="curvehnum != null">curvehnum,</if>
+            <if test="status != null">status,</if>
+            <if test="crdate != null">crdate,</if>
+            <if test="flag != null">flag,</if>
+            <if test="areaCode != null">area_code,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="schoolId != null">#{schoolId},</if>
+            <if test="inscode != null">#{inscode},</if>
+            <if test="seq != null">#{seq},</if>
+            <if test="name != null">#{name},</if>
+            <if test="address != null">#{address},</if>
+            <if test="area != null">#{area},</if>
+            <if test="type != null">#{type},</if>
+            <if test="vehicletype != null">#{vehicletype},</if>
+            <if test="polygon != null">#{polygon},</if>
+            <if test="totalvehnum != null">#{totalvehnum},</if>
+            <if test="curvehnum != null">#{curvehnum},</if>
+            <if test="status != null">#{status},</if>
+            <if test="crdate != null">#{crdate},</if>
+            <if test="flag != null">#{flag},</if>
+            <if test="areaCode != null">#{areaCode},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateSchoolRegion" parameterType="SchoolRegion">
+        update school_region
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="schoolId != null">school_id = #{schoolId},</if>
+            <if test="inscode != null">inscode = #{inscode},</if>
+            <if test="seq != null">seq = #{seq},</if>
+            <if test="name != null">name = #{name},</if>
+            <if test="address != null">address = #{address},</if>
+            <if test="area != null">area = #{area},</if>
+            <if test="type != null">type = #{type},</if>
+            <if test="vehicletype != null">vehicletype = #{vehicletype},</if>
+            <if test="polygon != null">polygon = #{polygon},</if>
+            <if test="totalvehnum != null">totalvehnum = #{totalvehnum},</if>
+            <if test="curvehnum != null">curvehnum = #{curvehnum},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="crdate != null">crdate = #{crdate},</if>
+            <if test="flag != null">flag = #{flag},</if>
+            <if test="areaCode != null">area_code = #{areaCode},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteSchoolRegionById" parameterType="Long">
+        delete from school_region where id = #{id}
+    </delete>
+
+    <delete id="deleteSchoolRegionByIds" parameterType="String">
+        delete from school_region where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+    
+</mapper>