工作站人力资源设置
This commit is contained in:
parent
42336be12a
commit
4841a77735
@ -47,6 +47,19 @@ public class SysPostController extends BaseController
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有有效岗位信息以List方式返回
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:post:list')")
|
||||
@GetMapping("/listAll")
|
||||
public AjaxResult listAll(){
|
||||
SysPost post = new SysPost();
|
||||
post.setStatus("0");
|
||||
List<SysPost> list = postService.selectPostList(post);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Log(title = "岗位管理", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:post:export')")
|
||||
@PostMapping("/export")
|
||||
|
@ -0,0 +1,124 @@
|
||||
package com.ktg.mes.md.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.utils.StringUtils;
|
||||
import com.ktg.system.domain.SysPost;
|
||||
import com.ktg.system.service.ISysPostService;
|
||||
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.MdWorkstationWorker;
|
||||
import com.ktg.mes.md.service.IMdWorkstationWorkerService;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 人力资源Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/md/workstationworker")
|
||||
public class MdWorkstationWorkerController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IMdWorkstationWorkerService mdWorkstationWorkerService;
|
||||
|
||||
@Autowired
|
||||
private ISysPostService sysPostService;
|
||||
|
||||
/**
|
||||
* 查询人力资源列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:workstationworker:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MdWorkstationWorker mdWorkstationWorker)
|
||||
{
|
||||
startPage();
|
||||
List<MdWorkstationWorker> list = mdWorkstationWorkerService.selectMdWorkstationWorkerList(mdWorkstationWorker);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出人力资源列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:workstationworker:export')")
|
||||
@Log(title = "人力资源", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MdWorkstationWorker mdWorkstationWorker)
|
||||
{
|
||||
List<MdWorkstationWorker> list = mdWorkstationWorkerService.selectMdWorkstationWorkerList(mdWorkstationWorker);
|
||||
ExcelUtil<MdWorkstationWorker> util = new ExcelUtil<MdWorkstationWorker>(MdWorkstationWorker.class);
|
||||
util.exportExcel(response, list, "人力资源数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取人力资源详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:workstationworker:query')")
|
||||
@GetMapping(value = "/{recordId}")
|
||||
public AjaxResult getInfo(@PathVariable("recordId") Long recordId)
|
||||
{
|
||||
return AjaxResult.success(mdWorkstationWorkerService.selectMdWorkstationWorkerByRecordId(recordId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增人力资源
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:workstationworker:add')")
|
||||
@Log(title = "人力资源", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MdWorkstationWorker mdWorkstationWorker)
|
||||
{
|
||||
SysPost post = sysPostService.selectPostById(mdWorkstationWorker.getPostId());
|
||||
mdWorkstationWorker.setPostCode(post.getPostCode());
|
||||
mdWorkstationWorker.setPostName(post.getPostName());
|
||||
if(UserConstants.NOT_UNIQUE.equals(mdWorkstationWorkerService.checkPostExist(mdWorkstationWorker))){
|
||||
return AjaxResult.error("此岗位已经添加!");
|
||||
}
|
||||
return toAjax(mdWorkstationWorkerService.insertMdWorkstationWorker(mdWorkstationWorker));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改人力资源
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:workstationworker:edit')")
|
||||
@Log(title = "人力资源", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MdWorkstationWorker mdWorkstationWorker)
|
||||
{
|
||||
SysPost post = sysPostService.selectPostById(mdWorkstationWorker.getPostId());
|
||||
mdWorkstationWorker.setPostCode(post.getPostCode());
|
||||
mdWorkstationWorker.setPostName(post.getPostName());
|
||||
if(UserConstants.NOT_UNIQUE.equals(mdWorkstationWorkerService.checkPostExist(mdWorkstationWorker))){
|
||||
return AjaxResult.error("此岗位已经添加!");
|
||||
}
|
||||
return toAjax(mdWorkstationWorkerService.updateMdWorkstationWorker(mdWorkstationWorker));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除人力资源
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:md:workstationworker:remove')")
|
||||
@Log(title = "人力资源", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{recordIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] recordIds)
|
||||
{
|
||||
return toAjax(mdWorkstationWorkerService.deleteMdWorkstationWorkerByRecordIds(recordIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,164 @@
|
||||
package com.ktg.mes.md.domain;
|
||||
|
||||
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_workstation_worker
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-12
|
||||
*/
|
||||
public class MdWorkstationWorker extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 记录ID */
|
||||
private Long recordId;
|
||||
|
||||
/** 工作站ID */
|
||||
@Excel(name = "工作站ID")
|
||||
private Long workstationId;
|
||||
|
||||
/** 岗位ID */
|
||||
@Excel(name = "岗位ID")
|
||||
private Long postId;
|
||||
|
||||
/** 岗位编码 */
|
||||
@Excel(name = "岗位编码")
|
||||
private String postCode;
|
||||
|
||||
/** 岗位名称 */
|
||||
@Excel(name = "岗位名称")
|
||||
private String postName;
|
||||
|
||||
/** 数量 */
|
||||
@Excel(name = "数量")
|
||||
private Integer quantity;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setRecordId(Long recordId)
|
||||
{
|
||||
this.recordId = recordId;
|
||||
}
|
||||
|
||||
public Long getRecordId()
|
||||
{
|
||||
return recordId;
|
||||
}
|
||||
public void setWorkstationId(Long workstationId)
|
||||
{
|
||||
this.workstationId = workstationId;
|
||||
}
|
||||
|
||||
public Long getWorkstationId()
|
||||
{
|
||||
return workstationId;
|
||||
}
|
||||
public void setPostId(Long postId)
|
||||
{
|
||||
this.postId = postId;
|
||||
}
|
||||
|
||||
public Long getPostId()
|
||||
{
|
||||
return postId;
|
||||
}
|
||||
public void setPostCode(String postCode)
|
||||
{
|
||||
this.postCode = postCode;
|
||||
}
|
||||
|
||||
public String getPostCode()
|
||||
{
|
||||
return postCode;
|
||||
}
|
||||
public void setPostName(String postName)
|
||||
{
|
||||
this.postName = postName;
|
||||
}
|
||||
|
||||
public String getPostName()
|
||||
{
|
||||
return postName;
|
||||
}
|
||||
public void setQuantity(Integer quantity)
|
||||
{
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public Integer getQuantity()
|
||||
{
|
||||
return quantity;
|
||||
}
|
||||
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("recordId", getRecordId())
|
||||
.append("workstationId", getWorkstationId())
|
||||
.append("postId", getPostId())
|
||||
.append("postCode", getPostCode())
|
||||
.append("postName", getPostName())
|
||||
.append("quantity", getQuantity())
|
||||
.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,64 @@
|
||||
package com.ktg.mes.md.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.md.domain.MdWorkstationWorker;
|
||||
|
||||
/**
|
||||
* 人力资源Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-12
|
||||
*/
|
||||
public interface MdWorkstationWorkerMapper
|
||||
{
|
||||
/**
|
||||
* 查询人力资源
|
||||
*
|
||||
* @param recordId 人力资源主键
|
||||
* @return 人力资源
|
||||
*/
|
||||
public MdWorkstationWorker selectMdWorkstationWorkerByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询人力资源列表
|
||||
*
|
||||
* @param mdWorkstationWorker 人力资源
|
||||
* @return 人力资源集合
|
||||
*/
|
||||
public List<MdWorkstationWorker> selectMdWorkstationWorkerList(MdWorkstationWorker mdWorkstationWorker);
|
||||
|
||||
public MdWorkstationWorker checkPostExist(MdWorkstationWorker mdWorkstationWorker);
|
||||
|
||||
|
||||
/**
|
||||
* 新增人力资源
|
||||
*
|
||||
* @param mdWorkstationWorker 人力资源
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMdWorkstationWorker(MdWorkstationWorker mdWorkstationWorker);
|
||||
|
||||
/**
|
||||
* 修改人力资源
|
||||
*
|
||||
* @param mdWorkstationWorker 人力资源
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMdWorkstationWorker(MdWorkstationWorker mdWorkstationWorker);
|
||||
|
||||
/**
|
||||
* 删除人力资源
|
||||
*
|
||||
* @param recordId 人力资源主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMdWorkstationWorkerByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 批量删除人力资源
|
||||
*
|
||||
* @param recordIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMdWorkstationWorkerByRecordIds(Long[] recordIds);
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.ktg.mes.md.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.md.domain.MdWorkstationWorker;
|
||||
|
||||
/**
|
||||
* 人力资源Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-12
|
||||
*/
|
||||
public interface IMdWorkstationWorkerService
|
||||
{
|
||||
/**
|
||||
* 查询人力资源
|
||||
*
|
||||
* @param recordId 人力资源主键
|
||||
* @return 人力资源
|
||||
*/
|
||||
public MdWorkstationWorker selectMdWorkstationWorkerByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询人力资源列表
|
||||
*
|
||||
* @param mdWorkstationWorker 人力资源
|
||||
* @return 人力资源集合
|
||||
*/
|
||||
public List<MdWorkstationWorker> selectMdWorkstationWorkerList(MdWorkstationWorker mdWorkstationWorker);
|
||||
|
||||
/**
|
||||
* 检查当前工作站是否已添加此岗位资源
|
||||
* @param mdWorkstationWorker
|
||||
* @return
|
||||
*/
|
||||
public String checkPostExist(MdWorkstationWorker mdWorkstationWorker);
|
||||
|
||||
/**
|
||||
* 新增人力资源
|
||||
*
|
||||
* @param mdWorkstationWorker 人力资源
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMdWorkstationWorker(MdWorkstationWorker mdWorkstationWorker);
|
||||
|
||||
/**
|
||||
* 修改人力资源
|
||||
*
|
||||
* @param mdWorkstationWorker 人力资源
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMdWorkstationWorker(MdWorkstationWorker mdWorkstationWorker);
|
||||
|
||||
/**
|
||||
* 批量删除人力资源
|
||||
*
|
||||
* @param recordIds 需要删除的人力资源主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMdWorkstationWorkerByRecordIds(Long[] recordIds);
|
||||
|
||||
/**
|
||||
* 删除人力资源信息
|
||||
*
|
||||
* @param recordId 人力资源主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMdWorkstationWorkerByRecordId(Long recordId);
|
||||
}
|
@ -0,0 +1,109 @@
|
||||
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.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.md.mapper.MdWorkstationWorkerMapper;
|
||||
import com.ktg.mes.md.domain.MdWorkstationWorker;
|
||||
import com.ktg.mes.md.service.IMdWorkstationWorkerService;
|
||||
|
||||
/**
|
||||
* 人力资源Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-12
|
||||
*/
|
||||
@Service
|
||||
public class MdWorkstationWorkerServiceImpl implements IMdWorkstationWorkerService
|
||||
{
|
||||
@Autowired
|
||||
private MdWorkstationWorkerMapper mdWorkstationWorkerMapper;
|
||||
|
||||
/**
|
||||
* 查询人力资源
|
||||
*
|
||||
* @param recordId 人力资源主键
|
||||
* @return 人力资源
|
||||
*/
|
||||
@Override
|
||||
public MdWorkstationWorker selectMdWorkstationWorkerByRecordId(Long recordId)
|
||||
{
|
||||
return mdWorkstationWorkerMapper.selectMdWorkstationWorkerByRecordId(recordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询人力资源列表
|
||||
*
|
||||
* @param mdWorkstationWorker 人力资源
|
||||
* @return 人力资源
|
||||
*/
|
||||
@Override
|
||||
public List<MdWorkstationWorker> selectMdWorkstationWorkerList(MdWorkstationWorker mdWorkstationWorker)
|
||||
{
|
||||
return mdWorkstationWorkerMapper.selectMdWorkstationWorkerList(mdWorkstationWorker);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkPostExist(MdWorkstationWorker mdWorkstationWorker) {
|
||||
MdWorkstationWorker post = mdWorkstationWorkerMapper.checkPostExist(mdWorkstationWorker);
|
||||
Long recordId = mdWorkstationWorker.getRecordId()==null?-1L:mdWorkstationWorker.getRecordId();
|
||||
if(StringUtils.isNotNull(post) && post.getRecordId().longValue() != recordId.longValue()){
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增人力资源
|
||||
*
|
||||
* @param mdWorkstationWorker 人力资源
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertMdWorkstationWorker(MdWorkstationWorker mdWorkstationWorker)
|
||||
{
|
||||
mdWorkstationWorker.setCreateTime(DateUtils.getNowDate());
|
||||
return mdWorkstationWorkerMapper.insertMdWorkstationWorker(mdWorkstationWorker);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改人力资源
|
||||
*
|
||||
* @param mdWorkstationWorker 人力资源
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateMdWorkstationWorker(MdWorkstationWorker mdWorkstationWorker)
|
||||
{
|
||||
mdWorkstationWorker.setUpdateTime(DateUtils.getNowDate());
|
||||
return mdWorkstationWorkerMapper.updateMdWorkstationWorker(mdWorkstationWorker);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除人力资源
|
||||
*
|
||||
* @param recordIds 需要删除的人力资源主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMdWorkstationWorkerByRecordIds(Long[] recordIds)
|
||||
{
|
||||
return mdWorkstationWorkerMapper.deleteMdWorkstationWorkerByRecordIds(recordIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除人力资源信息
|
||||
*
|
||||
* @param recordId 人力资源主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMdWorkstationWorkerByRecordId(Long recordId)
|
||||
{
|
||||
return mdWorkstationWorkerMapper.deleteMdWorkstationWorkerByRecordId(recordId);
|
||||
}
|
||||
}
|
@ -0,0 +1,117 @@
|
||||
<?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.MdWorkstationWorkerMapper">
|
||||
|
||||
<resultMap type="MdWorkstationWorker" id="MdWorkstationWorkerResult">
|
||||
<result property="recordId" column="record_id" />
|
||||
<result property="workstationId" column="workstation_id" />
|
||||
<result property="postId" column="post_id" />
|
||||
<result property="postCode" column="post_code" />
|
||||
<result property="postName" column="post_name" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<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="selectMdWorkstationWorkerVo">
|
||||
select record_id, workstation_id, post_id, post_code, post_name, quantity, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from md_workstation_worker
|
||||
</sql>
|
||||
|
||||
<select id="selectMdWorkstationWorkerList" parameterType="MdWorkstationWorker" resultMap="MdWorkstationWorkerResult">
|
||||
<include refid="selectMdWorkstationWorkerVo"/>
|
||||
<where>
|
||||
<if test="workstationId != null "> and workstation_id = #{workstationId}</if>
|
||||
<if test="postId != null "> and post_id = #{postId}</if>
|
||||
<if test="postCode != null and postCode != ''"> and post_code = #{postCode}</if>
|
||||
<if test="postName != null and postName != ''"> and post_name like concat('%', #{postName}, '%')</if>
|
||||
<if test="quantity != null "> and quantity = #{quantity}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMdWorkstationWorkerByRecordId" parameterType="Long" resultMap="MdWorkstationWorkerResult">
|
||||
<include refid="selectMdWorkstationWorkerVo"/>
|
||||
where record_id = #{recordId}
|
||||
</select>
|
||||
|
||||
<select id="checkPostExist" parameterType="MdWorkstationWorker" resultMap="MdWorkstationWorkerResult">
|
||||
<include refid="selectMdWorkstationWorkerVo"/>
|
||||
where post_code = #{postCode} and workstation_id = #{workstationId} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertMdWorkstationWorker" parameterType="MdWorkstationWorker" useGeneratedKeys="true" keyProperty="recordId">
|
||||
insert into md_workstation_worker
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="workstationId != null">workstation_id,</if>
|
||||
<if test="postId != null">post_id,</if>
|
||||
<if test="postCode != null">post_code,</if>
|
||||
<if test="postName != null">post_name,</if>
|
||||
<if test="quantity != null">quantity,</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="workstationId != null">#{workstationId},</if>
|
||||
<if test="postId != null">#{postId},</if>
|
||||
<if test="postCode != null">#{postCode},</if>
|
||||
<if test="postName != null">#{postName},</if>
|
||||
<if test="quantity != null">#{quantity},</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="updateMdWorkstationWorker" parameterType="MdWorkstationWorker">
|
||||
update md_workstation_worker
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="workstationId != null">workstation_id = #{workstationId},</if>
|
||||
<if test="postId != null">post_id = #{postId},</if>
|
||||
<if test="postCode != null">post_code = #{postCode},</if>
|
||||
<if test="postName != null">post_name = #{postName},</if>
|
||||
<if test="quantity != null">quantity = #{quantity},</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 record_id = #{recordId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMdWorkstationWorkerByRecordId" parameterType="Long">
|
||||
delete from md_workstation_worker where record_id = #{recordId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMdWorkstationWorkerByRecordIds" parameterType="String">
|
||||
delete from md_workstation_worker where record_id in
|
||||
<foreach item="recordId" collection="array" open="(" separator="," close=")">
|
||||
#{recordId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user