作者 王勇

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

package com.sunyo.wlpt.dispatch.controller;
import com.github.pagehelper.PageInfo;
import com.sunyo.wlpt.dispatch.domain.CompanyInfo;
import com.sunyo.wlpt.dispatch.response.ResultJson;
import com.sunyo.wlpt.dispatch.service.CompanyInfoService;
import com.sunyo.wlpt.dispatch.utils.GetUUID;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @author 子诚
* Description:公司信息 Controller
* 时间:2020/4/28 15:41
*/
@Api(value = "公司信息,业务", tags = "业务管理——公司信息")
@RequestMapping("dispatch/companyInfo")
@RestController
public class CompanyInfoController {
@Autowired
private CompanyInfoService companyInfoService;
@ApiOperation("分页查询,公司信息列表")
@GetMapping("/selectCompanyInfoList")
public ResultJson<PageInfo> selectCompanyInfoList(
@ApiParam(name = "companyName", value = "公司名称", required = false)
@RequestParam(value = "companyName", required = false) String companyName,
@ApiParam(name = "companyMobile", value = "公司联系方式", required = false)
@RequestParam(value = "companyMobile", required = false) String companyMobile,
@ApiParam(name = "pageNum", value = "第几页,默认为第一页", required = false)
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
@ApiParam(name = "pageSize", value = "每页数量,默认10条", required = false)
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
ResultJson<PageInfo> result = new ResultJson<>();
CompanyInfo companyInfo = new CompanyInfo();
if("".equals(companyName)){
companyInfo.setCompanyName(companyName);
}
if("".equals(companyMobile)){
companyInfo.setCompanyMobile(companyMobile);
}
PageInfo pageInfo = companyInfoService.selectCompanyInfoList(companyInfo, pageNum, pageSize);
if (pageInfo.getTotal() > 0) {
result.setData(pageInfo);
result.setMsg("查询公司信息,成功");
} else {
result.setCode("400");
result.setMsg("查询公司信息,失败");
}
return result;
}
@ApiOperation("增加,公司信息")
@PostMapping("/insertCompanyInfo")
public ResultJson insertCompanyInfo(@RequestBody CompanyInfo companyInfo) {
ResultJson result = new ResultJson();
companyInfo.setId(GetUUID.getuuid());
int num = companyInfoService.insertSelective(companyInfo);
if (num > 0) {
result.setMsg("增加公司信息,成功");
} else {
result.setCode("400");
result.setMsg("增加公司信息,失败");
}
return result;
}
@ApiOperation("编辑,公司信息")
@PutMapping("/updateCompanyInfo")
public ResultJson updateCompanyInfo(@RequestBody CompanyInfo companyInfo) {
ResultJson result = new ResultJson();
int num = companyInfoService.updateByPrimaryKeySelective(companyInfo);
if (num > 0) {
result.setMsg("修改公司信息,成功");
} else {
result.setCode("400");
result.setMsg("修改公司信息,失败");
}
return result;
}
@ApiOperation("删除,公司信息")
@DeleteMapping("/deleteCompanyInfo")
public ResultJson deleteCompanyInfo(@RequestBody CompanyInfo companyInfo) {
ResultJson result = new ResultJson();
int num = companyInfoService.deleteByPrimaryKey(companyInfo.getId());
if (num > 0) {
result.setMsg("删除公司信息,成功");
} else {
result.setCode("400");
result.setMsg("删除公司信息,失败");
}
return result;
}
}
... ...
... ... @@ -21,7 +21,7 @@ import java.util.Date;
* 时间:2020/4/24 20:30
*/
@Api(value = "调度记录信息,业务", tags = "业务管理——车辆调度记录信息")
@RequestMapping("dispatchNote")
@RequestMapping("dispatch/dispatchNote")
@RestController
public class DispatchNoteController {
@Autowired
... ... @@ -95,7 +95,7 @@ public class DispatchNoteController {
}
@ApiOperation("删除调度记录信息")
@DeleteMapping("/updateDispatchNote")
@DeleteMapping("/deleteDispatchNote")
public ResultJson<DispatchNote> deleteDispatchNote(@RequestBody DispatchNote dispatchNote) {
ResultJson<DispatchNote> result = new ResultJson<>();
/**
... ...
... ... @@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.*;
* 时间:2020/4/26 14:04
*/
@Api(value = "驾驶员信息管理", tags = "业务管理——驾驶员信息管理")
@RequestMapping("/driverInfo")
@RequestMapping("dispatch/driverInfo")
@RestController
public class DriverInfoController {
@Autowired
... ...
... ... @@ -19,7 +19,7 @@ import java.util.Date;
* 时间:2020/4/24 17:03
*/
@Api(value = "车辆信息", tags = "业务管理——车辆信息管理")
@RequestMapping("vehicleInfo")
@RequestMapping("dispatch/vehicleInfo")
@RestController
public class VehicleInfoController {
@Autowired
... ...
... ... @@ -23,7 +23,7 @@ public class CompanyInfo implements Serializable {
/**
* 公司信息编号uuid
*/
private String id = UUID.randomUUID().toString().replaceAll("-", "");
private String id;
/**
* 公司名称
... ...
package com.sunyo.wlpt.dispatch.mapper;
import com.sunyo.wlpt.dispatch.domain.CompanyInfo;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
... ... @@ -13,6 +14,14 @@ import org.apache.ibatis.annotations.Param;
*/
@Mapper
public interface CompanyInfoMapper {
/**
* 获取,公司信息列表
*
* @param record
* @return
*/
List<CompanyInfo> selectCompanyInfoList(CompanyInfo record);
int deleteByPrimaryKey(String id);
int insert(CompanyInfo record);
... ...
package com.sunyo.wlpt.dispatch.service;
import com.github.pagehelper.PageInfo;
import com.sunyo.wlpt.dispatch.domain.CompanyInfo;
import com.sunyo.wlpt.dispatch.domain.DispatchNote;
import java.util.List;
... ... @@ -10,7 +12,15 @@ import java.util.List;
* 时间:2020/4/21 14:29
*/
public interface CompanyInfoService {
/**
* 分页查询,公司信息
*
* @param companyInfo
* @param pageNum
* @param pageSize
* @return
*/
PageInfo selectCompanyInfoList(CompanyInfo companyInfo, Integer pageNum, Integer pageSize);
int deleteByPrimaryKey(String id);
... ...
package com.sunyo.wlpt.dispatch.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sunyo.wlpt.dispatch.domain.DispatchNote;
import com.sunyo.wlpt.dispatch.domain.VehicleInfo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
... ... @@ -22,6 +26,24 @@ public class CompanyInfoServiceImpl implements CompanyInfoService {
@Resource
private CompanyInfoMapper companyInfoMapper;
/**
* 分页查询,调度列表
*
* @param companyInfo
* @param pageNum
* @param pageSize
* @return
*/
@Override
public PageInfo selectCompanyInfoList(CompanyInfo companyInfo, Integer pageNum, Integer pageSize) {
/* 获取,公司信息列表 */
List<CompanyInfo> companyInfoList = companyInfoMapper.selectCompanyInfoList(companyInfo);
/* 使用 PageHelper 分页插件 */
PageHelper.startPage(pageNum, pageSize);
PageInfo<VehicleInfo> pageInfo = new PageInfo(companyInfoList);
return pageInfo;
}
@Override
public int deleteByPrimaryKey(String id) {
return companyInfoMapper.deleteByPrimaryKey(id);
... ...
<?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.sunyo.wlpt.dispatch.mapper.CompanyInfoMapper">
<resultMap id="BaseResultMap" type="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
<!--@mbg.generated-->
<!--@Table company_info-->
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="company_name" jdbcType="VARCHAR" property="companyName" />
<result column="company_address" jdbcType="VARCHAR" property="companyAddress" />
<result column="company_mobile" jdbcType="VARCHAR" property="companyMobile" />
<result column="company_id" jdbcType="VARCHAR" property="companyId" />
<result column="company_representative" jdbcType="VARCHAR" property="companyRepresentative" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, company_name, company_address, company_mobile, company_id, company_representative
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from company_info
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--@mbg.generated-->
delete from company_info
where id = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
<!--@mbg.generated-->
insert into company_info (id, company_name, company_address,
company_mobile, company_id, company_representative
)
values (#{id,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR}, #{companyAddress,jdbcType=VARCHAR},
#{companyMobile,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, #{companyRepresentative,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
<!--@mbg.generated-->
insert into company_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="companyName != null">
company_name,
</if>
<if test="companyAddress != null">
company_address,
</if>
<if test="companyMobile != null">
company_mobile,
</if>
<if test="companyId != null">
company_id,
</if>
<if test="companyRepresentative != null">
company_representative,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="companyName != null">
#{companyName,jdbcType=VARCHAR},
</if>
<if test="companyAddress != null">
#{companyAddress,jdbcType=VARCHAR},
</if>
<if test="companyMobile != null">
#{companyMobile,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
#{companyId,jdbcType=VARCHAR},
</if>
<if test="companyRepresentative != null">
#{companyRepresentative,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
<!--@mbg.generated-->
update company_info
<set>
<if test="companyName != null">
company_name = #{companyName,jdbcType=VARCHAR},
</if>
<if test="companyAddress != null">
<resultMap id="BaseResultMap" type="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
<!--@mbg.generated-->
<!--@Table company_info-->
<id column="id" jdbcType="VARCHAR" property="id"/>
<result column="company_name" jdbcType="VARCHAR" property="companyName"/>
<result column="company_address" jdbcType="VARCHAR" property="companyAddress"/>
<result column="company_mobile" jdbcType="VARCHAR" property="companyMobile"/>
<result column="company_id" jdbcType="VARCHAR" property="companyId"/>
<result column="company_representative" jdbcType="VARCHAR" property="companyRepresentative"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, company_name, company_address, company_mobile, company_id, company_representative
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List"/>
from company_info
where id = #{id,jdbcType=VARCHAR}
</select>
<!-- 获取公司信息列表 -->
<select id="selectCompanyInfoList" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo"
resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from company_info
<where>
<trim suffixOverrides=",">
<!-- 用户姓名 -->
<if test="companyName != null and companyName != ''">
company_name = #{companyName,jdbcType=VARCHAR},
</if>
<!-- 用户联系方式 -->
<if test="companyMobile != null and companyMobile != ''">
AND company_mobile = #{companyMobile,jdbcType=VARCHAR}
</if>
</trim>
</where>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--@mbg.generated-->
delete from company_info
where id = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
<!--@mbg.generated-->
insert into company_info (id, company_name, company_address,
company_mobile, company_id, company_representative
)
values (#{id,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR}, #{companyAddress,jdbcType=VARCHAR},
#{companyMobile,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, #{companyRepresentative,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
<!--@mbg.generated-->
insert into company_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="companyName != null">
company_name,
</if>
<if test="companyAddress != null">
company_address,
</if>
<if test="companyMobile != null">
company_mobile,
</if>
<if test="companyId != null">
company_id,
</if>
<if test="companyRepresentative != null">
company_representative,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="companyName != null">
#{companyName,jdbcType=VARCHAR},
</if>
<if test="companyAddress != null">
#{companyAddress,jdbcType=VARCHAR},
</if>
<if test="companyMobile != null">
#{companyMobile,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
#{companyId,jdbcType=VARCHAR},
</if>
<if test="companyRepresentative != null">
#{companyRepresentative,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
<!--@mbg.generated-->
update company_info
<set>
<if test="companyName != null">
company_name = #{companyName,jdbcType=VARCHAR},
</if>
<if test="companyAddress != null">
company_address = #{companyAddress,jdbcType=VARCHAR},
</if>
<if test="companyMobile != null">
company_mobile = #{companyMobile,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
company_id = #{companyId,jdbcType=VARCHAR},
</if>
<if test="companyRepresentative != null">
company_representative = #{companyRepresentative,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
<!--@mbg.generated-->
update company_info
set company_name = #{companyName,jdbcType=VARCHAR},
company_address = #{companyAddress,jdbcType=VARCHAR},
</if>
<if test="companyMobile != null">
company_mobile = #{companyMobile,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
company_id = #{companyId,jdbcType=VARCHAR},
</if>
<if test="companyRepresentative != null">
company_representative = #{companyRepresentative,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
<!--@mbg.generated-->
update company_info
set company_name = #{companyName,jdbcType=VARCHAR},
company_address = #{companyAddress,jdbcType=VARCHAR},
company_mobile = #{companyMobile,jdbcType=VARCHAR},
company_id = #{companyId,jdbcType=VARCHAR},
company_representative = #{companyRepresentative,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
update company_info
<trim prefix="set" suffixOverrides=",">
<trim prefix="company_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyName,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="company_address = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyAddress,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="company_mobile = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyMobile,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="company_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyId,jdbcType=VARCHAR}
company_representative = #{companyRepresentative,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
update company_info
<trim prefix="set" suffixOverrides=",">
<trim prefix="company_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyName,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="company_address = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyAddress,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="company_mobile = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyMobile,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="company_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyId,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="company_representative = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyRepresentative,jdbcType=VARCHAR}
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="company_representative = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyRepresentative,jdbcType=VARCHAR}
</update>
<update id="updateBatchSelective" parameterType="java.util.List">
<!--@mbg.generated-->
update company_info
<trim prefix="set" suffixOverrides=",">
<trim prefix="company_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.companyName != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyName,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="company_address = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.companyAddress != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyAddress,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="company_mobile = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.companyMobile != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyMobile,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="company_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.companyId != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyId,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="company_representative = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.companyRepresentative != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyRepresentative,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=VARCHAR}
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=VARCHAR}
</foreach>
</update>
<update id="updateBatchSelective" parameterType="java.util.List">
<!--@mbg.generated-->
update company_info
<trim prefix="set" suffixOverrides=",">
<trim prefix="company_name = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.companyName != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyName,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="company_address = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.companyAddress != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyAddress,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="company_mobile = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.companyMobile != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyMobile,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="company_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.companyId != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyId,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="company_representative = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.companyRepresentative != null">
when id = #{item.id,jdbcType=VARCHAR} then #{item.companyRepresentative,jdbcType=VARCHAR}
</if>
</update>
<insert id="batchInsert" parameterType="map">
<!--@mbg.generated-->
insert into company_info
(id, company_name, company_address, company_mobile, company_id, company_representative
)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.companyName,jdbcType=VARCHAR}, #{item.companyAddress,jdbcType=VARCHAR},
#{item.companyMobile,jdbcType=VARCHAR}, #{item.companyId,jdbcType=VARCHAR},
#{item.companyRepresentative,jdbcType=VARCHAR}
)
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=VARCHAR}
</foreach>
</update>
<insert id="batchInsert" parameterType="map">
<!--@mbg.generated-->
insert into company_info
(id, company_name, company_address, company_mobile, company_id, company_representative
)
values
<foreach collection="list" item="item" separator=",">
(#{item.id,jdbcType=VARCHAR}, #{item.companyName,jdbcType=VARCHAR}, #{item.companyAddress,jdbcType=VARCHAR},
#{item.companyMobile,jdbcType=VARCHAR}, #{item.companyId,jdbcType=VARCHAR}, #{item.companyRepresentative,jdbcType=VARCHAR}
</insert>
<insert id="insertOrUpdate" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
<!--@mbg.generated-->
insert into company_info
(id, company_name, company_address, company_mobile, company_id, company_representative
)
values
(#{id,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR}, #{companyAddress,jdbcType=VARCHAR},
#{companyMobile,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, #{companyRepresentative,jdbcType=VARCHAR}
)
</foreach>
</insert>
<insert id="insertOrUpdate" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
<!--@mbg.generated-->
insert into company_info
(id, company_name, company_address, company_mobile, company_id, company_representative
)
values
(#{id,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR}, #{companyAddress,jdbcType=VARCHAR},
#{companyMobile,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, #{companyRepresentative,jdbcType=VARCHAR}
)
on duplicate key update
id = #{id,jdbcType=VARCHAR},
company_name = #{companyName,jdbcType=VARCHAR},
company_address = #{companyAddress,jdbcType=VARCHAR},
company_mobile = #{companyMobile,jdbcType=VARCHAR},
company_id = #{companyId,jdbcType=VARCHAR},
company_representative = #{companyRepresentative,jdbcType=VARCHAR}
</insert>
<insert id="insertOrUpdateSelective" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
<!--@mbg.generated-->
insert into company_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="companyName != null">
company_name,
</if>
<if test="companyAddress != null">
company_address,
</if>
<if test="companyMobile != null">
company_mobile,
</if>
<if test="companyId != null">
company_id,
</if>
<if test="companyRepresentative != null">
company_representative,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="companyName != null">
#{companyName,jdbcType=VARCHAR},
</if>
<if test="companyAddress != null">
#{companyAddress,jdbcType=VARCHAR},
</if>
<if test="companyMobile != null">
#{companyMobile,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
#{companyId,jdbcType=VARCHAR},
</if>
<if test="companyRepresentative != null">
#{companyRepresentative,jdbcType=VARCHAR},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
on duplicate key update
id = #{id,jdbcType=VARCHAR},
</if>
<if test="companyName != null">
company_name = #{companyName,jdbcType=VARCHAR},
</if>
<if test="companyAddress != null">
company_address = #{companyAddress,jdbcType=VARCHAR},
</if>
<if test="companyMobile != null">
company_mobile = #{companyMobile,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
company_id = #{companyId,jdbcType=VARCHAR},
</if>
<if test="companyRepresentative != null">
company_representative = #{companyRepresentative,jdbcType=VARCHAR},
</if>
</trim>
</insert>
</mapper>
\ No newline at end of file
company_representative = #{companyRepresentative,jdbcType=VARCHAR}
</insert>
<insert id="insertOrUpdateSelective" parameterType="com.sunyo.wlpt.dispatch.domain.CompanyInfo">
<!--@mbg.generated-->
insert into company_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="companyName != null">
company_name,
</if>
<if test="companyAddress != null">
company_address,
</if>
<if test="companyMobile != null">
company_mobile,
</if>
<if test="companyId != null">
company_id,
</if>
<if test="companyRepresentative != null">
company_representative,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="companyName != null">
#{companyName,jdbcType=VARCHAR},
</if>
<if test="companyAddress != null">
#{companyAddress,jdbcType=VARCHAR},
</if>
<if test="companyMobile != null">
#{companyMobile,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
#{companyId,jdbcType=VARCHAR},
</if>
<if test="companyRepresentative != null">
#{companyRepresentative,jdbcType=VARCHAR},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=VARCHAR},
</if>
<if test="companyName != null">
company_name = #{companyName,jdbcType=VARCHAR},
</if>
<if test="companyAddress != null">
company_address = #{companyAddress,jdbcType=VARCHAR},
</if>
<if test="companyMobile != null">
company_mobile = #{companyMobile,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
company_id = #{companyId,jdbcType=VARCHAR},
</if>
<if test="companyRepresentative != null">
company_representative = #{companyRepresentative,jdbcType=VARCHAR},
</if>
</trim>
</insert>
</mapper>
... ...