箱型分类实现

master
shaoyong 6 months ago
parent c48de5d3f3
commit 521f1de96f

@ -0,0 +1,110 @@
package com.op.mes.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.system.api.domain.SysDictType;
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.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.mes.domain.MesBox;
import com.op.mes.service.IMesBoxService;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.page.TableDataInfo;
/**
* Controller
*
* @author Open Platform
* @date 2024-08-20
*/
@RestController
@RequestMapping("/mesBox")
public class MesBoxController extends BaseController {
@Autowired
private IMesBoxService mesBoxService;
/**
*
*/
@RequiresPermissions("mes:mesBox:list")
@GetMapping("/list")
public TableDataInfo list(MesBox mesBox) {
startPage();
List<MesBox> list = mesBoxService.selectMesBoxList(mesBox);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("mes:mesBox:export")
@Log(title = "箱体类型", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MesBox mesBox) {
List<MesBox> list = mesBoxService.selectMesBoxList(mesBox);
ExcelUtil<MesBox> util = new ExcelUtil<MesBox>(MesBox. class);
util.exportExcel(response, list, "箱体类型数据");
}
/**
*
*/
@RequiresPermissions("mes:mesBox:query")
@GetMapping(value = "/{boxId}")
public AjaxResult getInfo(@PathVariable("boxId") Long boxId) {
return success(mesBoxService.selectMesBoxByBoxId(boxId));
}
/**
*
*/
@RequiresPermissions("mes:mesBox:add")
@Log(title = "箱体类型", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MesBox mesBox) {
return toAjax(mesBoxService.insertMesBox(mesBox));
}
/**
*
*/
@RequiresPermissions("mes:mesBox:edit")
@Log(title = "箱体类型", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MesBox mesBox) {
return toAjax(mesBoxService.updateMesBox(mesBox));
}
/**
*
*/
@RequiresPermissions("mes:mesBox:remove")
@Log(title = "箱体类型", businessType = BusinessType.DELETE)
@DeleteMapping("/{boxIds}")
public AjaxResult remove(@PathVariable Long[] boxIds) {
return toAjax(mesBoxService.deleteMesBoxByBoxIds(boxIds));
}
/**
*
*/
@GetMapping("/optionSelect")
@DS("#header.poolName")
public AjaxResult optionSelect() {
List<MesBox> boxTypes = mesBoxService.selectDictTypeAll();
return success(boxTypes);
}
}

@ -0,0 +1,115 @@
package com.op.mes.controller;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.StringUtils;
import com.op.system.api.domain.SysDictData;
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.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.mes.domain.MesBoxDetail;
import com.op.mes.service.IMesBoxDetailService;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.page.TableDataInfo;
/**
* Controller
*
* @author Open Platform
* @date 2024-08-20
*/
@RestController
@RequestMapping("/mesBoxDetail")
public class MesBoxDetailController extends BaseController {
@Autowired
private IMesBoxDetailService mesBoxDetailService;
/**
*
*/
@RequiresPermissions("mes:mesBoxDetail:list")
@GetMapping("/list")
public TableDataInfo list(MesBoxDetail mesBoxDetail) {
startPage();
List<MesBoxDetail> list = mesBoxDetailService.selectMesBoxDetailList(mesBoxDetail);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("mes:mesBoxDetail:export")
@Log(title = "箱体数据", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MesBoxDetail mesBoxDetail) {
List<MesBoxDetail> list = mesBoxDetailService.selectMesBoxDetailList(mesBoxDetail);
ExcelUtil<MesBoxDetail> util = new ExcelUtil<MesBoxDetail>(MesBoxDetail. class);
util.exportExcel(response, list, "箱体数据数据");
}
/**
*
*/
@RequiresPermissions("mes:mesBoxDetail:query")
@GetMapping(value = "/{boxCode}")
public AjaxResult getInfo(@PathVariable("boxCode") Long boxCode) {
return success(mesBoxDetailService.selectMesBoxDetailByBoxCode(boxCode));
}
/**
*
*/
@GetMapping(value = "/type/{boxType}")
@DS("#header.poolName")
public AjaxResult dictType(@PathVariable String boxType) {
List<SysDictData> data = mesBoxDetailService.selectBoxDataByType(boxType);
if (StringUtils.isNull(data)) {
data = new ArrayList<SysDictData>();
}
return success(data);
}
/**
*
*/
@RequiresPermissions("mes:mesBoxDetail:add")
@Log(title = "箱体数据", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MesBoxDetail mesBoxDetail) {
return toAjax(mesBoxDetailService.insertMesBoxDetail(mesBoxDetail));
}
/**
*
*/
@RequiresPermissions("mes:mesBoxDetail:edit")
@Log(title = "箱体数据", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MesBoxDetail mesBoxDetail) {
return toAjax(mesBoxDetailService.updateMesBoxDetail(mesBoxDetail));
}
/**
*
*/
@RequiresPermissions("mes:mesBoxDetail:remove")
@Log(title = "箱体数据", businessType = BusinessType.DELETE)
@DeleteMapping("/{boxCodes}")
public AjaxResult remove(@PathVariable Long[] boxCodes) {
return toAjax(mesBoxDetailService.deleteMesBoxDetailByBoxCodes(boxCodes));
}
}

@ -0,0 +1,75 @@
package com.op.mes.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
/**
* mes_box
*
* @author Open Platform
* @date 2024-08-20
*/
public class MesBox extends BaseEntity {
private static final long serialVersionUID=1L;
/** 字典主键 */
private Long boxId;
/** 字典名称 */
@Excel(name = "字典名称")
private String boxName;
/** 字典类型 */
@Excel(name = "字典类型")
private String boxType;
/** 状态0正常 */
@Excel(name = "状态", readConverterExp = "状态0正常")
private String status;
public void setBoxId(Long boxId){
this.boxId = boxId;
}
public Long getBoxId(){
return boxId;
}
public void setBoxName(String boxName){
this.boxName = boxName;
}
public String getBoxName(){
return boxName;
}
public void setBoxType(String boxType){
this.boxType = boxType;
}
public String getBoxType(){
return boxType;
}
public void setStatus(String status){
this.status = status;
}
public String getStatus(){
return status;
}
@Override
public String toString(){
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("boxId",getBoxId())
.append("boxName",getBoxName())
.append("boxType",getBoxType())
.append("status",getStatus())
.append("createBy",getCreateBy())
.append("createTime",getCreateTime())
.append("updateBy",getUpdateBy())
.append("updateTime",getUpdateTime())
.append("remark",getRemark())
.toString();
}
}

@ -0,0 +1,176 @@
package com.op.mes.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
/**
* mes_box_detail
*
* @author Open Platform
* @date 2024-08-20
*/
public class MesBoxDetail extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long boxCode;
/**
*
*/
@Excel(name = "箱型排序")
private Long boxSort;
/**
*
*/
@Excel(name = "箱型标签")
private String boxLabel;
/**
*
*/
@Excel(name = "箱型关键字")
private String boxKey;
/**
*
*/
@Excel(name = "箱型值")
private String boxValue;
/**
*
*/
@Excel(name = "箱型类型")
private String boxType;
/**
*
*/
@Excel(name = "样式属性", readConverterExp = "其=他样式扩展")
private String cssClass;
/**
*
*/
@Excel(name = "表格回显样式")
private String listClass;
/**
* Y
*/
@Excel(name = "是否默认", readConverterExp = "是否默认Y是")
private String isDefault;
/**
* 0
*/
@Excel(name = "状态", readConverterExp = "状态0正常")
private String status;
public void setBoxCode(Long boxCode) {
this.boxCode = boxCode;
}
public Long getBoxCode() {
return boxCode;
}
public void setBoxSort(Long boxSort) {
this.boxSort = boxSort;
}
public Long getBoxSort() {
return boxSort;
}
public void setBoxLabel(String boxLabel) {
this.boxLabel = boxLabel;
}
public String getBoxLabel() {
return boxLabel;
}
public String getBoxKey() {
return boxKey;
}
public void setBoxKey(String boxKey) {
this.boxKey = boxKey;
}
public void setBoxValue(String boxValue) {
this.boxValue = boxValue;
}
public String getBoxValue() {
return boxValue;
}
public void setBoxType(String boxType) {
this.boxType = boxType;
}
public String getBoxType() {
return boxType;
}
public void setCssClass(String cssClass) {
this.cssClass = cssClass;
}
public String getCssClass() {
return cssClass;
}
public void setListClass(String listClass) {
this.listClass = listClass;
}
public String getListClass() {
return listClass;
}
public void setIsDefault(String isDefault) {
this.isDefault = isDefault;
}
public String getIsDefault() {
return isDefault;
}
public void setStatus(String status) {
this.status = status;
}
public String getStatus() {
return status;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("boxCode", getBoxCode())
.append("boxSort", getBoxSort())
.append("boxLabel", getBoxLabel())
.append("boxValue", getBoxValue())
.append("boxType", getBoxType())
.append("cssClass", getCssClass())
.append("listClass", getListClass())
.append("isDefault", getIsDefault())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

@ -0,0 +1,61 @@
package com.op.mes.mapper;
import java.util.List;
import com.op.mes.domain.MesBoxDetail;
/**
* Mapper
*
* @author Open Platform
* @date 2024-08-20
*/
public interface MesBoxDetailMapper {
/**
*
*
* @param boxCode
* @return
*/
public MesBoxDetail selectMesBoxDetailByBoxCode(Long boxCode);
/**
*
*
* @param mesBoxDetail
* @return
*/
public List<MesBoxDetail> selectMesBoxDetailList(MesBoxDetail mesBoxDetail);
/**
*
*
* @param mesBoxDetail
* @return
*/
public int insertMesBoxDetail(MesBoxDetail mesBoxDetail);
/**
*
*
* @param mesBoxDetail
* @return
*/
public int updateMesBoxDetail(MesBoxDetail mesBoxDetail);
/**
*
*
* @param boxCode
* @return
*/
public int deleteMesBoxDetailByBoxCode(Long boxCode);
/**
*
*
* @param boxCodes
* @return
*/
public int deleteMesBoxDetailByBoxCodes(Long[] boxCodes);
}

@ -0,0 +1,63 @@
package com.op.mes.mapper;
import java.util.List;
import com.op.mes.domain.MesBox;
/**
* Mapper
*
* @author Open Platform
* @date 2024-08-20
*/
public interface MesBoxMapper {
/**
*
*
* @param boxId
* @return
*/
public MesBox selectMesBoxByBoxId(Long boxId);
/**
*
*
* @param mesBox
* @return
*/
public List<MesBox> selectMesBoxList(MesBox mesBox);
/**
*
*
* @param mesBox
* @return
*/
public int insertMesBox(MesBox mesBox);
/**
*
*
* @param mesBox
* @return
*/
public int updateMesBox(MesBox mesBox);
/**
*
*
* @param boxId
* @return
*/
public int deleteMesBoxByBoxId(Long boxId);
/**
*
*
* @param boxIds
* @return
*/
public int deleteMesBoxByBoxIds(Long[] boxIds);
List<MesBox> selectDictTypeAll();
}

@ -0,0 +1,64 @@
package com.op.mes.service;
import java.util.List;
import com.op.mes.domain.MesBoxDetail;
import com.op.system.api.domain.SysDictData;
/**
* Service
*
* @author Open Platform
* @date 2024-08-20
*/
public interface IMesBoxDetailService {
/**
*
*
* @param boxCode
* @return
*/
public MesBoxDetail selectMesBoxDetailByBoxCode(Long boxCode);
/**
*
*
* @param mesBoxDetail
* @return
*/
public List<MesBoxDetail> selectMesBoxDetailList(MesBoxDetail mesBoxDetail);
/**
*
*
* @param mesBoxDetail
* @return
*/
public int insertMesBoxDetail(MesBoxDetail mesBoxDetail);
/**
*
*
* @param mesBoxDetail
* @return
*/
public int updateMesBoxDetail(MesBoxDetail mesBoxDetail);
/**
*
*
* @param boxCodes
* @return
*/
public int deleteMesBoxDetailByBoxCodes(Long[] boxCodes);
/**
*
*
* @param boxCode
* @return
*/
public int deleteMesBoxDetailByBoxCode(Long boxCode);
List<SysDictData> selectBoxDataByType(String boxType);
}

@ -0,0 +1,63 @@
package com.op.mes.service;
import java.util.List;
import com.op.mes.domain.MesBox;
/**
* Service
*
* @author Open Platform
* @date 2024-08-20
*/
public interface IMesBoxService {
/**
*
*
* @param boxId
* @return
*/
public MesBox selectMesBoxByBoxId(Long boxId);
/**
*
*
* @param mesBox
* @return
*/
public List<MesBox> selectMesBoxList(MesBox mesBox);
/**
*
*
* @param mesBox
* @return
*/
public int insertMesBox(MesBox mesBox);
/**
*
*
* @param mesBox
* @return
*/
public int updateMesBox(MesBox mesBox);
/**
*
*
* @param boxIds
* @return
*/
public int deleteMesBoxByBoxIds(Long[] boxIds);
/**
*
*
* @param boxId
* @return
*/
public int deleteMesBoxByBoxId(Long boxId);
List<MesBox> selectDictTypeAll();
}

@ -0,0 +1,106 @@
package com.op.mes.service.impl;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.security.utils.SecurityUtils;
import com.op.system.api.domain.SysDictData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.mes.mapper.MesBoxDetailMapper;
import com.op.mes.domain.MesBoxDetail;
import com.op.mes.service.IMesBoxDetailService;
/**
* Service
*
* @author Open Platform
* @date 2024-08-20
*/
@Service
public class MesBoxDetailServiceImpl implements IMesBoxDetailService {
@Autowired
private MesBoxDetailMapper mesBoxDetailMapper;
/**
*
*
* @param boxCode
* @return
*/
@Override
@DS("#header.poolName")
public MesBoxDetail selectMesBoxDetailByBoxCode(Long boxCode) {
return mesBoxDetailMapper.selectMesBoxDetailByBoxCode(boxCode);
}
/**
*
*
* @param mesBoxDetail
* @return
*/
@Override
@DS("#header.poolName")
public List<MesBoxDetail> selectMesBoxDetailList(MesBoxDetail mesBoxDetail) {
return mesBoxDetailMapper.selectMesBoxDetailList(mesBoxDetail);
}
/**
*
*
* @param mesBoxDetail
* @return
*/
@Override
@DS("#header.poolName")
public int insertMesBoxDetail(MesBoxDetail mesBoxDetail) {
mesBoxDetail.setCreateBy(SecurityUtils.getUsername());
mesBoxDetail.setCreateTime(DateUtils.getNowDate());
return mesBoxDetailMapper.insertMesBoxDetail(mesBoxDetail);
}
/**
*
*
* @param mesBoxDetail
* @return
*/
@Override
@DS("#header.poolName")
public int updateMesBoxDetail(MesBoxDetail mesBoxDetail) {
mesBoxDetail.setUpdateBy(SecurityUtils.getUsername());
mesBoxDetail.setUpdateTime(DateUtils.getNowDate());
return mesBoxDetailMapper.updateMesBoxDetail(mesBoxDetail);
}
/**
*
*
* @param boxCodes
* @return
*/
@Override
@DS("#header.poolName")
public int deleteMesBoxDetailByBoxCodes(Long[] boxCodes) {
return mesBoxDetailMapper.deleteMesBoxDetailByBoxCodes(boxCodes);
}
/**
*
*
* @param boxCode
* @return
*/
@Override
@DS("#header.poolName")
public int deleteMesBoxDetailByBoxCode(Long boxCode) {
return mesBoxDetailMapper.deleteMesBoxDetailByBoxCode(boxCode);
}
@Override
public List<SysDictData> selectBoxDataByType(String boxType) {
return null;
}
}

@ -0,0 +1,106 @@
package com.op.mes.service.impl;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.mes.mapper.MesBoxMapper;
import com.op.mes.domain.MesBox;
import com.op.mes.service.IMesBoxService;
/**
* Service
*
* @author Open Platform
* @date 2024-08-20
*/
@Service
public class MesBoxServiceImpl implements IMesBoxService {
@Autowired
private MesBoxMapper mesBoxMapper;
/**
*
*
* @param boxId
* @return
*/
@Override
@DS("#header.poolName")
public MesBox selectMesBoxByBoxId(Long boxId) {
return mesBoxMapper.selectMesBoxByBoxId(boxId);
}
/**
*
*
* @param mesBox
* @return
*/
@Override
@DS("#header.poolName")
public List<MesBox> selectMesBoxList(MesBox mesBox) {
return mesBoxMapper.selectMesBoxList(mesBox);
}
/**
*
*
* @param mesBox
* @return
*/
@Override
@DS("#header.poolName")
public int insertMesBox(MesBox mesBox) {
mesBox.setUpdateBy(SecurityUtils.getUsername());
mesBox.setCreateTime(DateUtils.getNowDate());
return mesBoxMapper.insertMesBox(mesBox);
}
/**
*
*
* @param mesBox
* @return
*/
@Override
@DS("#header.poolName")
public int updateMesBox(MesBox mesBox) {
mesBox.setUpdateBy(SecurityUtils.getUsername());
mesBox.setUpdateTime(DateUtils.getNowDate());
return mesBoxMapper.updateMesBox(mesBox);
}
/**
*
*
* @param boxIds
* @return
*/
@Override
@DS("#header.poolName")
public int deleteMesBoxByBoxIds(Long[] boxIds) {
return mesBoxMapper.deleteMesBoxByBoxIds(boxIds);
}
/**
*
*
* @param boxId
* @return
*/
@Override
@DS("#header.poolName")
public int deleteMesBoxByBoxId(Long boxId) {
return mesBoxMapper.deleteMesBoxByBoxId(boxId);
}
@Override
@DS("#header.poolName")
public List<MesBox> selectDictTypeAll() {
return mesBoxMapper.selectDictTypeAll();
}
}

@ -0,0 +1,196 @@
<?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.op.mes.mapper.MesBoxDetailMapper">
<resultMap type="MesBoxDetail" id="MesBoxDetailResult">
<result property="boxCode" column="box_code"/>
<result property="boxSort" column="box_sort"/>
<result property="boxLabel" column="box_label"/>
<result property="boxKey" column="box_key"/>
<result property="boxValue" column="box_value"/>
<result property="boxType" column="box_type"/>
<result property="cssClass" column="css_class"/>
<result property="listClass" column="list_class"/>
<result property="isDefault" column="is_default"/>
<result property="status" column="status"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
</resultMap>
<sql id="selectMesBoxDetailVo">
select box_code, box_sort, box_label, box_key, box_value, box_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark from mes_box_detail
</sql>
<select id="selectMesBoxDetailList" parameterType="MesBoxDetail" resultMap="MesBoxDetailResult">
<include refid="selectMesBoxDetailVo"/>
<where>
<if test="boxSort != null ">
and box_sort = #{boxSort}
</if>
<if test="boxLabel != null and boxLabel != ''">
and box_label = #{boxLabel}
</if>
<if test="boxKey != null and boxKey != ''">
and box_key = #{boxKey}
</if>
<if test="boxValue != null and boxValue != ''">
and box_value = #{boxValue}
</if>
<if test="boxType != null and boxType != ''">
and box_type = #{boxType}
</if>
<if test="cssClass != null and cssClass != ''">
and css_class = #{cssClass}
</if>
<if test="listClass != null and listClass != ''">
and list_class = #{listClass}
</if>
<if test="isDefault != null and isDefault != ''">
and is_default = #{isDefault}
</if>
<if test="status != null and status != ''">
and status = #{status}
</if>
</where>
order by box_sort
</select>
<select id="selectMesBoxDetailByBoxCode" parameterType="Long"
resultMap="MesBoxDetailResult">
<include refid="selectMesBoxDetailVo"/>
where box_code = #{boxCode}
</select>
<insert id="insertMesBoxDetail" parameterType="MesBoxDetail">
insert into mes_box_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="boxCode != null">box_code,
</if>
<if test="boxSort != null">box_sort,
</if>
<if test="boxLabel != null">box_label,
</if>
<if test="boxKey != null">box_key,
</if>
<if test="boxValue != null">box_value,
</if>
<if test="boxType != null">box_type,
</if>
<if test="cssClass != null">css_class,
</if>
<if test="listClass != null">list_class,
</if>
<if test="isDefault != null">is_default,
</if>
<if test="status != null">status,
</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>
<if test="remark != null">remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="boxCode != null">#{boxCode},
</if>
<if test="boxSort != null">#{boxSort},
</if>
<if test="boxLabel != null">#{boxLabel},
</if>
<if test="boxKey != null">#{boxKey},
</if>
<if test="boxValue != null">#{boxValue},
</if>
<if test="boxType != null">#{boxType},
</if>
<if test="cssClass != null">#{cssClass},
</if>
<if test="listClass != null">#{listClass},
</if>
<if test="isDefault != null">#{isDefault},
</if>
<if test="status != null">#{status},
</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>
<if test="remark != null">#{remark},
</if>
</trim>
</insert>
<update id="updateMesBoxDetail" parameterType="MesBoxDetail">
update mes_box_detail
<trim prefix="SET" suffixOverrides=",">
<if test="boxSort != null">box_sort =
#{boxSort},
</if>
<if test="boxLabel != null">box_label =
#{boxLabel},
</if>
<if test="boxKey != null">box_key =
#{boxKey},
</if>
<if test="boxValue != null">box_value =
#{boxValue},
</if>
<if test="boxType != null">box_type =
#{boxType},
</if>
<if test="cssClass != null">css_class =
#{cssClass},
</if>
<if test="listClass != null">list_class =
#{listClass},
</if>
<if test="isDefault != null">is_default =
#{isDefault},
</if>
<if test="status != null">status =
#{status},
</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>
<if test="remark != null">remark =
#{remark},
</if>
</trim>
where box_code = #{boxCode}
</update>
<delete id="deleteMesBoxDetailByBoxCode" parameterType="Long">
delete from mes_box_detail where box_code = #{boxCode}
</delete>
<delete id="deleteMesBoxDetailByBoxCodes" parameterType="String">
delete from mes_box_detail where box_code in
<foreach item="boxCode" collection="array" open="(" separator="," close=")">
#{boxCode}
</foreach>
</delete>
</mapper>

@ -0,0 +1,133 @@
<?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.op.mes.mapper.MesBoxMapper">
<resultMap type="MesBox" id="MesBoxResult">
<result property="boxId" column="box_id"/>
<result property="boxName" column="box_name"/>
<result property="boxType" column="box_type"/>
<result property="status" column="status"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
</resultMap>
<sql id="selectMesBoxVo">
select box_id, box_name, box_type, status, create_by, create_time, update_by, update_time, remark from mes_box
</sql>
<select id="selectMesBoxList" parameterType="MesBox" resultMap="MesBoxResult">
<include refid="selectMesBoxVo"/>
<where>
<if test="boxName != null and boxName != ''">
and box_name like concat('%', #{boxName}, '%')
</if>
<if test="boxType != null and boxType != ''">
and box_type = #{boxType}
</if>
<if test="status != null and status != ''">
and status = #{status}
</if>
</where>
</select>
<select id="selectMesBoxByBoxId" parameterType="Long"
resultMap="MesBoxResult">
<include refid="selectMesBoxVo"/>
where box_id = #{boxId}
</select>
<insert id="insertMesBox" parameterType="MesBox">
insert into mes_box
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="boxId != null">box_id,
</if>
<if test="boxName != null">box_name,
</if>
<if test="boxType != null">box_type,
</if>
<if test="status != null">status,
</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>
<if test="remark != null">remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="boxId != null">#{boxId},
</if>
<if test="boxName != null">#{boxName},
</if>
<if test="boxType != null">#{boxType},
</if>
<if test="status != null">#{status},
</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>
<if test="remark != null">#{remark},
</if>
</trim>
</insert>
<update id="updateMesBox" parameterType="MesBox">
update mes_box
<trim prefix="SET" suffixOverrides=",">
<if test="boxName != null">box_name =
#{boxName},
</if>
<if test="boxType != null">box_type =
#{boxType},
</if>
<if test="status != null">status =
#{status},
</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>
<if test="remark != null">remark =
#{remark},
</if>
</trim>
where box_id = #{boxId}
</update>
<select id="selectDictTypeAll" resultMap="MesBoxResult">
<include refid="selectMesBoxVo"/>
</select>
<delete id="deleteMesBoxByBoxId" parameterType="Long">
delete from mes_box where box_id = #{boxId}
</delete>
<delete id="deleteMesBoxByBoxIds" parameterType="String">
delete from mes_box where box_id in
<foreach item="boxId" collection="array" open="(" separator="," close=")">
#{boxId}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save