Browse Source
委外加工 委外计划 修改委外计划mapper及service有关委外物料的mapper调用; 修改添加委外报价页面回调去重方法逻辑; 新增委外物料mapper文件; 新增按料号批量删除委外物料mapper方法;dev
王晓迪
3 days ago
6 changed files with 245 additions and 64 deletions
@ -0,0 +1,90 @@ |
|||||
|
package com.ruoyi.system.mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import com.ruoyi.system.domain.OutsourceMaterial; |
||||
|
|
||||
|
/** |
||||
|
* 委外物料Mapper接口 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-09-18 |
||||
|
*/ |
||||
|
public interface OutsourceMaterialMapper |
||||
|
{ |
||||
|
/** |
||||
|
* 查询委外物料 |
||||
|
* |
||||
|
* @param outsourceMaterialId 委外物料ID |
||||
|
* @return 委外物料 |
||||
|
*/ |
||||
|
public OutsourceMaterial selectOutsourceMaterialById(Long outsourceMaterialId); |
||||
|
|
||||
|
/** |
||||
|
* 查询委外物料列表 |
||||
|
* |
||||
|
* @param outsourceMaterial 委外物料 |
||||
|
* @return 委外物料集合 |
||||
|
*/ |
||||
|
public List<OutsourceMaterial> selectOutsourceMaterialList(OutsourceMaterial outsourceMaterial); |
||||
|
|
||||
|
/** |
||||
|
* 新增委外物料 |
||||
|
* |
||||
|
* @param outsourceMaterial 委外物料 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int insertOutsourceMaterial(OutsourceMaterial outsourceMaterial); |
||||
|
|
||||
|
/** |
||||
|
* 修改委外物料 |
||||
|
* |
||||
|
* @param outsourceMaterial 委外物料 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int updateOutsourceMaterial(OutsourceMaterial outsourceMaterial); |
||||
|
|
||||
|
/** |
||||
|
* 删除委外物料 |
||||
|
* |
||||
|
* @param outsourceMaterialId 委外物料ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteOutsourceMaterialById(Long outsourceMaterialId); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除委外物料 |
||||
|
* |
||||
|
* @param outsourceMaterialIds 需要删除的数据ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteOutsourceMaterialByIds(String[] outsourceMaterialIds); |
||||
|
|
||||
|
/** |
||||
|
* 作废委外物料 |
||||
|
* |
||||
|
* @param outsourceMaterialId 委外物料ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int cancelOutsourceMaterialById(Long outsourceMaterialId); |
||||
|
|
||||
|
/** |
||||
|
* 恢复委外物料 |
||||
|
* |
||||
|
* @param outsourceMaterialId 委外物料ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int restoreOutsourceMaterialById(Long outsourceMaterialId); |
||||
|
|
||||
|
/** |
||||
|
* 查询委外物料 |
||||
|
* |
||||
|
* @param materialNo 需要查询的数据编码 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
// public OutsourceMaterial selectMaterialByCode(String materialNo);
|
||||
|
|
||||
|
|
||||
|
public List<OutsourceMaterial> selectProcessNoByNo (String materialNo); |
||||
|
|
||||
|
public int deleteOutsourceMaterialByNo(String materialNo); |
||||
|
} |
@ -0,0 +1,132 @@ |
|||||
|
<?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.ruoyi.system.mapper.OutsourceMaterialMapper"> |
||||
|
|
||||
|
<resultMap type="OutsourceMaterial" id="OutsourceMaterialResult"> |
||||
|
<result property="outsourceMaterialId" column="outsource_material_id" /> |
||||
|
<result property="materialNo" column="material_no" /> |
||||
|
<result property="materialName" column="material_name" /> |
||||
|
<result property="materialType" column="material_type" /> |
||||
|
<result property="materialPhotourl" column="material_photoUrl" /> |
||||
|
<result property="description" column="description" /> |
||||
|
<result property="brand" column="brand" /> |
||||
|
<result property="unit" column="unit" /> |
||||
|
<result property="plannedOutsourceAmount" column="planned_outsource_amount" /> |
||||
|
<result property="processMethod" column="process_method" /> |
||||
|
<result property="outsourceProcessNo" column="outsource_process_no" /> |
||||
|
<result property="outsourceProcessName" column="outsource_process_name" /> |
||||
|
</resultMap> |
||||
|
|
||||
|
<sql id="selectOutsourceMaterialVo"> |
||||
|
select outsource_material_id, material_no, material_name, material_type, material_photoUrl, description, brand, unit, planned_outsource_amount, process_method, outsource_process_no, outsource_process_name from outsource_material |
||||
|
</sql> |
||||
|
|
||||
|
<select id="selectOutsourceMaterialList" parameterType="OutsourceMaterial" resultMap="OutsourceMaterialResult"> |
||||
|
<include refid="selectOutsourceMaterialVo"/> |
||||
|
<where> |
||||
|
<if test="materialNo != null and materialNo != ''"> and material_no = #{materialNo}</if> |
||||
|
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if> |
||||
|
<if test="materialType != null and materialType != ''"> and material_type = #{materialType}</if> |
||||
|
<if test="materialPhotourl != null and materialPhotourl != ''"> and material_photoUrl = #{materialPhotourl}</if> |
||||
|
<if test="description != null and description != ''"> and description = #{description}</if> |
||||
|
<if test="brand != null and brand != ''"> and brand = #{brand}</if> |
||||
|
<if test="unit != null and unit != ''"> and unit = #{unit}</if> |
||||
|
<if test="plannedOutsourceAmount != null "> and planned_outsource_amount = #{plannedOutsourceAmount}</if> |
||||
|
<if test="processMethod != null and processMethod != ''"> and process_method = #{processMethod}</if> |
||||
|
<if test="outsourceProcessNo != null and outsourceProcessNo != ''"> and outsource_process_no = #{outsourceProcessNo}</if> |
||||
|
<if test="outsourceProcessName != null and outsourceProcessName != ''"> and outsource_process_name like concat('%', #{outsourceProcessName}, '%')</if> |
||||
|
</where> |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectOutsourceMaterialById" parameterType="Long" resultMap="OutsourceMaterialResult"> |
||||
|
<include refid="selectOutsourceMaterialVo"/> |
||||
|
where outsource_material_id = #{outsourceMaterialId} |
||||
|
</select> |
||||
|
|
||||
|
<insert id="insertOutsourceMaterial" parameterType="OutsourceMaterial" useGeneratedKeys="true" keyProperty="outsourceMaterialId"> |
||||
|
insert into outsource_material |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="materialNo != null and materialNo != ''">material_no,</if> |
||||
|
<if test="materialName != null and materialName != ''">material_name,</if> |
||||
|
<if test="materialType != null">material_type,</if> |
||||
|
<if test="materialPhotourl != null">material_photoUrl,</if> |
||||
|
<if test="description != null">description,</if> |
||||
|
<if test="brand != null">brand,</if> |
||||
|
<if test="unit != null">unit,</if> |
||||
|
<if test="plannedOutsourceAmount != null">planned_outsource_amount,</if> |
||||
|
<if test="processMethod != null">process_method,</if> |
||||
|
<if test="outsourceProcessNo != null and outsourceProcessNo != ''">outsource_process_no,</if> |
||||
|
<if test="outsourceProcessName != null">outsource_process_name,</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="materialNo != null and materialNo != ''">#{materialNo},</if> |
||||
|
<if test="materialName != null and materialName != ''">#{materialName},</if> |
||||
|
<if test="materialType != null">#{materialType},</if> |
||||
|
<if test="materialPhotourl != null">#{materialPhotourl},</if> |
||||
|
<if test="description != null">#{description},</if> |
||||
|
<if test="brand != null">#{brand},</if> |
||||
|
<if test="unit != null">#{unit},</if> |
||||
|
<if test="plannedOutsourceAmount != null">#{plannedOutsourceAmount},</if> |
||||
|
<if test="processMethod != null">#{processMethod},</if> |
||||
|
<if test="outsourceProcessNo != null and outsourceProcessNo != ''">#{outsourceProcessNo},</if> |
||||
|
<if test="outsourceProcessName != null">#{outsourceProcessName},</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
|
||||
|
<update id="updateOutsourceMaterial" parameterType="OutsourceMaterial"> |
||||
|
update outsource_material |
||||
|
<trim prefix="SET" suffixOverrides=","> |
||||
|
<if test="materialNo != null and materialNo != ''">material_no = #{materialNo},</if> |
||||
|
<if test="materialName != null and materialName != ''">material_name = #{materialName},</if> |
||||
|
<if test="materialType != null">material_type = #{materialType},</if> |
||||
|
<if test="materialPhotourl != null">material_photoUrl = #{materialPhotourl},</if> |
||||
|
<if test="description != null">description = #{description},</if> |
||||
|
<if test="brand != null">brand = #{brand},</if> |
||||
|
<if test="unit != null">unit = #{unit},</if> |
||||
|
<if test="plannedOutsourceAmount != null">planned_outsource_amount = #{plannedOutsourceAmount},</if> |
||||
|
<if test="processMethod != null">process_method = #{processMethod},</if> |
||||
|
<if test="outsourceProcessNo != null and outsourceProcessNo != ''">outsource_process_no = #{outsourceProcessNo},</if> |
||||
|
<if test="outsourceProcessName != null">outsource_process_name = #{outsourceProcessName},</if> |
||||
|
</trim> |
||||
|
where outsource_material_id = #{outsourceMaterialId} |
||||
|
</update> |
||||
|
|
||||
|
<delete id="deleteOutsourceMaterialById" parameterType="Long"> |
||||
|
delete from outsource_material where outsource_material_id = #{outsourceMaterialId} |
||||
|
</delete> |
||||
|
|
||||
|
<delete id="deleteOutsourceMaterialByIds" parameterType="String"> |
||||
|
delete from outsource_material where outsource_material_id in |
||||
|
<foreach item="outsourceMaterialId" collection="array" open="(" separator="," close=")"> |
||||
|
#{outsourceMaterialId} |
||||
|
</foreach> |
||||
|
</delete> |
||||
|
|
||||
|
<update id="cancelOutsourceMaterialById" parameterType="Long"> |
||||
|
update outsource_material set del_flag = '1' where outsource_material_id = #{outsourceMaterialId} |
||||
|
</update> |
||||
|
|
||||
|
<update id="restoreOutsourceMaterialById" parameterType="Long"> |
||||
|
update outsource_material set del_flag = '0' where outsource_material_id = #{outsourceMaterialId} |
||||
|
</update> |
||||
|
|
||||
|
<!-- 按料号查询委外物料--> |
||||
|
<!-- <select id="selectMaterialByCode" parameterType="String" resultMap="OutsourceMaterialResult">--> |
||||
|
<!-- select material_no, material_name, material_type, material_photoUrl, description, brand, unit, planned_outsource_amount, process_method, outsource_process_no, outsource_process_name--> |
||||
|
<!-- from outsource_material--> |
||||
|
<!-- where material_no =#{materialNo}--> |
||||
|
<!-- </select>--> |
||||
|
|
||||
|
<!-- 按料号查询委外物料--> |
||||
|
<select id="selectProcessNoByNo" parameterType="String" resultMap="OutsourceMaterialResult"> |
||||
|
select material_no, material_name, material_type, material_photoUrl, description, brand, unit, planned_outsource_amount, process_method, outsource_process_no, outsource_process_name |
||||
|
from outsource_material |
||||
|
where material_no =#{materialNo} |
||||
|
</select> |
||||
|
|
||||
|
<delete id="deleteOutsourceMaterialByNo" parameterType="String"> |
||||
|
delete from outsource_material where material_no = #{materialNo} |
||||
|
</delete> |
||||
|
</mapper> |
Loading…
Reference in new issue