Commit d5999bba by zhanghj

V1.5.0--提交服务项目管理相关代码

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@24134 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 3156574d
...@@ -86,8 +86,12 @@ public enum ResultCodeEnum { ...@@ -86,8 +86,12 @@ public enum ResultCodeEnum {
* 库存相关 * 库存相关
*/ */
DEVICE_REPERTORY_NOT_EXIST(5200, "用户没有库存"), DEVICE_REPERTORY_NOT_EXIST(5200, "用户没有库存"),
DEVICE_REPERTORY_NOT_ENOUGH(5201, "用户库存不足") DEVICE_REPERTORY_NOT_ENOUGH(5201, "用户库存不足"),
/**
* 服务项目相关
*/
SERVICE_ITEM_SERVICE_CODE_EXIST(5300, "服务代码重复")
; ;
/** /**
*状态码 *状态码
......
...@@ -19,7 +19,7 @@ import org.springframework.validation.FieldError; ...@@ -19,7 +19,7 @@ import org.springframework.validation.FieldError;
* *
* @Title BaseController.java * @Title BaseController.java
* @Package com.glsx.manager.controller * @Package com.glsx.manager.controller
* @Description TODO * @Description TODO controller基类
* @author zhanghj * @author zhanghj
* @date 2019年1月3日 下午4:51:03 * @date 2019年1月3日 下午4:51:03
* @version 1.0.0 * @version 1.0.0
......
package com.glsx.ordercenter.controller;
import java.util.Date;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.validation.groups.Default;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.glsx.common.annotation.AuthCheck;
import com.glsx.common.constants.ResultObject;
import com.glsx.common.utils.UserUtils;
import com.glsx.ordercenter.constants.ResultCodeEnum;
import com.glsx.ordercenter.pojo.GroupA;
import com.glsx.ordercenter.pojo.SysServiceItem;
import com.glsx.ordercenter.service.IServiceItemService;
/**
*
* @Title ServiceItemController.java
* @Package com.glsx.ordercenter.controller
* @Description TODO 服务项目controller
* @author zhanghj
* @date 2019年9月30日 下午2:12:52
* @version 1.5.0
*/
@RestController
@RequestMapping(value="/serviceItme")
public class ServiceItemController extends BaseController{
private Logger log = LoggerFactory.getLogger(ServiceItemController.class);
@Autowired
private IServiceItemService serviceItemservice;
@AuthCheck
@RequestMapping(value="/add", method=RequestMethod.POST)
public ResultObject add(HttpServletRequest request, @Validated(value=Default.class)SysServiceItem serviceItem, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
Map<String, String> errorMap = getErrors(bindingResult);
return new ResultObject(ResultCodeEnum.PARAM_ERROR.getCode(), ResultCodeEnum.PARAM_ERROR.getMsg(), errorMap);
}
String serviceCode = serviceItem.getServiceCode();
SysServiceItem item = new SysServiceItem();
item.setServiceCode(serviceCode);
SysServiceItem sysServiceItem = serviceItemservice.getServiceItem(item);
if (sysServiceItem != null) {
return new ResultObject(ResultCodeEnum.SERVICE_ITEM_SERVICE_CODE_EXIST.getCode(), ResultCodeEnum.SERVICE_ITEM_SERVICE_CODE_EXIST.getMsg());
}
Integer userId = UserUtils.getUserId(request);
serviceItem.setCreateBy(userId);
serviceItem.setCreateTime(new Date());
serviceItemservice.add(serviceItem);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg());
}
@AuthCheck
@RequestMapping(value="/update", method=RequestMethod.POST)
public ResultObject update(HttpServletRequest request, @Validated(value=GroupA.class)SysServiceItem serviceItem, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
Map<String, String> errorMap = getErrors(bindingResult);
return new ResultObject(ResultCodeEnum.PARAM_ERROR.getCode(), ResultCodeEnum.PARAM_ERROR.getMsg(), errorMap);
}
String serviceCode = serviceItem.getServiceCode();
Integer id = serviceItem.getId();
SysServiceItem item = new SysServiceItem();
item.setServiceCode(serviceCode);
SysServiceItem sysServiceItem = serviceItemservice.getServiceItem(item);
if (sysServiceItem != null && ! id.equals(sysServiceItem.getId())) {
return new ResultObject(ResultCodeEnum.SERVICE_ITEM_SERVICE_CODE_EXIST.getCode(), ResultCodeEnum.SERVICE_ITEM_SERVICE_CODE_EXIST.getMsg());
}
Integer userId = UserUtils.getUserId(request);
serviceItem.setUpdateBy(userId);
serviceItem.setUpdateTime(new Date());
int num = serviceItemservice.update(serviceItem);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg());
}
@AuthCheck
@RequestMapping(value="/delete", method=RequestMethod.POST)
public ResultObject add(HttpServletRequest request, Integer id) {
if (id == null) {
return new ResultObject(ResultCodeEnum.PARAM_ERROR.getCode(), ResultCodeEnum.PARAM_ERROR.getMsg());
}
int num = serviceItemservice.delete(id);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg());
}
}
package com.glsx.ordercenter.mapper;
import com.glsx.ordercenter.pojo.SysServiceItemDeviceConfig;
public interface SysServiceItemDeviceConfigMapper {
int deleteByPrimaryKey(Integer id);
int insert(SysServiceItemDeviceConfig record);
int insertSelective(SysServiceItemDeviceConfig record);
SysServiceItemDeviceConfig selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(SysServiceItemDeviceConfig record);
int updateByPrimaryKey(SysServiceItemDeviceConfig record);
/**
*
* @author zhanghj
* @Title: deleteDeviceConfig
* @Description: TODO 删除服务项目设备配置
* @param deviceConfig
* @return
* int
*
*/
int deleteDeviceConfig(SysServiceItemDeviceConfig deviceConfig);
}
\ No newline at end of file \ No newline at end of file
package com.glsx.ordercenter.mapper;
import com.glsx.ordercenter.pojo.SysServiceItem;
/**
*
* @Title SysServiceItemMapper.java
* @Package com.glsx.ordercenter.mapper
* @Description TODO 服务项目mapper
* @author zhanghj
* @date 2019年9月27日 下午5:32:43
* @version 1.0.0
*/
public interface SysServiceItemMapper {
int deleteByPrimaryKey(Integer id);
int insert(SysServiceItem record);
int insertSelective(SysServiceItem record);
SysServiceItem selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(SysServiceItem record);
int updateByPrimaryKey(SysServiceItem record);
SysServiceItem getServiceItem(SysServiceItem item);
}
\ No newline at end of file \ No newline at end of file
package com.glsx.ordercenter.mapper;
import com.glsx.ordercenter.pojo.SysServiceItemPhotoConfig;
public interface SysServiceItemPhotoConfigMapper {
int deleteByPrimaryKey(Integer id);
int insert(SysServiceItemPhotoConfig record);
int insertSelective(SysServiceItemPhotoConfig record);
SysServiceItemPhotoConfig selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(SysServiceItemPhotoConfig record);
int updateByPrimaryKey(SysServiceItemPhotoConfig record);
/**
*
* @author zhanghj
* @Title: PhotoConfig
* @Description: TODO 删除服务项目的照片配置
* @param photoConfig
* @return
* int
*
*/
int deletePhotoConfig(SysServiceItemPhotoConfig photoConfig);
}
\ No newline at end of file \ No newline at end of file
package com.glsx.ordercenter.pojo;
import java.util.List;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.groups.Default;
public class SysServiceItem extends BaseModel{
@NotNull(message="{param.not.null}", groups={GroupA.class})
private Integer id;
/**
* 服务名称
*/
@NotBlank(message="{param.not.null}", groups={Default.class, GroupA.class})
private String serviceName;
private String serviceCode;
private String imgPath;
/**
* 设备配置列表
*/
private List<SysServiceItemDeviceConfig> deviceConfigList;
/**
* 照片配置列表
*/
private List<SysServiceItemPhotoConfig> photoConfigList;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getServiceName() {
return serviceName;
}
public void setServiceName(String serviceName) {
this.serviceName = serviceName == null ? null : serviceName.trim();
}
public String getServiceCode() {
return serviceCode;
}
public void setServiceCode(String serviceCode) {
this.serviceCode = serviceCode == null ? null : serviceCode.trim();
}
public String getImgPath() {
return imgPath;
}
public void setImgPath(String imgPath) {
this.imgPath = imgPath == null ? null : imgPath.trim();
}
public List<SysServiceItemDeviceConfig> getDeviceConfigList() {
return deviceConfigList;
}
public void setDeviceConfigList(
List<SysServiceItemDeviceConfig> deviceConfigList) {
this.deviceConfigList = deviceConfigList;
}
public List<SysServiceItemPhotoConfig> getPhotoConfigList() {
return photoConfigList;
}
public void setPhotoConfigList(List<SysServiceItemPhotoConfig> photoConfigList) {
this.photoConfigList = photoConfigList;
}
}
\ No newline at end of file \ No newline at end of file
package com.glsx.ordercenter.pojo;
import java.util.Date;
public class SysServiceItemDeviceConfig {
private Integer id;
private Integer serviceItemId;
private String deviceType;
private Boolean isVerifyStock;
private Boolean isInstallLocation;
private String deviceVerifyUri;
private String syncUri;
private Byte sort;
private String remark;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getServiceItemId() {
return serviceItemId;
}
public void setServiceItemId(Integer serviceItemId) {
this.serviceItemId = serviceItemId;
}
public String getDeviceType() {
return deviceType;
}
public void setDeviceType(String deviceType) {
this.deviceType = deviceType == null ? null : deviceType.trim();
}
public Boolean getIsVerifyStock() {
return isVerifyStock;
}
public void setIsVerifyStock(Boolean isVerifyStock) {
this.isVerifyStock = isVerifyStock;
}
public Boolean getIsInstallLocation() {
return isInstallLocation;
}
public void setIsInstallLocation(Boolean isInstallLocation) {
this.isInstallLocation = isInstallLocation;
}
public String getDeviceVerifyUri() {
return deviceVerifyUri;
}
public void setDeviceVerifyUri(String deviceVerifyUri) {
this.deviceVerifyUri = deviceVerifyUri == null ? null : deviceVerifyUri.trim();
}
public String getSyncUri() {
return syncUri;
}
public void setSyncUri(String syncUri) {
this.syncUri = syncUri == null ? null : syncUri.trim();
}
public Byte getSort() {
return sort;
}
public void setSort(Byte sort) {
this.sort = sort;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
}
\ No newline at end of file \ No newline at end of file
package com.glsx.ordercenter.pojo;
public class SysServiceItemPhotoConfig {
private Integer id;
private Integer serviceItemId;
private String iconPath;
private Boolean isRequired;
private String photoName;
private String photoDesc;
private Integer sort;
private String remark;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getServiceItemId() {
return serviceItemId;
}
public void setServiceItemId(Integer serviceItemId) {
this.serviceItemId = serviceItemId;
}
public String getIconPath() {
return iconPath;
}
public void setIconPath(String iconPath) {
this.iconPath = iconPath == null ? null : iconPath.trim();
}
public Boolean getIsRequired() {
return isRequired;
}
public void setIsRequired(Boolean isRequired) {
this.isRequired = isRequired;
}
public String getPhotoName() {
return photoName;
}
public void setPhotoName(String photoName) {
this.photoName = photoName == null ? null : photoName.trim();
}
public String getPhotoDesc() {
return photoDesc;
}
public void setPhotoDesc(String photoDesc) {
this.photoDesc = photoDesc == null ? null : photoDesc.trim();
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
}
\ No newline at end of file \ No newline at end of file
package com.glsx.ordercenter.service;
import com.glsx.ordercenter.pojo.SysServiceItem;
/**
*
* @Title IServiceItem.java
* @Package com.glsx.ordercenter.service
* @Description TODO 服务项目service
* @author zhanghj
* @date 2019年10月8日 下午2:37:14
* @version 1.0.0
*/
public interface IServiceItemService {
/**
*
* @author zhanghj
* @Title: add
* @Description: TODO 增加服务项目
* @param serviceItem
* @return
* int
*
*/
int add(SysServiceItem serviceItem);
/**
*
* @author zhanghj
* @Title: getServiceItem
* @Description: TODO 获取服务项目
* @param item
* @return
* SysServiceItem
*
*/
SysServiceItem getServiceItem(SysServiceItem item);
/**
*
* @author zhanghj
* @Title: update
* @Description: TODO 更新某个服务项目
* @param serviceItem
* @return
* int
*
*/
int update(SysServiceItem serviceItem);
/**
*
* @author zhanghj
* @Title: delete
* @Description: TODO 删除服务项目
* @param id
* @return
* int
*
*/
int delete(Integer id);
}
package com.glsx.ordercenter.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import com.glsx.ordercenter.mapper.SysServiceItemDeviceConfigMapper;
import com.glsx.ordercenter.mapper.SysServiceItemMapper;
import com.glsx.ordercenter.mapper.SysServiceItemPhotoConfigMapper;
import com.glsx.ordercenter.pojo.SysServiceItem;
import com.glsx.ordercenter.pojo.SysServiceItemDeviceConfig;
import com.glsx.ordercenter.pojo.SysServiceItemPhotoConfig;
import com.glsx.ordercenter.service.IServiceItemService;
/**
*
* @Title ServiceItemImpl.java
* @Package com.glsx.ordercenter.service.impl
* @Description TODO
* @author zhanghj
* @date 2019年10月8日 下午2:38:01
* @version 1.0.0
*/
@Component
public class ServiceItemImpl implements IServiceItemService {
@Autowired
private SysServiceItemMapper serviceItemDao;
@Autowired
private SysServiceItemDeviceConfigMapper serviceItemDeviceConfigDao;
@Autowired
private SysServiceItemPhotoConfigMapper serviceItemPhotoConfigDao;
@Override
@Transactional(rollbackFor=Exception.class)
public int add(SysServiceItem serviceItem) {
// TODO Auto-generated method stub
int num = serviceItemDao.insertSelective(serviceItem);
Integer serviceItemId = serviceItem.getId();
List<SysServiceItemDeviceConfig> deviceConfigList = serviceItem.getDeviceConfigList();
if (deviceConfigList != null && deviceConfigList.size() >0) {
for (SysServiceItemDeviceConfig ServiceItemDeviceConfig : deviceConfigList) {
ServiceItemDeviceConfig.setServiceItemId(serviceItemId);
serviceItemDeviceConfigDao.insertSelective(ServiceItemDeviceConfig);
}
}
List<SysServiceItemPhotoConfig> photoConfigList = serviceItem.getPhotoConfigList();
if (photoConfigList != null && photoConfigList.size() >0) {
for (SysServiceItemPhotoConfig serviceItemPhotoConfig : photoConfigList) {
serviceItemPhotoConfig.setServiceItemId(serviceItemId);
serviceItemPhotoConfigDao.insertSelective(serviceItemPhotoConfig);
}
}
return num;
}
@Override
public SysServiceItem getServiceItem(SysServiceItem item) {
// TODO Auto-generated method stub
return serviceItemDao.getServiceItem(item);
}
@Override
@Transactional(rollbackFor=Exception.class)
public int update(SysServiceItem serviceItem) {
// TODO Auto-generated method stub
int num = serviceItemDao.updateByPrimaryKeySelective(serviceItem);
Integer serviceItemId = serviceItem.getId();
SysServiceItemDeviceConfig deviceConfig = new SysServiceItemDeviceConfig();
deviceConfig.setServiceItemId(serviceItemId);
serviceItemDeviceConfigDao.deleteDeviceConfig(deviceConfig);
List<SysServiceItemDeviceConfig> deviceConfigList = serviceItem.getDeviceConfigList();
if (deviceConfigList != null && deviceConfigList.size() >0) {
for (SysServiceItemDeviceConfig ServiceItemDeviceConfig : deviceConfigList) {
ServiceItemDeviceConfig.setServiceItemId(serviceItemId);
serviceItemDeviceConfigDao.insertSelective(ServiceItemDeviceConfig);
}
}
SysServiceItemPhotoConfig photoConfig = new SysServiceItemPhotoConfig();
photoConfig.setServiceItemId(serviceItemId);
serviceItemPhotoConfigDao.deletePhotoConfig(photoConfig);
List<SysServiceItemPhotoConfig> photoConfigList = serviceItem.getPhotoConfigList();
if (photoConfigList != null && photoConfigList.size() >0) {
for (SysServiceItemPhotoConfig serviceItemPhotoConfig : photoConfigList) {
serviceItemPhotoConfig.setServiceItemId(serviceItemId);
serviceItemPhotoConfigDao.insertSelective(serviceItemPhotoConfig);
}
}
return num;
}
@Override
@Transactional(rollbackFor=Exception.class)
public int delete(Integer id) {
// TODO Auto-generated method stub
int num = serviceItemDao.deleteByPrimaryKey(id);
SysServiceItemDeviceConfig deviceConfig = new SysServiceItemDeviceConfig();
deviceConfig.setServiceItemId(id);
serviceItemDeviceConfigDao.deleteDeviceConfig(deviceConfig);
SysServiceItemPhotoConfig photoConfig = new SysServiceItemPhotoConfig();
photoConfig.setServiceItemId(id);
serviceItemPhotoConfigDao.deletePhotoConfig(photoConfig);
return num;
}
}
...@@ -5,13 +5,13 @@ server.port=8094 ...@@ -5,13 +5,13 @@ server.port=8094
#configClient #configClient
spring.cloud.config.name=${spring.application.name} spring.cloud.config.name=${spring.application.name}
spring.cloud.config.profile=test spring.cloud.config.profile=local
spring.cloud.config.label=master spring.cloud.config.label=master
spring.cloud.config.uri=http://configserver.glsx.com/ spring.cloud.config.uri=http://localhost:8765/
##\u65e5\u5fd7 test ##\u65e5\u5fd7 test
logging.level.com.glsx.ordercenter=DEBUG logging.level.com.glsx.ordercenter=INFO
logging.path=/data/java_log/jetty/carService/car-service-ordercenter logging.path=/data/java_log/jetty/carService/car-service-ordercenter
logging.config=classpath:logback.xml logging.config=classpath:logback.xml
<?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.glsx.ordercenter.mapper.SysServiceItemDeviceConfigMapper">
<resultMap id="BaseResultMap" type="com.glsx.ordercenter.pojo.SysServiceItemDeviceConfig">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="service_item_id" jdbcType="INTEGER" property="serviceItemId" />
<result column="device_type" jdbcType="VARCHAR" property="deviceType" />
<result column="is_verify_stock" jdbcType="BIT" property="isVerifyStock" />
<result column="is_install_location" jdbcType="BIT" property="isInstallLocation" />
<result column="device_verify_uri" jdbcType="VARCHAR" property="deviceVerifyUri" />
<result column="sync_uri" jdbcType="VARCHAR" property="syncUri" />
<result column="sort" jdbcType="TINYINT" property="sort" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
</resultMap>
<sql id="Base_Column_List">
id, service_item_id, device_type, is_verify_stock, is_install_location, device_verify_uri,
sync_uri, sort, remark
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_service_item_device_config
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from sys_service_item_device_config
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteDeviceConfig" parameterType="com.glsx.ordercenter.pojo.SysServiceItemDeviceConfig">
delete from sys_service_item_device_config
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="serviceItemId != null">
and service_item_id = #{serviceItemId}
</if>
</where>
</delete>
<insert id="insert" parameterType="com.glsx.ordercenter.pojo.SysServiceItemDeviceConfig">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_service_item_device_config (service_item_id, device_type, is_verify_stock,
is_install_location, device_verify_uri, sync_uri,
sort, remark)
values (#{serviceItemId,jdbcType=INTEGER}, #{deviceType,jdbcType=VARCHAR}, #{isVerifyStock,jdbcType=BIT},
#{isInstallLocation,jdbcType=BIT}, #{deviceVerifyUri,jdbcType=VARCHAR}, #{syncUri,jdbcType=VARCHAR},
#{sort,jdbcType=TINYINT}, #{remark,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.glsx.ordercenter.pojo.SysServiceItemDeviceConfig">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_service_item_device_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="serviceItemId != null">
service_item_id,
</if>
<if test="deviceType != null">
device_type,
</if>
<if test="isVerifyStock != null">
is_verify_stock,
</if>
<if test="isInstallLocation != null">
is_install_location,
</if>
<if test="deviceVerifyUri != null">
device_verify_uri,
</if>
<if test="syncUri != null">
sync_uri,
</if>
<if test="sort != null">
sort,
</if>
<if test="remark != null">
remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="serviceItemId != null">
#{serviceItemId,jdbcType=INTEGER},
</if>
<if test="deviceType != null">
#{deviceType,jdbcType=VARCHAR},
</if>
<if test="isVerifyStock != null">
#{isVerifyStock,jdbcType=BIT},
</if>
<if test="isInstallLocation != null">
#{isInstallLocation,jdbcType=BIT},
</if>
<if test="deviceVerifyUri != null">
#{deviceVerifyUri,jdbcType=VARCHAR},
</if>
<if test="syncUri != null">
#{syncUri,jdbcType=VARCHAR},
</if>
<if test="sort != null">
#{sort,jdbcType=TINYINT},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.ordercenter.pojo.SysServiceItemDeviceConfig">
update sys_service_item_device_config
<set>
<if test="serviceItemId != null">
service_item_id = #{serviceItemId,jdbcType=INTEGER},
</if>
<if test="deviceType != null">
device_type = #{deviceType,jdbcType=VARCHAR},
</if>
<if test="isVerifyStock != null">
is_verify_stock = #{isVerifyStock,jdbcType=BIT},
</if>
<if test="isInstallLocation != null">
is_install_location = #{isInstallLocation,jdbcType=BIT},
</if>
<if test="deviceVerifyUri != null">
device_verify_uri = #{deviceVerifyUri,jdbcType=VARCHAR},
</if>
<if test="syncUri != null">
sync_uri = #{syncUri,jdbcType=VARCHAR},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=TINYINT},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.ordercenter.pojo.SysServiceItemDeviceConfig">
update sys_service_item_device_config
set service_item_id = #{serviceItemId,jdbcType=INTEGER},
device_type = #{deviceType,jdbcType=VARCHAR},
is_verify_stock = #{isVerifyStock,jdbcType=BIT},
is_install_location = #{isInstallLocation,jdbcType=BIT},
device_verify_uri = #{deviceVerifyUri,jdbcType=VARCHAR},
sync_uri = #{syncUri,jdbcType=VARCHAR},
sort = #{sort,jdbcType=TINYINT},
remark = #{remark,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file \ No newline at end of file
<?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.glsx.ordercenter.mapper.SysServiceItemMapper">
<resultMap id="BaseResultMap" type="com.glsx.ordercenter.pojo.SysServiceItem">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="service_name" jdbcType="VARCHAR" property="serviceName" />
<result column="service_code" jdbcType="VARCHAR" property="serviceCode" />
<result column="img_path" jdbcType="VARCHAR" property="imgPath" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_by" jdbcType="INTEGER" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="INTEGER" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
id, service_name, service_code, img_path, remark, create_by, create_time, update_by,
update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_service_item
where id = #{id,jdbcType=INTEGER}
</select>
<select id="getServiceItem" parameterType="com.glsx.ordercenter.pojo.SysServiceItem" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_service_item
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="serviceCode != null">
and service_code = #{serviceCode}
</if>
</where>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from sys_service_item
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.glsx.ordercenter.pojo.SysServiceItem">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_service_item (service_name, service_code, img_path,
remark, create_by, create_time,
update_by, update_time)
values (#{serviceName,jdbcType=VARCHAR}, #{serviceCode,jdbcType=VARCHAR}, #{imgPath,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR}, #{createBy,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateBy,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.glsx.ordercenter.pojo.SysServiceItem">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_service_item
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="serviceName != null">
service_name,
</if>
<if test="serviceCode != null">
service_code,
</if>
<if test="imgPath != null">
img_path,
</if>
<if test="remark != null">
remark,
</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="serviceName != null">
#{serviceName,jdbcType=VARCHAR},
</if>
<if test="serviceCode != null">
#{serviceCode,jdbcType=VARCHAR},
</if>
<if test="imgPath != null">
#{imgPath,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.ordercenter.pojo.SysServiceItem">
update sys_service_item
<set>
<if test="serviceName != null">
service_name = #{serviceName,jdbcType=VARCHAR},
</if>
<if test="serviceCode != null">
service_code = #{serviceCode,jdbcType=VARCHAR},
</if>
<if test="imgPath != null">
img_path = #{imgPath,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.ordercenter.pojo.SysServiceItem">
update sys_service_item
set service_name = #{serviceName,jdbcType=VARCHAR},
service_code = #{serviceCode,jdbcType=VARCHAR},
img_path = #{imgPath,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=INTEGER},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file \ No newline at end of file
<?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.glsx.ordercenter.mapper.SysServiceItemPhotoConfigMapper">
<resultMap id="BaseResultMap" type="com.glsx.ordercenter.pojo.SysServiceItemPhotoConfig">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="service_item_id" jdbcType="INTEGER" property="serviceItemId" />
<result column="icon_path" jdbcType="VARCHAR" property="iconPath" />
<result column="is_required" jdbcType="BIT" property="isRequired" />
<result column="photo_name" jdbcType="VARCHAR" property="photoName" />
<result column="photo_desc" jdbcType="VARCHAR" property="photoDesc" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
</resultMap>
<sql id="Base_Column_List">
id, service_item_id, icon_path, is_required, photo_name, photo_desc, sort, remark
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_service_item_photo_config
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from sys_service_item_photo_config
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deletePhotoConfig" parameterType="com.glsx.ordercenter.pojo.SysServiceItemPhotoConfig">
delete from sys_service_item_photo_config
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="serviceItemId != null">
and service_item_id = #{serviceItemId}
</if>
</where>
</delete>
<insert id="insert" parameterType="com.glsx.ordercenter.pojo.SysServiceItemPhotoConfig">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_service_item_photo_config (service_item_id, icon_path, is_required,
photo_name, photo_desc, sort,
remark)
values (#{serviceItemId,jdbcType=INTEGER}, #{iconPath,jdbcType=VARCHAR}, #{isRequired,jdbcType=BIT},
#{photoName,jdbcType=VARCHAR}, #{photoDesc,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER},
#{remark,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.glsx.ordercenter.pojo.SysServiceItemPhotoConfig">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_service_item_photo_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="serviceItemId != null">
service_item_id,
</if>
<if test="iconPath != null">
icon_path,
</if>
<if test="isRequired != null">
is_required,
</if>
<if test="photoName != null">
photo_name,
</if>
<if test="photoDesc != null">
photo_desc,
</if>
<if test="sort != null">
sort,
</if>
<if test="remark != null">
remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="serviceItemId != null">
#{serviceItemId,jdbcType=INTEGER},
</if>
<if test="iconPath != null">
#{iconPath,jdbcType=VARCHAR},
</if>
<if test="isRequired != null">
#{isRequired,jdbcType=BIT},
</if>
<if test="photoName != null">
#{photoName,jdbcType=VARCHAR},
</if>
<if test="photoDesc != null">
#{photoDesc,jdbcType=VARCHAR},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.ordercenter.pojo.SysServiceItemPhotoConfig">
update sys_service_item_photo_config
<set>
<if test="serviceItemId != null">
service_item_id = #{serviceItemId,jdbcType=INTEGER},
</if>
<if test="iconPath != null">
icon_path = #{iconPath,jdbcType=VARCHAR},
</if>
<if test="isRequired != null">
is_required = #{isRequired,jdbcType=BIT},
</if>
<if test="photoName != null">
photo_name = #{photoName,jdbcType=VARCHAR},
</if>
<if test="photoDesc != null">
photo_desc = #{photoDesc,jdbcType=VARCHAR},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.ordercenter.pojo.SysServiceItemPhotoConfig">
update sys_service_item_photo_config
set service_item_id = #{serviceItemId,jdbcType=INTEGER},
icon_path = #{iconPath,jdbcType=VARCHAR},
is_required = #{isRequired,jdbcType=BIT},
photo_name = #{photoName,jdbcType=VARCHAR},
photo_desc = #{photoDesc,jdbcType=VARCHAR},
sort = #{sort,jdbcType=INTEGER},
remark = #{remark,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!