线体管理
parent
a6d9884ce2
commit
6869af8869
@ -0,0 +1,87 @@
|
||||
package com.op.mes.domain;
|
||||
|
||||
import com.op.common.core.web.domain.BaseEntity;
|
||||
|
||||
public class MesLineProduct extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String id;
|
||||
|
||||
private String productCode;
|
||||
|
||||
private String productName;
|
||||
|
||||
private String belongTo;
|
||||
|
||||
private String factoryCode;
|
||||
|
||||
private String delFlag;
|
||||
|
||||
private String attr1;
|
||||
|
||||
private String attr2;
|
||||
|
||||
public String getProductCode() {
|
||||
return productCode;
|
||||
}
|
||||
|
||||
public void setProductCode(String productCode) {
|
||||
this.productCode = productCode;
|
||||
}
|
||||
|
||||
public String getProductName() {
|
||||
return productName;
|
||||
}
|
||||
|
||||
public void setProductName(String productName) {
|
||||
this.productName = productName;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getBelongTo() {
|
||||
return belongTo;
|
||||
}
|
||||
|
||||
public void setBelongTo(String belongTo) {
|
||||
this.belongTo = belongTo;
|
||||
}
|
||||
|
||||
public String getAttr1() {
|
||||
return attr1;
|
||||
}
|
||||
|
||||
public void setAttr1(String attr1) {
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr2() {
|
||||
return attr2;
|
||||
}
|
||||
|
||||
public void setAttr2(String attr2) {
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getFactoryCode() {
|
||||
return factoryCode;
|
||||
}
|
||||
|
||||
public void setFactoryCode(String factoryCode) {
|
||||
this.factoryCode = factoryCode;
|
||||
}
|
||||
|
||||
public String getDelFlag() {
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package com.op.mes.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.op.mes.domain.MesLineProduct;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 线体产品管理Mapper接口
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2024-06-06
|
||||
*/
|
||||
@Mapper
|
||||
public interface MesLineProductMapper {
|
||||
/**
|
||||
* 查询线体产品管理
|
||||
*
|
||||
* @param id 线体产品管理主键
|
||||
* @return 线体产品管理
|
||||
*/
|
||||
public MesLineProduct selectMesLineProductById(String id);
|
||||
|
||||
/**
|
||||
* 查询线体产品管理列表
|
||||
*
|
||||
* @param mesLineProduct 线体产品管理
|
||||
* @return 线体产品管理集合
|
||||
*/
|
||||
public List<MesLineProduct> selectMesLineProductList(MesLineProduct mesLineProduct);
|
||||
|
||||
/**
|
||||
* 新增线体产品管理
|
||||
*
|
||||
* @param mesLineProduct 线体产品管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesLineProduct(MesLineProduct mesLineProduct);
|
||||
|
||||
/**
|
||||
* 修改线体产品管理
|
||||
*
|
||||
* @param mesLineProduct 线体产品管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesLineProduct(MesLineProduct mesLineProduct);
|
||||
|
||||
/**
|
||||
* 删除线体产品管理
|
||||
*
|
||||
* @param id 线体产品管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesLineProductById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除线体产品管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesLineProductByIds(String[] ids);
|
||||
|
||||
public int batchInsertMesLineProduct(@Param("list") List<MesLineProduct> mesLineProductList);
|
||||
|
||||
int deleteProductByBelongTo(@Param("belongTo") String belongTo);
|
||||
|
||||
List<MesLineProduct> selectProductByBelongTo(@Param("belongTo") String belongTo);
|
||||
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package com.op.mes.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.op.mes.domain.MesLineProduct;
|
||||
|
||||
/**
|
||||
* 线体产品管理Service接口
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2024-06-06
|
||||
*/
|
||||
public interface IMesLineProductService {
|
||||
/**
|
||||
* 查询线体产品管理
|
||||
*
|
||||
* @param id 线体产品管理主键
|
||||
* @return 线体产品管理
|
||||
*/
|
||||
public MesLineProduct selectMesLineProductById(String id);
|
||||
|
||||
/**
|
||||
* 查询线体产品管理列表
|
||||
*
|
||||
* @param mesLineProduct 线体产品管理
|
||||
* @return 线体产品管理集合
|
||||
*/
|
||||
public List<MesLineProduct> selectMesLineProductList(MesLineProduct mesLineProduct);
|
||||
|
||||
/**
|
||||
* 新增线体产品管理
|
||||
*
|
||||
* @param mesLineProduct 线体产品管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesLineProduct(MesLineProduct mesLineProduct);
|
||||
|
||||
/**
|
||||
* 修改线体产品管理
|
||||
*
|
||||
* @param mesLineProduct 线体产品管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesLineProduct(MesLineProduct mesLineProduct);
|
||||
|
||||
/**
|
||||
* 批量删除线体产品管理
|
||||
*
|
||||
* @param ids 需要删除的线体产品管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesLineProductByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除线体产品管理信息
|
||||
*
|
||||
* @param id 线体产品管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesLineProductById(String id);
|
||||
|
||||
public int batchInsertMesLineProduct(List<MesLineProduct> mesLineProductList);
|
||||
|
||||
public int deleteProductByBelongTo(String belongTo);
|
||||
|
||||
List<MesLineProduct> selectProductByBelongTo(String belongTo);
|
||||
}
|
@ -0,0 +1,109 @@
|
||||
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 org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.op.mes.mapper.MesLineProductMapper;
|
||||
import com.op.mes.domain.MesLineProduct;
|
||||
import com.op.mes.service.IMesLineProductService;
|
||||
|
||||
/**
|
||||
* 线体产品管理Service业务层处理
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2024-06-06
|
||||
*/
|
||||
@Service
|
||||
public class MesLineProductServiceImpl implements IMesLineProductService {
|
||||
@Autowired
|
||||
private MesLineProductMapper mesLineProductMapper;
|
||||
|
||||
/**
|
||||
* 查询线体产品管理
|
||||
*
|
||||
* @param id 线体产品管理主键
|
||||
* @return 线体产品管理
|
||||
*/
|
||||
@Override
|
||||
public MesLineProduct selectMesLineProductById(String id) {
|
||||
return mesLineProductMapper.selectMesLineProductById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询线体产品管理列表
|
||||
*
|
||||
* @param mesLineProduct 线体产品管理
|
||||
* @return 线体产品管理
|
||||
*/
|
||||
@Override
|
||||
public List<MesLineProduct> selectMesLineProductList(MesLineProduct mesLineProduct) {
|
||||
return mesLineProductMapper.selectMesLineProductList(mesLineProduct);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增线体产品管理
|
||||
*
|
||||
* @param mesLineProduct 线体产品管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertMesLineProduct(MesLineProduct mesLineProduct) {
|
||||
mesLineProduct.setCreateTime(DateUtils.getNowDate());
|
||||
return mesLineProductMapper.insertMesLineProduct(mesLineProduct);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改线体产品管理
|
||||
*
|
||||
* @param mesLineProduct 线体产品管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateMesLineProduct(MesLineProduct mesLineProduct) {
|
||||
mesLineProduct.setUpdateTime(DateUtils.getNowDate());
|
||||
return mesLineProductMapper.updateMesLineProduct(mesLineProduct);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除线体产品管理
|
||||
*
|
||||
* @param ids 需要删除的线体产品管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMesLineProductByIds(String[] ids) {
|
||||
return mesLineProductMapper.deleteMesLineProductByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除线体产品管理信息
|
||||
*
|
||||
* @param id 线体产品管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMesLineProductById(String id) {
|
||||
return mesLineProductMapper.deleteMesLineProductById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int batchInsertMesLineProduct(List<MesLineProduct> mesLineProductList) {
|
||||
return mesLineProductMapper.batchInsertMesLineProduct(mesLineProductList);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int deleteProductByBelongTo(String belongTo) {
|
||||
return mesLineProductMapper.deleteProductByBelongTo(belongTo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public List<MesLineProduct> selectProductByBelongTo(String belongTo) {
|
||||
return mesLineProductMapper.selectProductByBelongTo(belongTo);
|
||||
}
|
||||
}
|
@ -0,0 +1,240 @@
|
||||
<?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.MesLineProductMapper">
|
||||
|
||||
<resultMap type="MesLineProduct" id="MesLineProductResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="productCode" column="product_code"/>
|
||||
<result property="productName" column="product_name"/>
|
||||
<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"/>
|
||||
<result property="factoryCode" column="factory_code"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="belongTo" column="belong_to"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMesLineProductVo">
|
||||
select id,
|
||||
product_code,
|
||||
product_name,
|
||||
attr1,
|
||||
attr2,
|
||||
attr3,
|
||||
attr4,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
factory_code,
|
||||
del_flag,
|
||||
belong_to
|
||||
from mes_line_product
|
||||
</sql>
|
||||
|
||||
<select id="selectMesLineProductList" parameterType="MesLineProduct" resultMap="MesLineProductResult">
|
||||
<include refid="selectMesLineProductVo"/>
|
||||
<where>
|
||||
<if test="productCode != null and productCode != ''">
|
||||
and product_code = #{productCode}
|
||||
</if>
|
||||
<if test="productName != null and productName != ''">
|
||||
and product_name like concat('%', #{productName}, '%')
|
||||
</if>
|
||||
<if test="attr1 != null and attr1 != ''">
|
||||
and attr1 = #{attr1}
|
||||
</if>
|
||||
<if test="attr2 != null and attr2 != ''">
|
||||
and attr2 = #{attr2}
|
||||
</if>
|
||||
<if test="attr3 != null and attr3 != ''">
|
||||
and attr3 = #{attr3}
|
||||
</if>
|
||||
<if test="attr4 != null and attr4 != ''">
|
||||
and attr4 = #{attr4}
|
||||
</if>
|
||||
<if test="factoryCode != null and factoryCode != ''">
|
||||
and factory_code = #{factoryCode}
|
||||
</if>
|
||||
<if test="belongTo != null and belongTo != ''">
|
||||
and belong_to = #{belongTo}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMesLineProductById" parameterType="String"
|
||||
resultMap="MesLineProductResult">
|
||||
<include refid="selectMesLineProductVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertMesLineProduct" parameterType="MesLineProduct">
|
||||
insert into mes_line_product
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,
|
||||
</if>
|
||||
<if test="productCode != null">product_code,
|
||||
</if>
|
||||
<if test="productName != null">product_name,
|
||||
</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>
|
||||
<if test="factoryCode != null">factory_code,
|
||||
</if>
|
||||
<if test="delFlag != null">del_flag,
|
||||
</if>
|
||||
<if test="belongTo != null">belong_to,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},
|
||||
</if>
|
||||
<if test="productCode != null">#{productCode},
|
||||
</if>
|
||||
<if test="productName != null">#{productName},
|
||||
</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>
|
||||
<if test="factoryCode != null">#{factoryCode},
|
||||
</if>
|
||||
<if test="delFlag != null">#{delFlag},
|
||||
</if>
|
||||
<if test="belongTo != null">#{belongTo},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMesLineProduct" parameterType="MesLineProduct">
|
||||
update mes_line_product
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="productCode != null">product_code =
|
||||
#{productCode},
|
||||
</if>
|
||||
<if test="productName != null">product_name =
|
||||
#{productName},
|
||||
</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>
|
||||
<if test="factoryCode != null">factory_code =
|
||||
#{factoryCode},
|
||||
</if>
|
||||
<if test="delFlag != null">del_flag =
|
||||
#{delFlag},
|
||||
</if>
|
||||
<if test="belongTo != null">belong_to =
|
||||
#{belongTo},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<insert id="batchInsertMesLineProduct" parameterType="java.util.List">
|
||||
INSERT INTO mes_line_product (
|
||||
id,
|
||||
product_code,
|
||||
product_name,
|
||||
attr1,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
factory_code,
|
||||
belong_to
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="element" separator=",">
|
||||
(
|
||||
#{element.id},
|
||||
#{element.productCode},
|
||||
#{element.productName},
|
||||
#{element.attr1},
|
||||
#{element.createBy},
|
||||
#{element.createTime},
|
||||
#{element.updateBy},
|
||||
#{element.updateTime},
|
||||
#{element.factoryCode},
|
||||
#{element.belongTo}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteMesLineProductById" parameterType="String">
|
||||
delete
|
||||
from mes_line_product
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMesLineProductByIds" parameterType="String">
|
||||
delete from mes_line_product where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteProductByBelongTo" parameterType="String">
|
||||
delete from mes_line_product where belong_to = #{belongTo}
|
||||
</delete>
|
||||
|
||||
<select id="selectProductByBelongTo" parameterType="String"
|
||||
resultMap="MesLineProductResult">
|
||||
<include refid="selectMesLineProductVo"/>
|
||||
where belong_to = #{belongTo} order by create_time ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue