作者 王勇

统一接口,增加公司信息业务

  1 +package com.sunyo.wlpt.dispatch.controller;
  2 +
  3 +import com.github.pagehelper.PageInfo;
  4 +import com.sunyo.wlpt.dispatch.domain.CompanyInfo;
  5 +import com.sunyo.wlpt.dispatch.response.ResultJson;
  6 +import com.sunyo.wlpt.dispatch.service.CompanyInfoService;
  7 +import com.sunyo.wlpt.dispatch.utils.GetUUID;
  8 +import io.swagger.annotations.Api;
  9 +import io.swagger.annotations.ApiOperation;
  10 +import io.swagger.annotations.ApiParam;
  11 +import org.springframework.beans.factory.annotation.Autowired;
  12 +import org.springframework.web.bind.annotation.*;
  13 +
  14 +/**
  15 + * @author 子诚
  16 + * Description:公司信息 Controller
  17 + * 时间:2020/4/28 15:41
  18 + */
  19 +@Api(value = "公司信息,业务", tags = "业务管理——公司信息")
  20 +@RequestMapping("dispatch/companyInfo")
  21 +@RestController
  22 +public class CompanyInfoController {
  23 + @Autowired
  24 + private CompanyInfoService companyInfoService;
  25 +
  26 + @ApiOperation("分页查询,公司信息列表")
  27 + @GetMapping("/selectCompanyInfoList")
  28 + public ResultJson<PageInfo> selectCompanyInfoList(
  29 + @ApiParam(name = "companyName", value = "公司名称", required = false)
  30 + @RequestParam(value = "companyName", required = false) String companyName,
  31 + @ApiParam(name = "companyMobile", value = "公司联系方式", required = false)
  32 + @RequestParam(value = "companyMobile", required = false) String companyMobile,
  33 + @ApiParam(name = "pageNum", value = "第几页,默认为第一页", required = false)
  34 + @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
  35 + @ApiParam(name = "pageSize", value = "每页数量,默认10条", required = false)
  36 + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
  37 + ResultJson<PageInfo> result = new ResultJson<>();
  38 + CompanyInfo companyInfo = new CompanyInfo();
  39 + if("".equals(companyName)){
  40 + companyInfo.setCompanyName(companyName);
  41 + }
  42 + if("".equals(companyMobile)){
  43 + companyInfo.setCompanyMobile(companyMobile);
  44 + }
  45 + PageInfo pageInfo = companyInfoService.selectCompanyInfoList(companyInfo, pageNum, pageSize);
  46 + if (pageInfo.getTotal() > 0) {
  47 + result.setData(pageInfo);
  48 + result.setMsg("查询公司信息,成功");
  49 + } else {
  50 + result.setCode("400");
  51 + result.setMsg("查询公司信息,失败");
  52 + }
  53 + return result;
  54 + }
  55 +
  56 + @ApiOperation("增加,公司信息")
  57 + @PostMapping("/insertCompanyInfo")
  58 + public ResultJson insertCompanyInfo(@RequestBody CompanyInfo companyInfo) {
  59 + ResultJson result = new ResultJson();
  60 + companyInfo.setId(GetUUID.getuuid());
  61 + int num = companyInfoService.insertSelective(companyInfo);
  62 + if (num > 0) {
  63 + result.setMsg("增加公司信息,成功");
  64 + } else {
  65 + result.setCode("400");
  66 + result.setMsg("增加公司信息,失败");
  67 + }
  68 + return result;
  69 + }
  70 +
  71 + @ApiOperation("编辑,公司信息")
  72 + @PutMapping("/updateCompanyInfo")
  73 + public ResultJson updateCompanyInfo(@RequestBody CompanyInfo companyInfo) {
  74 + ResultJson result = new ResultJson();
  75 + int num = companyInfoService.updateByPrimaryKeySelective(companyInfo);
  76 + if (num > 0) {
  77 + result.setMsg("修改公司信息,成功");
  78 + } else {
  79 + result.setCode("400");
  80 + result.setMsg("修改公司信息,失败");
  81 + }
  82 + return result;
  83 + }
  84 +
  85 + @ApiOperation("删除,公司信息")
  86 + @DeleteMapping("/deleteCompanyInfo")
  87 + public ResultJson deleteCompanyInfo(@RequestBody CompanyInfo companyInfo) {
  88 + ResultJson result = new ResultJson();
  89 + int num = companyInfoService.deleteByPrimaryKey(companyInfo.getId());
  90 + if (num > 0) {
  91 + result.setMsg("删除公司信息,成功");
  92 + } else {
  93 + result.setCode("400");
  94 + result.setMsg("删除公司信息,失败");
  95 + }
  96 + return result;
  97 + }
  98 +}
@@ -21,7 +21,7 @@ import java.util.Date; @@ -21,7 +21,7 @@ import java.util.Date;
21 * 时间:2020/4/24 20:30 21 * 时间:2020/4/24 20:30
22 */ 22 */
23 @Api(value = "调度记录信息,业务", tags = "业务管理——车辆调度记录信息") 23 @Api(value = "调度记录信息,业务", tags = "业务管理——车辆调度记录信息")
24 -@RequestMapping("dispatchNote") 24 +@RequestMapping("dispatch/dispatchNote")
25 @RestController 25 @RestController
26 public class DispatchNoteController { 26 public class DispatchNoteController {
27 @Autowired 27 @Autowired
@@ -95,7 +95,7 @@ public class DispatchNoteController { @@ -95,7 +95,7 @@ public class DispatchNoteController {
95 } 95 }
96 96
97 @ApiOperation("删除调度记录信息") 97 @ApiOperation("删除调度记录信息")
98 - @DeleteMapping("/updateDispatchNote") 98 + @DeleteMapping("/deleteDispatchNote")
99 public ResultJson<DispatchNote> deleteDispatchNote(@RequestBody DispatchNote dispatchNote) { 99 public ResultJson<DispatchNote> deleteDispatchNote(@RequestBody DispatchNote dispatchNote) {
100 ResultJson<DispatchNote> result = new ResultJson<>(); 100 ResultJson<DispatchNote> result = new ResultJson<>();
101 /** 101 /**
@@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.*; @@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.*;
17 * 时间:2020/4/26 14:04 17 * 时间:2020/4/26 14:04
18 */ 18 */
19 @Api(value = "驾驶员信息管理", tags = "业务管理——驾驶员信息管理") 19 @Api(value = "驾驶员信息管理", tags = "业务管理——驾驶员信息管理")
20 -@RequestMapping("/driverInfo") 20 +@RequestMapping("dispatch/driverInfo")
21 @RestController 21 @RestController
22 public class DriverInfoController { 22 public class DriverInfoController {
23 @Autowired 23 @Autowired
@@ -19,7 +19,7 @@ import java.util.Date; @@ -19,7 +19,7 @@ import java.util.Date;
19 * 时间:2020/4/24 17:03 19 * 时间:2020/4/24 17:03
20 */ 20 */
21 @Api(value = "车辆信息", tags = "业务管理——车辆信息管理") 21 @Api(value = "车辆信息", tags = "业务管理——车辆信息管理")
22 -@RequestMapping("vehicleInfo") 22 +@RequestMapping("dispatch/vehicleInfo")
23 @RestController 23 @RestController
24 public class VehicleInfoController { 24 public class VehicleInfoController {
25 @Autowired 25 @Autowired
@@ -23,7 +23,7 @@ public class CompanyInfo implements Serializable { @@ -23,7 +23,7 @@ public class CompanyInfo implements Serializable {
23 /** 23 /**
24 * 公司信息编号uuid 24 * 公司信息编号uuid
25 */ 25 */
26 - private String id = UUID.randomUUID().toString().replaceAll("-", ""); 26 + private String id;
27 27
28 /** 28 /**
29 * 公司名称 29 * 公司名称
1 package com.sunyo.wlpt.dispatch.mapper; 1 package com.sunyo.wlpt.dispatch.mapper;
2 2
3 import com.sunyo.wlpt.dispatch.domain.CompanyInfo; 3 import com.sunyo.wlpt.dispatch.domain.CompanyInfo;
  4 +
4 import java.util.List; 5 import java.util.List;
5 6
6 import org.apache.ibatis.annotations.Mapper; 7 import org.apache.ibatis.annotations.Mapper;
@@ -13,6 +14,14 @@ import org.apache.ibatis.annotations.Param; @@ -13,6 +14,14 @@ import org.apache.ibatis.annotations.Param;
13 */ 14 */
14 @Mapper 15 @Mapper
15 public interface CompanyInfoMapper { 16 public interface CompanyInfoMapper {
  17 + /**
  18 + * 获取,公司信息列表
  19 + *
  20 + * @param record
  21 + * @return
  22 + */
  23 + List<CompanyInfo> selectCompanyInfoList(CompanyInfo record);
  24 +
16 int deleteByPrimaryKey(String id); 25 int deleteByPrimaryKey(String id);
17 26
18 int insert(CompanyInfo record); 27 int insert(CompanyInfo record);
1 package com.sunyo.wlpt.dispatch.service; 1 package com.sunyo.wlpt.dispatch.service;
2 2
  3 +import com.github.pagehelper.PageInfo;
3 import com.sunyo.wlpt.dispatch.domain.CompanyInfo; 4 import com.sunyo.wlpt.dispatch.domain.CompanyInfo;
  5 +import com.sunyo.wlpt.dispatch.domain.DispatchNote;
4 6
5 import java.util.List; 7 import java.util.List;
6 8
@@ -10,7 +12,15 @@ import java.util.List; @@ -10,7 +12,15 @@ import java.util.List;
10 * 时间:2020/4/21 14:29 12 * 时间:2020/4/21 14:29
11 */ 13 */
12 public interface CompanyInfoService { 14 public interface CompanyInfoService {
13 - 15 + /**
  16 + * 分页查询,公司信息
  17 + *
  18 + * @param companyInfo
  19 + * @param pageNum
  20 + * @param pageSize
  21 + * @return
  22 + */
  23 + PageInfo selectCompanyInfoList(CompanyInfo companyInfo, Integer pageNum, Integer pageSize);
14 24
15 int deleteByPrimaryKey(String id); 25 int deleteByPrimaryKey(String id);
16 26
1 package com.sunyo.wlpt.dispatch.service.impl; 1 package com.sunyo.wlpt.dispatch.service.impl;
2 2
  3 +import com.github.pagehelper.PageHelper;
  4 +import com.github.pagehelper.PageInfo;
  5 +import com.sunyo.wlpt.dispatch.domain.DispatchNote;
  6 +import com.sunyo.wlpt.dispatch.domain.VehicleInfo;
3 import org.springframework.stereotype.Service; 7 import org.springframework.stereotype.Service;
4 8
5 import javax.annotation.Resource; 9 import javax.annotation.Resource;
@@ -22,6 +26,24 @@ public class CompanyInfoServiceImpl implements CompanyInfoService { @@ -22,6 +26,24 @@ public class CompanyInfoServiceImpl implements CompanyInfoService {
22 @Resource 26 @Resource
23 private CompanyInfoMapper companyInfoMapper; 27 private CompanyInfoMapper companyInfoMapper;
24 28
  29 + /**
  30 + * 分页查询,调度列表
  31 + *
  32 + * @param companyInfo
  33 + * @param pageNum
  34 + * @param pageSize
  35 + * @return
  36 + */
  37 + @Override
  38 + public PageInfo selectCompanyInfoList(CompanyInfo companyInfo, Integer pageNum, Integer pageSize) {
  39 + /* 获取,公司信息列表 */
  40 + List<CompanyInfo> companyInfoList = companyInfoMapper.selectCompanyInfoList(companyInfo);
  41 + /* 使用 PageHelper 分页插件 */
  42 + PageHelper.startPage(pageNum, pageSize);
  43 + PageInfo<VehicleInfo> pageInfo = new PageInfo(companyInfoList);
  44 + return pageInfo;
  45 + }
  46 +
25 @Override 47 @Override
26 public int deleteByPrimaryKey(String id) { 48 public int deleteByPrimaryKey(String id) {
27 return companyInfoMapper.deleteByPrimaryKey(id); 49 return companyInfoMapper.deleteByPrimaryKey(id);
1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> 2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 <mapper namespace="com.sunyo.wlpt.dispatch.mapper.CompanyInfoMapper"> 3 <mapper namespace="com.sunyo.wlpt.dispatch.mapper.CompanyInfoMapper">
4 - <resultMap id="BaseResultMap" type="com.sunyo.wlpt.dispatch.domain.CompanyInfo">  
5 - <!--@mbg.generated-->  
6 - <!--@Table company_info-->  
7 - <id column="id" jdbcType="VARCHAR" property="id" />  
8 - <result column="company_name" jdbcType="VARCHAR" property="companyName" />  
9 - <result column="company_address" jdbcType="VARCHAR" property="companyAddress" />  
10 - <result column="company_mobile" jdbcType="VARCHAR" property="companyMobile" />  
11 - <result column="company_id" jdbcType="VARCHAR" property="companyId" />  
12 - <result column="company_representative" jdbcType="VARCHAR" property="companyRepresentative" />  
13 - </resultMap>  
14 - <sql id="Base_Column_List">  
15 - <!--@mbg.generated-->  
16 - id, company_name, company_address, company_mobile, company_id, company_representative  
17 - </sql>  
18 - <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">  
19 - <!--@mbg.generated-->  
20 - select  
21 - <include refid="Base_Column_List" />  
22 - from company_info  
23 - where id = #{id,jdbcType=VARCHAR}  
24 - </select>  
25 - <delete id="deleteByPrimaryKey" parameterType="java.lang.String">  
26 - <!--@mbg.generated-->  
27 - delete from company_info  
28 - where id = #{id,jdbcType=VARCHAR}  
29 - </delete>  
30 - <insert id="insert" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">  
31 - <!--@mbg.generated-->  
32 - insert into company_info (id, company_name, company_address,  
33 - company_mobile, company_id, company_representative  
34 - )  
35 - values (#{id,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR}, #{companyAddress,jdbcType=VARCHAR},  
36 - #{companyMobile,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, #{companyRepresentative,jdbcType=VARCHAR}  
37 - )  
38 - </insert>  
39 - <insert id="insertSelective" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">  
40 - <!--@mbg.generated-->  
41 - insert into company_info  
42 - <trim prefix="(" suffix=")" suffixOverrides=",">  
43 - <if test="id != null">  
44 - id,  
45 - </if>  
46 - <if test="companyName != null">  
47 - company_name,  
48 - </if>  
49 - <if test="companyAddress != null">  
50 - company_address,  
51 - </if>  
52 - <if test="companyMobile != null">  
53 - company_mobile,  
54 - </if>  
55 - <if test="companyId != null">  
56 - company_id,  
57 - </if>  
58 - <if test="companyRepresentative != null">  
59 - company_representative,  
60 - </if>  
61 - </trim>  
62 - <trim prefix="values (" suffix=")" suffixOverrides=",">  
63 - <if test="id != null">  
64 - #{id,jdbcType=VARCHAR},  
65 - </if>  
66 - <if test="companyName != null">  
67 - #{companyName,jdbcType=VARCHAR},  
68 - </if>  
69 - <if test="companyAddress != null">  
70 - #{companyAddress,jdbcType=VARCHAR},  
71 - </if>  
72 - <if test="companyMobile != null">  
73 - #{companyMobile,jdbcType=VARCHAR},  
74 - </if>  
75 - <if test="companyId != null">  
76 - #{companyId,jdbcType=VARCHAR},  
77 - </if>  
78 - <if test="companyRepresentative != null">  
79 - #{companyRepresentative,jdbcType=VARCHAR},  
80 - </if>  
81 - </trim>  
82 - </insert>  
83 - <update id="updateByPrimaryKeySelective" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">  
84 - <!--@mbg.generated-->  
85 - update company_info  
86 - <set>  
87 - <if test="companyName != null">  
88 - company_name = #{companyName,jdbcType=VARCHAR},  
89 - </if>  
90 - <if test="companyAddress != null"> 4 + <resultMap id="BaseResultMap" type="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
  5 + <!--@mbg.generated-->
  6 + <!--@Table company_info-->
  7 + <id column="id" jdbcType="VARCHAR" property="id"/>
  8 + <result column="company_name" jdbcType="VARCHAR" property="companyName"/>
  9 + <result column="company_address" jdbcType="VARCHAR" property="companyAddress"/>
  10 + <result column="company_mobile" jdbcType="VARCHAR" property="companyMobile"/>
  11 + <result column="company_id" jdbcType="VARCHAR" property="companyId"/>
  12 + <result column="company_representative" jdbcType="VARCHAR" property="companyRepresentative"/>
  13 + </resultMap>
  14 + <sql id="Base_Column_List">
  15 + <!--@mbg.generated-->
  16 + id, company_name, company_address, company_mobile, company_id, company_representative
  17 + </sql>
  18 + <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  19 + <!--@mbg.generated-->
  20 + select
  21 + <include refid="Base_Column_List"/>
  22 + from company_info
  23 + where id = #{id,jdbcType=VARCHAR}
  24 + </select>
  25 + <!-- 获取公司信息列表 -->
  26 + <select id="selectCompanyInfoList" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo"
  27 + resultMap="BaseResultMap">
  28 + select
  29 + <include refid="Base_Column_List"/>
  30 + from company_info
  31 + <where>
  32 + <trim suffixOverrides=",">
  33 + <!-- 用户姓名 -->
  34 + <if test="companyName != null and companyName != ''">
  35 + company_name = #{companyName,jdbcType=VARCHAR},
  36 + </if>
  37 + <!-- 用户联系方式 -->
  38 + <if test="companyMobile != null and companyMobile != ''">
  39 + AND company_mobile = #{companyMobile,jdbcType=VARCHAR}
  40 + </if>
  41 + </trim>
  42 + </where>
  43 + </select>
  44 + <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
  45 + <!--@mbg.generated-->
  46 + delete from company_info
  47 + where id = #{id,jdbcType=VARCHAR}
  48 + </delete>
  49 + <insert id="insert" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
  50 + <!--@mbg.generated-->
  51 + insert into company_info (id, company_name, company_address,
  52 + company_mobile, company_id, company_representative
  53 + )
  54 + values (#{id,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR}, #{companyAddress,jdbcType=VARCHAR},
  55 + #{companyMobile,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, #{companyRepresentative,jdbcType=VARCHAR}
  56 + )
  57 + </insert>
  58 + <insert id="insertSelective" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
  59 + <!--@mbg.generated-->
  60 + insert into company_info
  61 + <trim prefix="(" suffix=")" suffixOverrides=",">
  62 + <if test="id != null">
  63 + id,
  64 + </if>
  65 + <if test="companyName != null">
  66 + company_name,
  67 + </if>
  68 + <if test="companyAddress != null">
  69 + company_address,
  70 + </if>
  71 + <if test="companyMobile != null">
  72 + company_mobile,
  73 + </if>
  74 + <if test="companyId != null">
  75 + company_id,
  76 + </if>
  77 + <if test="companyRepresentative != null">
  78 + company_representative,
  79 + </if>
  80 + </trim>
  81 + <trim prefix="values (" suffix=")" suffixOverrides=",">
  82 + <if test="id != null">
  83 + #{id,jdbcType=VARCHAR},
  84 + </if>
  85 + <if test="companyName != null">
  86 + #{companyName,jdbcType=VARCHAR},
  87 + </if>
  88 + <if test="companyAddress != null">
  89 + #{companyAddress,jdbcType=VARCHAR},
  90 + </if>
  91 + <if test="companyMobile != null">
  92 + #{companyMobile,jdbcType=VARCHAR},
  93 + </if>
  94 + <if test="companyId != null">
  95 + #{companyId,jdbcType=VARCHAR},
  96 + </if>
  97 + <if test="companyRepresentative != null">
  98 + #{companyRepresentative,jdbcType=VARCHAR},
  99 + </if>
  100 + </trim>
  101 + </insert>
  102 + <update id="updateByPrimaryKeySelective" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
  103 + <!--@mbg.generated-->
  104 + update company_info
  105 + <set>
  106 + <if test="companyName != null">
  107 + company_name = #{companyName,jdbcType=VARCHAR},
  108 + </if>
  109 + <if test="companyAddress != null">
  110 + company_address = #{companyAddress,jdbcType=VARCHAR},
  111 + </if>
  112 + <if test="companyMobile != null">
  113 + company_mobile = #{companyMobile,jdbcType=VARCHAR},
  114 + </if>
  115 + <if test="companyId != null">
  116 + company_id = #{companyId,jdbcType=VARCHAR},
  117 + </if>
  118 + <if test="companyRepresentative != null">
  119 + company_representative = #{companyRepresentative,jdbcType=VARCHAR},
  120 + </if>
  121 + </set>
  122 + where id = #{id,jdbcType=VARCHAR}
  123 + </update>
  124 + <update id="updateByPrimaryKey" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
  125 + <!--@mbg.generated-->
  126 + update company_info
  127 + set company_name = #{companyName,jdbcType=VARCHAR},
91 company_address = #{companyAddress,jdbcType=VARCHAR}, 128 company_address = #{companyAddress,jdbcType=VARCHAR},
92 - </if>  
93 - <if test="companyMobile != null">  
94 company_mobile = #{companyMobile,jdbcType=VARCHAR}, 129 company_mobile = #{companyMobile,jdbcType=VARCHAR},
95 - </if>  
96 - <if test="companyId != null">  
97 company_id = #{companyId,jdbcType=VARCHAR}, 130 company_id = #{companyId,jdbcType=VARCHAR},
98 - </if>  
99 - <if test="companyRepresentative != null">  
100 - company_representative = #{companyRepresentative,jdbcType=VARCHAR},  
101 - </if>  
102 - </set>  
103 - where id = #{id,jdbcType=VARCHAR}  
104 - </update>  
105 - <update id="updateByPrimaryKey" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">  
106 - <!--@mbg.generated-->  
107 - update company_info  
108 - set company_name = #{companyName,jdbcType=VARCHAR},  
109 - company_address = #{companyAddress,jdbcType=VARCHAR},  
110 - company_mobile = #{companyMobile,jdbcType=VARCHAR},  
111 - company_id = #{companyId,jdbcType=VARCHAR},  
112 - company_representative = #{companyRepresentative,jdbcType=VARCHAR}  
113 - where id = #{id,jdbcType=VARCHAR}  
114 - </update>  
115 - <update id="updateBatch" parameterType="java.util.List">  
116 - <!--@mbg.generated-->  
117 - update company_info  
118 - <trim prefix="set" suffixOverrides=",">  
119 - <trim prefix="company_name = case" suffix="end,">  
120 - <foreach collection="list" index="index" item="item">  
121 - when id = #{item.id,jdbcType=VARCHAR} then #{item.companyName,jdbcType=VARCHAR}  
122 - </foreach>  
123 - </trim>  
124 - <trim prefix="company_address = case" suffix="end,">  
125 - <foreach collection="list" index="index" item="item">  
126 - when id = #{item.id,jdbcType=VARCHAR} then #{item.companyAddress,jdbcType=VARCHAR}  
127 - </foreach>  
128 - </trim>  
129 - <trim prefix="company_mobile = case" suffix="end,">  
130 - <foreach collection="list" index="index" item="item">  
131 - when id = #{item.id,jdbcType=VARCHAR} then #{item.companyMobile,jdbcType=VARCHAR}  
132 - </foreach>  
133 - </trim>  
134 - <trim prefix="company_id = case" suffix="end,">  
135 - <foreach collection="list" index="index" item="item">  
136 - when id = #{item.id,jdbcType=VARCHAR} then #{item.companyId,jdbcType=VARCHAR} 131 + company_representative = #{companyRepresentative,jdbcType=VARCHAR}
  132 + where id = #{id,jdbcType=VARCHAR}
  133 + </update>
  134 + <update id="updateBatch" parameterType="java.util.List">
  135 + <!--@mbg.generated-->
  136 + update company_info
  137 + <trim prefix="set" suffixOverrides=",">
  138 + <trim prefix="company_name = case" suffix="end,">
  139 + <foreach collection="list" index="index" item="item">
  140 + when id = #{item.id,jdbcType=VARCHAR} then #{item.companyName,jdbcType=VARCHAR}
  141 + </foreach>
  142 + </trim>
  143 + <trim prefix="company_address = case" suffix="end,">
  144 + <foreach collection="list" index="index" item="item">
  145 + when id = #{item.id,jdbcType=VARCHAR} then #{item.companyAddress,jdbcType=VARCHAR}
  146 + </foreach>
  147 + </trim>
  148 + <trim prefix="company_mobile = case" suffix="end,">
  149 + <foreach collection="list" index="index" item="item">
  150 + when id = #{item.id,jdbcType=VARCHAR} then #{item.companyMobile,jdbcType=VARCHAR}
  151 + </foreach>
  152 + </trim>
  153 + <trim prefix="company_id = case" suffix="end,">
  154 + <foreach collection="list" index="index" item="item">
  155 + when id = #{item.id,jdbcType=VARCHAR} then #{item.companyId,jdbcType=VARCHAR}
  156 + </foreach>
  157 + </trim>
  158 + <trim prefix="company_representative = case" suffix="end,">
  159 + <foreach collection="list" index="index" item="item">
  160 + when id = #{item.id,jdbcType=VARCHAR} then #{item.companyRepresentative,jdbcType=VARCHAR}
  161 + </foreach>
  162 + </trim>
  163 + </trim>
  164 + where id in
  165 + <foreach close=")" collection="list" item="item" open="(" separator=", ">
  166 + #{item.id,jdbcType=VARCHAR}
137 </foreach> 167 </foreach>
138 - </trim>  
139 - <trim prefix="company_representative = case" suffix="end,">  
140 - <foreach collection="list" index="index" item="item">  
141 - when id = #{item.id,jdbcType=VARCHAR} then #{item.companyRepresentative,jdbcType=VARCHAR} 168 + </update>
  169 + <update id="updateBatchSelective" parameterType="java.util.List">
  170 + <!--@mbg.generated-->
  171 + update company_info
  172 + <trim prefix="set" suffixOverrides=",">
  173 + <trim prefix="company_name = case" suffix="end,">
  174 + <foreach collection="list" index="index" item="item">
  175 + <if test="item.companyName != null">
  176 + when id = #{item.id,jdbcType=VARCHAR} then #{item.companyName,jdbcType=VARCHAR}
  177 + </if>
  178 + </foreach>
  179 + </trim>
  180 + <trim prefix="company_address = case" suffix="end,">
  181 + <foreach collection="list" index="index" item="item">
  182 + <if test="item.companyAddress != null">
  183 + when id = #{item.id,jdbcType=VARCHAR} then #{item.companyAddress,jdbcType=VARCHAR}
  184 + </if>
  185 + </foreach>
  186 + </trim>
  187 + <trim prefix="company_mobile = case" suffix="end,">
  188 + <foreach collection="list" index="index" item="item">
  189 + <if test="item.companyMobile != null">
  190 + when id = #{item.id,jdbcType=VARCHAR} then #{item.companyMobile,jdbcType=VARCHAR}
  191 + </if>
  192 + </foreach>
  193 + </trim>
  194 + <trim prefix="company_id = case" suffix="end,">
  195 + <foreach collection="list" index="index" item="item">
  196 + <if test="item.companyId != null">
  197 + when id = #{item.id,jdbcType=VARCHAR} then #{item.companyId,jdbcType=VARCHAR}
  198 + </if>
  199 + </foreach>
  200 + </trim>
  201 + <trim prefix="company_representative = case" suffix="end,">
  202 + <foreach collection="list" index="index" item="item">
  203 + <if test="item.companyRepresentative != null">
  204 + when id = #{item.id,jdbcType=VARCHAR} then #{item.companyRepresentative,jdbcType=VARCHAR}
  205 + </if>
  206 + </foreach>
  207 + </trim>
  208 + </trim>
  209 + where id in
  210 + <foreach close=")" collection="list" item="item" open="(" separator=", ">
  211 + #{item.id,jdbcType=VARCHAR}
142 </foreach> 212 </foreach>
143 - </trim>  
144 - </trim>  
145 - where id in  
146 - <foreach close=")" collection="list" item="item" open="(" separator=", ">  
147 - #{item.id,jdbcType=VARCHAR}  
148 - </foreach>  
149 - </update>  
150 - <update id="updateBatchSelective" parameterType="java.util.List">  
151 - <!--@mbg.generated-->  
152 - update company_info  
153 - <trim prefix="set" suffixOverrides=",">  
154 - <trim prefix="company_name = case" suffix="end,">  
155 - <foreach collection="list" index="index" item="item">  
156 - <if test="item.companyName != null">  
157 - when id = #{item.id,jdbcType=VARCHAR} then #{item.companyName,jdbcType=VARCHAR}  
158 - </if>  
159 - </foreach>  
160 - </trim>  
161 - <trim prefix="company_address = case" suffix="end,">  
162 - <foreach collection="list" index="index" item="item">  
163 - <if test="item.companyAddress != null">  
164 - when id = #{item.id,jdbcType=VARCHAR} then #{item.companyAddress,jdbcType=VARCHAR}  
165 - </if>  
166 - </foreach>  
167 - </trim>  
168 - <trim prefix="company_mobile = case" suffix="end,">  
169 - <foreach collection="list" index="index" item="item">  
170 - <if test="item.companyMobile != null">  
171 - when id = #{item.id,jdbcType=VARCHAR} then #{item.companyMobile,jdbcType=VARCHAR}  
172 - </if>  
173 - </foreach>  
174 - </trim>  
175 - <trim prefix="company_id = case" suffix="end,">  
176 - <foreach collection="list" index="index" item="item">  
177 - <if test="item.companyId != null">  
178 - when id = #{item.id,jdbcType=VARCHAR} then #{item.companyId,jdbcType=VARCHAR}  
179 - </if>  
180 - </foreach>  
181 - </trim>  
182 - <trim prefix="company_representative = case" suffix="end,">  
183 - <foreach collection="list" index="index" item="item">  
184 - <if test="item.companyRepresentative != null">  
185 - when id = #{item.id,jdbcType=VARCHAR} then #{item.companyRepresentative,jdbcType=VARCHAR}  
186 - </if> 213 + </update>
  214 + <insert id="batchInsert" parameterType="map">
  215 + <!--@mbg.generated-->
  216 + insert into company_info
  217 + (id, company_name, company_address, company_mobile, company_id, company_representative
  218 + )
  219 + values
  220 + <foreach collection="list" item="item" separator=",">
  221 + (#{item.id,jdbcType=VARCHAR}, #{item.companyName,jdbcType=VARCHAR}, #{item.companyAddress,jdbcType=VARCHAR},
  222 + #{item.companyMobile,jdbcType=VARCHAR}, #{item.companyId,jdbcType=VARCHAR},
  223 + #{item.companyRepresentative,jdbcType=VARCHAR}
  224 + )
187 </foreach> 225 </foreach>
188 - </trim>  
189 - </trim>  
190 - where id in  
191 - <foreach close=")" collection="list" item="item" open="(" separator=", ">  
192 - #{item.id,jdbcType=VARCHAR}  
193 - </foreach>  
194 - </update>  
195 - <insert id="batchInsert" parameterType="map">  
196 - <!--@mbg.generated-->  
197 - insert into company_info  
198 - (id, company_name, company_address, company_mobile, company_id, company_representative  
199 - )  
200 - values  
201 - <foreach collection="list" item="item" separator=",">  
202 - (#{item.id,jdbcType=VARCHAR}, #{item.companyName,jdbcType=VARCHAR}, #{item.companyAddress,jdbcType=VARCHAR},  
203 - #{item.companyMobile,jdbcType=VARCHAR}, #{item.companyId,jdbcType=VARCHAR}, #{item.companyRepresentative,jdbcType=VARCHAR} 226 + </insert>
  227 + <insert id="insertOrUpdate" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
  228 + <!--@mbg.generated-->
  229 + insert into company_info
  230 + (id, company_name, company_address, company_mobile, company_id, company_representative
  231 + )
  232 + values
  233 + (#{id,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR}, #{companyAddress,jdbcType=VARCHAR},
  234 + #{companyMobile,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, #{companyRepresentative,jdbcType=VARCHAR}
204 ) 235 )
205 - </foreach>  
206 - </insert>  
207 - <insert id="insertOrUpdate" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">  
208 - <!--@mbg.generated-->  
209 - insert into company_info  
210 - (id, company_name, company_address, company_mobile, company_id, company_representative  
211 - )  
212 - values  
213 - (#{id,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR}, #{companyAddress,jdbcType=VARCHAR},  
214 - #{companyMobile,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, #{companyRepresentative,jdbcType=VARCHAR}  
215 - )  
216 - on duplicate key update  
217 - id = #{id,jdbcType=VARCHAR},  
218 - company_name = #{companyName,jdbcType=VARCHAR},  
219 - company_address = #{companyAddress,jdbcType=VARCHAR},  
220 - company_mobile = #{companyMobile,jdbcType=VARCHAR},  
221 - company_id = #{companyId,jdbcType=VARCHAR},  
222 - company_representative = #{companyRepresentative,jdbcType=VARCHAR}  
223 - </insert>  
224 - <insert id="insertOrUpdateSelective" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">  
225 - <!--@mbg.generated-->  
226 - insert into company_info  
227 - <trim prefix="(" suffix=")" suffixOverrides=",">  
228 - <if test="id != null">  
229 - id,  
230 - </if>  
231 - <if test="companyName != null">  
232 - company_name,  
233 - </if>  
234 - <if test="companyAddress != null">  
235 - company_address,  
236 - </if>  
237 - <if test="companyMobile != null">  
238 - company_mobile,  
239 - </if>  
240 - <if test="companyId != null">  
241 - company_id,  
242 - </if>  
243 - <if test="companyRepresentative != null">  
244 - company_representative,  
245 - </if>  
246 - </trim>  
247 - values  
248 - <trim prefix="(" suffix=")" suffixOverrides=",">  
249 - <if test="id != null">  
250 - #{id,jdbcType=VARCHAR},  
251 - </if>  
252 - <if test="companyName != null">  
253 - #{companyName,jdbcType=VARCHAR},  
254 - </if>  
255 - <if test="companyAddress != null">  
256 - #{companyAddress,jdbcType=VARCHAR},  
257 - </if>  
258 - <if test="companyMobile != null">  
259 - #{companyMobile,jdbcType=VARCHAR},  
260 - </if>  
261 - <if test="companyId != null">  
262 - #{companyId,jdbcType=VARCHAR},  
263 - </if>  
264 - <if test="companyRepresentative != null">  
265 - #{companyRepresentative,jdbcType=VARCHAR},  
266 - </if>  
267 - </trim>  
268 - on duplicate key update  
269 - <trim suffixOverrides=",">  
270 - <if test="id != null"> 236 + on duplicate key update
271 id = #{id,jdbcType=VARCHAR}, 237 id = #{id,jdbcType=VARCHAR},
272 - </if>  
273 - <if test="companyName != null">  
274 company_name = #{companyName,jdbcType=VARCHAR}, 238 company_name = #{companyName,jdbcType=VARCHAR},
275 - </if>  
276 - <if test="companyAddress != null">  
277 company_address = #{companyAddress,jdbcType=VARCHAR}, 239 company_address = #{companyAddress,jdbcType=VARCHAR},
278 - </if>  
279 - <if test="companyMobile != null">  
280 company_mobile = #{companyMobile,jdbcType=VARCHAR}, 240 company_mobile = #{companyMobile,jdbcType=VARCHAR},
281 - </if>  
282 - <if test="companyId != null">  
283 company_id = #{companyId,jdbcType=VARCHAR}, 241 company_id = #{companyId,jdbcType=VARCHAR},
284 - </if>  
285 - <if test="companyRepresentative != null">  
286 - company_representative = #{companyRepresentative,jdbcType=VARCHAR},  
287 - </if>  
288 - </trim>  
289 - </insert>  
290 -</mapper>  
  242 + company_representative = #{companyRepresentative,jdbcType=VARCHAR}
  243 + </insert>
  244 + <insert id="insertOrUpdateSelective" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
  245 + <!--@mbg.generated-->
  246 + insert into company_info
  247 + <trim prefix="(" suffix=")" suffixOverrides=",">
  248 + <if test="id != null">
  249 + id,
  250 + </if>
  251 + <if test="companyName != null">
  252 + company_name,
  253 + </if>
  254 + <if test="companyAddress != null">
  255 + company_address,
  256 + </if>
  257 + <if test="companyMobile != null">
  258 + company_mobile,
  259 + </if>
  260 + <if test="companyId != null">
  261 + company_id,
  262 + </if>
  263 + <if test="companyRepresentative != null">
  264 + company_representative,
  265 + </if>
  266 + </trim>
  267 + values
  268 + <trim prefix="(" suffix=")" suffixOverrides=",">
  269 + <if test="id != null">
  270 + #{id,jdbcType=VARCHAR},
  271 + </if>
  272 + <if test="companyName != null">
  273 + #{companyName,jdbcType=VARCHAR},
  274 + </if>
  275 + <if test="companyAddress != null">
  276 + #{companyAddress,jdbcType=VARCHAR},
  277 + </if>
  278 + <if test="companyMobile != null">
  279 + #{companyMobile,jdbcType=VARCHAR},
  280 + </if>
  281 + <if test="companyId != null">
  282 + #{companyId,jdbcType=VARCHAR},
  283 + </if>
  284 + <if test="companyRepresentative != null">
  285 + #{companyRepresentative,jdbcType=VARCHAR},
  286 + </if>
  287 + </trim>
  288 + on duplicate key update
  289 + <trim suffixOverrides=",">
  290 + <if test="id != null">
  291 + id = #{id,jdbcType=VARCHAR},
  292 + </if>
  293 + <if test="companyName != null">
  294 + company_name = #{companyName,jdbcType=VARCHAR},
  295 + </if>
  296 + <if test="companyAddress != null">
  297 + company_address = #{companyAddress,jdbcType=VARCHAR},
  298 + </if>
  299 + <if test="companyMobile != null">
  300 + company_mobile = #{companyMobile,jdbcType=VARCHAR},
  301 + </if>
  302 + <if test="companyId != null">
  303 + company_id = #{companyId,jdbcType=VARCHAR},
  304 + </if>
  305 + <if test="companyRepresentative != null">
  306 + company_representative = #{companyRepresentative,jdbcType=VARCHAR},
  307 + </if>
  308 + </trim>
  309 + </insert>
  310 +</mapper>