车间设置
This commit is contained in:
parent
9dddf75109
commit
d126e5c96b
@ -0,0 +1,118 @@
|
||||
package com.ktg.mes.md.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.mes.md.domain.MdWorkshop;
|
||||
import com.ktg.mes.md.service.IMdWorkshopService;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 车间Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-07
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/md/workshop")
|
||||
public class MdWorkshopController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IMdWorkshopService mdWorkshopService;
|
||||
|
||||
/**
|
||||
* 查询车间列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('md:workshop:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MdWorkshop mdWorkshop)
|
||||
{
|
||||
startPage();
|
||||
List<MdWorkshop> list = mdWorkshopService.selectMdWorkshopList(mdWorkshop);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出车间列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('md:workshop:export')")
|
||||
@Log(title = "车间", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MdWorkshop mdWorkshop)
|
||||
{
|
||||
List<MdWorkshop> list = mdWorkshopService.selectMdWorkshopList(mdWorkshop);
|
||||
ExcelUtil<MdWorkshop> util = new ExcelUtil<MdWorkshop>(MdWorkshop.class);
|
||||
util.exportExcel(response, list, "车间数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取车间详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('md:workshop:query')")
|
||||
@GetMapping(value = "/{workshopId}")
|
||||
public AjaxResult getInfo(@PathVariable("workshopId") Long workshopId)
|
||||
{
|
||||
return AjaxResult.success(mdWorkshopService.selectMdWorkshopByWorkshopId(workshopId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增车间
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('md:workshop:add')")
|
||||
@Log(title = "车间", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MdWorkshop mdWorkshop)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(mdWorkshopService.checkWorkshopCodeUnique(mdWorkshop))){
|
||||
return AjaxResult.error("车间编码已存在!");
|
||||
}
|
||||
if(UserConstants.NOT_UNIQUE.equals(mdWorkshopService.checkWorkshopNameUnique(mdWorkshop))){
|
||||
return AjaxResult.error("车间名称已存在!");
|
||||
}
|
||||
return toAjax(mdWorkshopService.insertMdWorkshop(mdWorkshop));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改车间
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('md:workshop:edit')")
|
||||
@Log(title = "车间", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MdWorkshop mdWorkshop)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(mdWorkshopService.checkWorkshopCodeUnique(mdWorkshop))){
|
||||
return AjaxResult.error("车间编码已存在!");
|
||||
}
|
||||
if(UserConstants.NOT_UNIQUE.equals(mdWorkshopService.checkWorkshopNameUnique(mdWorkshop))){
|
||||
return AjaxResult.error("车间名称已存在!");
|
||||
}
|
||||
return toAjax(mdWorkshopService.updateMdWorkshop(mdWorkshop));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除车间
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('md:workshop:remove')")
|
||||
@Log(title = "车间", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{workshopIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] workshopIds)
|
||||
{
|
||||
return toAjax(mdWorkshopService.deleteMdWorkshopByWorkshopIds(workshopIds));
|
||||
}
|
||||
}
|
165
ktg-mes/src/main/java/com/ktg/mes/md/domain/MdWorkshop.java
Normal file
165
ktg-mes/src/main/java/com/ktg/mes/md/domain/MdWorkshop.java
Normal file
@ -0,0 +1,165 @@
|
||||
package com.ktg.mes.md.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 车间对象 md_workshop
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-07
|
||||
*/
|
||||
public class MdWorkshop extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 车间ID */
|
||||
private Long workshopId;
|
||||
|
||||
/** 车间编码 */
|
||||
@Excel(name = "车间编码")
|
||||
private String workshopCode;
|
||||
|
||||
/** 车间名称 */
|
||||
@Excel(name = "车间名称")
|
||||
private String workshopName;
|
||||
|
||||
/** 面积 */
|
||||
@Excel(name = "面积")
|
||||
private BigDecimal area;
|
||||
|
||||
/** 负责人 */
|
||||
@Excel(name = "负责人")
|
||||
private String charge;
|
||||
|
||||
/** 是否启用 */
|
||||
@Excel(name = "是否启用")
|
||||
private String enableFlag;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setWorkshopId(Long workshopId)
|
||||
{
|
||||
this.workshopId = workshopId;
|
||||
}
|
||||
|
||||
public Long getWorkshopId()
|
||||
{
|
||||
return workshopId;
|
||||
}
|
||||
public void setWorkshopCode(String workshopCode)
|
||||
{
|
||||
this.workshopCode = workshopCode;
|
||||
}
|
||||
|
||||
public String getWorkshopCode()
|
||||
{
|
||||
return workshopCode;
|
||||
}
|
||||
public void setWorkshopName(String workshopName)
|
||||
{
|
||||
this.workshopName = workshopName;
|
||||
}
|
||||
|
||||
public String getWorkshopName()
|
||||
{
|
||||
return workshopName;
|
||||
}
|
||||
public void setArea(BigDecimal area)
|
||||
{
|
||||
this.area = area;
|
||||
}
|
||||
|
||||
public BigDecimal getArea()
|
||||
{
|
||||
return area;
|
||||
}
|
||||
public void setCharge(String charge)
|
||||
{
|
||||
this.charge = charge;
|
||||
}
|
||||
|
||||
public String getCharge()
|
||||
{
|
||||
return charge;
|
||||
}
|
||||
public void setEnableFlag(String enableFlag)
|
||||
{
|
||||
this.enableFlag = enableFlag;
|
||||
}
|
||||
|
||||
public String getEnableFlag()
|
||||
{
|
||||
return enableFlag;
|
||||
}
|
||||
public void setAttr1(String attr1)
|
||||
{
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr1()
|
||||
{
|
||||
return attr1;
|
||||
}
|
||||
public void setAttr2(String attr2)
|
||||
{
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getAttr2()
|
||||
{
|
||||
return attr2;
|
||||
}
|
||||
public void setAttr3(Long attr3)
|
||||
{
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public Long getAttr3()
|
||||
{
|
||||
return attr3;
|
||||
}
|
||||
public void setAttr4(Long attr4)
|
||||
{
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public Long getAttr4()
|
||||
{
|
||||
return attr4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("workshopId", getWorkshopId())
|
||||
.append("workshopCode", getWorkshopCode())
|
||||
.append("workshopName", getWorkshopName())
|
||||
.append("area", getArea())
|
||||
.append("charge", getCharge())
|
||||
.append("enableFlag", getEnableFlag())
|
||||
.append("remark", getRemark())
|
||||
.append("attr1", getAttr1())
|
||||
.append("attr2", getAttr2())
|
||||
.append("attr3", getAttr3())
|
||||
.append("attr4", getAttr4())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
package com.ktg.mes.md.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.md.domain.MdWorkshop;
|
||||
|
||||
/**
|
||||
* 车间Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-07
|
||||
*/
|
||||
public interface MdWorkshopMapper
|
||||
{
|
||||
/**
|
||||
* 查询车间
|
||||
*
|
||||
* @param workshopId 车间主键
|
||||
* @return 车间
|
||||
*/
|
||||
public MdWorkshop selectMdWorkshopByWorkshopId(Long workshopId);
|
||||
|
||||
/**
|
||||
* 查询车间列表
|
||||
*
|
||||
* @param mdWorkshop 车间
|
||||
* @return 车间集合
|
||||
*/
|
||||
public List<MdWorkshop> selectMdWorkshopList(MdWorkshop mdWorkshop);
|
||||
|
||||
/**
|
||||
* 检查车间编码是否唯一
|
||||
* @param mdWorkshop
|
||||
* @return
|
||||
*/
|
||||
public MdWorkshop checkWorkshopCodeUnique(MdWorkshop mdWorkshop);
|
||||
|
||||
/**
|
||||
* 检查车间名称是否唯一
|
||||
* @param mdWorkshop
|
||||
* @return
|
||||
*/
|
||||
public MdWorkshop checkWorkshopNameUnique(MdWorkshop mdWorkshop);
|
||||
|
||||
/**
|
||||
* 新增车间
|
||||
*
|
||||
* @param mdWorkshop 车间
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMdWorkshop(MdWorkshop mdWorkshop);
|
||||
|
||||
/**
|
||||
* 修改车间
|
||||
*
|
||||
* @param mdWorkshop 车间
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMdWorkshop(MdWorkshop mdWorkshop);
|
||||
|
||||
/**
|
||||
* 删除车间
|
||||
*
|
||||
* @param workshopId 车间主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMdWorkshopByWorkshopId(Long workshopId);
|
||||
|
||||
/**
|
||||
* 批量删除车间
|
||||
*
|
||||
* @param workshopIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMdWorkshopByWorkshopIds(Long[] workshopIds);
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.ktg.mes.md.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.md.domain.MdWorkshop;
|
||||
|
||||
/**
|
||||
* 车间Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-07
|
||||
*/
|
||||
public interface IMdWorkshopService
|
||||
{
|
||||
/**
|
||||
* 查询车间
|
||||
*
|
||||
* @param workshopId 车间主键
|
||||
* @return 车间
|
||||
*/
|
||||
public MdWorkshop selectMdWorkshopByWorkshopId(Long workshopId);
|
||||
|
||||
/**
|
||||
* 查询车间列表
|
||||
*
|
||||
* @param mdWorkshop 车间
|
||||
* @return 车间集合
|
||||
*/
|
||||
public List<MdWorkshop> selectMdWorkshopList(MdWorkshop mdWorkshop);
|
||||
|
||||
public String checkWorkshopCodeUnique(MdWorkshop mdWorkshop);
|
||||
|
||||
public String checkWorkshopNameUnique(MdWorkshop mdWorkshop);
|
||||
|
||||
/**
|
||||
* 新增车间
|
||||
*
|
||||
* @param mdWorkshop 车间
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMdWorkshop(MdWorkshop mdWorkshop);
|
||||
|
||||
/**
|
||||
* 修改车间
|
||||
*
|
||||
* @param mdWorkshop 车间
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMdWorkshop(MdWorkshop mdWorkshop);
|
||||
|
||||
/**
|
||||
* 批量删除车间
|
||||
*
|
||||
* @param workshopIds 需要删除的车间主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMdWorkshopByWorkshopIds(Long[] workshopIds);
|
||||
|
||||
/**
|
||||
* 删除车间信息
|
||||
*
|
||||
* @param workshopId 车间主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMdWorkshopByWorkshopId(Long workshopId);
|
||||
}
|
@ -0,0 +1,120 @@
|
||||
package com.ktg.mes.md.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import com.ktg.common.utils.StringUtils;
|
||||
import org.apache.catalina.User;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.md.mapper.MdWorkshopMapper;
|
||||
import com.ktg.mes.md.domain.MdWorkshop;
|
||||
import com.ktg.mes.md.service.IMdWorkshopService;
|
||||
|
||||
/**
|
||||
* 车间Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-07
|
||||
*/
|
||||
@Service
|
||||
public class MdWorkshopServiceImpl implements IMdWorkshopService
|
||||
{
|
||||
@Autowired
|
||||
private MdWorkshopMapper mdWorkshopMapper;
|
||||
|
||||
/**
|
||||
* 查询车间
|
||||
*
|
||||
* @param workshopId 车间主键
|
||||
* @return 车间
|
||||
*/
|
||||
@Override
|
||||
public MdWorkshop selectMdWorkshopByWorkshopId(Long workshopId)
|
||||
{
|
||||
return mdWorkshopMapper.selectMdWorkshopByWorkshopId(workshopId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询车间列表
|
||||
*
|
||||
* @param mdWorkshop 车间
|
||||
* @return 车间
|
||||
*/
|
||||
@Override
|
||||
public List<MdWorkshop> selectMdWorkshopList(MdWorkshop mdWorkshop)
|
||||
{
|
||||
return mdWorkshopMapper.selectMdWorkshopList(mdWorkshop);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkWorkshopCodeUnique(MdWorkshop mdWorkshop) {
|
||||
MdWorkshop workshop = mdWorkshopMapper.checkWorkshopCodeUnique(mdWorkshop);
|
||||
Long workshopId = mdWorkshop.getWorkshopId()==null?-1L:mdWorkshop.getWorkshopId();
|
||||
if(StringUtils.isNotNull(workshop) && workshop.getWorkshopId().longValue() != workshopId.longValue()){
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkWorkshopNameUnique(MdWorkshop mdWorkshop) {
|
||||
MdWorkshop workshop = mdWorkshopMapper.checkWorkshopNameUnique(mdWorkshop);
|
||||
Long workshopId = mdWorkshop.getWorkshopId()==null?-1L:mdWorkshop.getWorkshopId();
|
||||
if(StringUtils.isNotNull(workshop) && workshop.getWorkshopId().longValue() != workshopId.longValue()){
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增车间
|
||||
*
|
||||
* @param mdWorkshop 车间
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertMdWorkshop(MdWorkshop mdWorkshop)
|
||||
{
|
||||
mdWorkshop.setCreateTime(DateUtils.getNowDate());
|
||||
return mdWorkshopMapper.insertMdWorkshop(mdWorkshop);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改车间
|
||||
*
|
||||
* @param mdWorkshop 车间
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateMdWorkshop(MdWorkshop mdWorkshop)
|
||||
{
|
||||
mdWorkshop.setUpdateTime(DateUtils.getNowDate());
|
||||
return mdWorkshopMapper.updateMdWorkshop(mdWorkshop);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除车间
|
||||
*
|
||||
* @param workshopIds 需要删除的车间主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMdWorkshopByWorkshopIds(Long[] workshopIds)
|
||||
{
|
||||
return mdWorkshopMapper.deleteMdWorkshopByWorkshopIds(workshopIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除车间信息
|
||||
*
|
||||
* @param workshopId 车间主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMdWorkshopByWorkshopId(Long workshopId)
|
||||
{
|
||||
return mdWorkshopMapper.deleteMdWorkshopByWorkshopId(workshopId);
|
||||
}
|
||||
}
|
122
ktg-mes/src/main/resources/mapper/md/MdWorkshopMapper.xml
Normal file
122
ktg-mes/src/main/resources/mapper/md/MdWorkshopMapper.xml
Normal file
@ -0,0 +1,122 @@
|
||||
<?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.ktg.mes.md.mapper.MdWorkshopMapper">
|
||||
|
||||
<resultMap type="MdWorkshop" id="MdWorkshopResult">
|
||||
<result property="workshopId" column="workshop_id" />
|
||||
<result property="workshopCode" column="workshop_code" />
|
||||
<result property="workshopName" column="workshop_name" />
|
||||
<result property="area" column="area" />
|
||||
<result property="charge" column="charge" />
|
||||
<result property="enableFlag" column="enable_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMdWorkshopVo">
|
||||
select workshop_id, workshop_code, workshop_name, area, charge, enable_flag, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from md_workshop
|
||||
</sql>
|
||||
|
||||
<select id="selectMdWorkshopList" parameterType="MdWorkshop" resultMap="MdWorkshopResult">
|
||||
<include refid="selectMdWorkshopVo"/>
|
||||
<where>
|
||||
<if test="workshopCode != null and workshopCode != ''"> and workshop_code = #{workshopCode}</if>
|
||||
<if test="workshopName != null and workshopName != ''"> and workshop_name like concat('%', #{workshopName}, '%')</if>
|
||||
<if test="area != null "> and area = #{area}</if>
|
||||
<if test="charge != null and charge != ''"> and charge = #{charge}</if>
|
||||
<if test="enableFlag != null and enableFlag != ''"> and enable_flag = #{enableFlag}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMdWorkshopByWorkshopId" parameterType="Long" resultMap="MdWorkshopResult">
|
||||
<include refid="selectMdWorkshopVo"/>
|
||||
where workshop_id = #{workshopId}
|
||||
</select>
|
||||
|
||||
<select id="checkWorkshopCodeUnique" parameterType="MdWorkshop" resultMap="MdWorkshopResult">
|
||||
<include refid="selectMdWorkshopVo"/>
|
||||
where workshop_code = #{workshopCode}
|
||||
</select>
|
||||
|
||||
<select id="checkWorkshopNameUnique" parameterType="MdWorkshop" resultMap="MdWorkshopResult">
|
||||
<include refid="selectMdWorkshopVo"/>
|
||||
where workshop_name = #{workshopName}
|
||||
</select>
|
||||
|
||||
<insert id="insertMdWorkshop" parameterType="MdWorkshop" useGeneratedKeys="true" keyProperty="workshopId">
|
||||
insert into md_workshop
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="workshopCode != null and workshopCode != ''">workshop_code,</if>
|
||||
<if test="workshopName != null and workshopName != ''">workshop_name,</if>
|
||||
<if test="area != null">area,</if>
|
||||
<if test="charge != null">charge,</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">enable_flag,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</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="workshopCode != null and workshopCode != ''">#{workshopCode},</if>
|
||||
<if test="workshopName != null and workshopName != ''">#{workshopName},</if>
|
||||
<if test="area != null">#{area},</if>
|
||||
<if test="charge != null">#{charge},</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">#{enableFlag},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMdWorkshop" parameterType="MdWorkshop">
|
||||
update md_workshop
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="workshopCode != null and workshopCode != ''">workshop_code = #{workshopCode},</if>
|
||||
<if test="workshopName != null and workshopName != ''">workshop_name = #{workshopName},</if>
|
||||
<if test="area != null">area = #{area},</if>
|
||||
<if test="charge != null">charge = #{charge},</if>
|
||||
<if test="enableFlag != null and enableFlag != ''">enable_flag = #{enableFlag},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where workshop_id = #{workshopId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMdWorkshopByWorkshopId" parameterType="Long">
|
||||
delete from md_workshop where workshop_id = #{workshopId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMdWorkshopByWorkshopIds" parameterType="String">
|
||||
delete from md_workshop where workshop_id in
|
||||
<foreach item="workshopId" collection="array" open="(" separator="," close=")">
|
||||
#{workshopId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user