万材erp项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

146 lines
8.7 KiB

<?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.SysBomMapper">
<resultMap type="SysBom" id="SysBomResult">
<result property="bomId" column="bom_id" />
<result property="versionNumber" column="version_number" />
<result property="bomCode" column="bom_code" />
<result property="bomName" column="bom_name" />
<result property="bomProductionCost" column="bom_production_cost" />
<result property="bomRemarks" column="bom_remarks" />
<result property="bomCreator" column="bom_creator" />
<result property="enterpriseName" column="enterprise_name" />
<result property="bomTime" column="bom_time" />
<result property="enterpriseCode" column="enterprise_code" />
<result property="customerNumber" column="customer_number" />
<result property="finishProductCode" column="finish_product_code" />
<result property="finishProductName" column="finish_product_name" />
<result property="specificationModel" column="specification_model" />
<result property="typeMachine" column="type_machine" />
<result property="inventoryUnit" column="inventory_unit" />
<result property="currentVersion" column="current_version" />
<result property="confirmNo" column="confirm_no" />
<result property="confirmName" column="confirm_name" />
<result property="confirmTime" column="confirm_time" />
<result property="firstAddTime" column="first_add_time" />
<result property="updateInfoTime" column="update_info_time" />
</resultMap>
<sql id="selectSysBomVo">
select bom_id, version_number, bom_code, bom_name, bom_production_cost, bom_remarks, bom_creator, enterprise_name, bom_time, enterprise_code, customer_number, finish_product_code, finish_product_name, specification_model, type_machine, inventory_unit, current_version, confirm_no, confirm_name, confirm_time, first_add_time, update_info_time from sys_bom
</sql>
<select id="selectSysBomList" parameterType="SysBom" resultMap="SysBomResult">
<include refid="selectSysBomVo"/>
<where>
<if test="bomCode != null and bomCode != ''"> and bom_code like concat('%', #{bomCode}, '%')</if>
<if test="bomName != null and bomName != ''"> and bom_name like concat('%', #{bomName}, '%')</if>
<if test="enterpriseCode != null and enterpriseCode != ''"> and enterprise_code = #{enterpriseCode}</if>
<if test="customerNumber != null and customerNumber != ''"> and customer_number = #{customerNumber}</if>
<if test="typeMachine != null and typeMachine != ''"> and type_machine like concat('%', #{typeMachine}, '%')</if>
<if test="finishProductCode != null and finishProductCode != ''"> and finish_product_code = #{finishProductCode}</if>
<if test="confirmNo != null and confirmNo != ''"> and confirm_no = #{confirmNo}</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(first_add_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(first_add_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
</where>
</select>
<select id="selectSysBomById" parameterType="Long" resultMap="SysBomResult">
<include refid="selectSysBomVo"/>
where bom_id = #{bomId}
</select>
<insert id="insertSysBom" parameterType="SysBom" useGeneratedKeys="true" keyProperty="bomId">
insert into sys_bom
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="versionNumber != null">version_number,</if>
<if test="bomCode != null">bom_code,</if>
<if test="bomName != null">bom_name,</if>
<if test="bomProductionCost != null">bom_production_cost,</if>
<if test="bomRemarks != null">bom_remarks,</if>
<if test="bomCreator != null">bom_creator,</if>
<if test="enterpriseName != null">enterprise_name,</if>
<if test="bomTime != null">bom_time,</if>
<if test="enterpriseCode != null">enterprise_code,</if>
<if test="customerNumber != null">customer_number,</if>
<if test="finishProductCode != null">finish_product_code,</if>
<if test="finishProductName != null">finish_product_name,</if>
<if test="specificationModel != null">specification_model,</if>
<if test="typeMachine != null">type_machine,</if>
<if test="inventoryUnit != null">inventory_unit,</if>
<if test="currentVersion != null">current_version,</if>
<if test="confirmNo != null">confirm_no,</if>
<if test="confirmName != null">confirm_name,</if>
<if test="confirmTime != null">confirm_time,</if>
first_add_time,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="versionNumber != null">#{versionNumber},</if>
<if test="bomCode != null">#{bomCode},</if>
<if test="bomName != null">#{bomName},</if>
<if test="bomProductionCost != null">#{bomProductionCost},</if>
<if test="bomRemarks != null">#{bomRemarks},</if>
<if test="bomCreator != null">#{bomCreator},</if>
<if test="enterpriseName != null">#{enterpriseName},</if>
<if test="bomTime != null">#{bomTime},</if>
<if test="enterpriseCode != null">#{enterpriseCode},</if>
<if test="customerNumber != null">#{customerNumber},</if>
<if test="finishProductCode != null">#{finishProductCode},</if>
<if test="finishProductName != null">#{finishProductName},</if>
<if test="specificationModel != null">#{specificationModel},</if>
<if test="typeMachine != null">#{typeMachine},</if>
<if test="inventoryUnit != null">#{inventoryUnit},</if>
<if test="currentVersion != null">#{currentVersion},</if>
<if test="confirmNo != null">#{confirmNo},</if>
<if test="confirmName != null">#{confirmName},</if>
<if test="confirmTime != null">#{confirmTime},</if>
now(),
</trim>
</insert>
<update id="updateSysBom" parameterType="SysBom">
update sys_bom
<trim prefix="SET" suffixOverrides=",">
<if test="versionNumber != null">version_number = #{versionNumber},</if>
<if test="bomCode != null">bom_code = #{bomCode},</if>
<if test="bomName != null">bom_name = #{bomName},</if>
<if test="bomProductionCost != null">bom_production_cost = #{bomProductionCost},</if>
<if test="bomRemarks != null">bom_remarks = #{bomRemarks},</if>
<if test="bomCreator != null">bom_creator = #{bomCreator},</if>
<if test="enterpriseName != null">enterprise_name = #{enterpriseName},</if>
<if test="bomTime != null">bom_time = #{bomTime},</if>
<if test="enterpriseCode != null">enterprise_code = #{enterpriseCode},</if>
<if test="customerNumber != null">customer_number = #{customerNumber},</if>
<if test="finishProductCode != null">finish_product_code = #{finishProductCode},</if>
<if test="finishProductName != null">finish_product_name = #{finishProductName},</if>
<if test="specificationModel != null">specification_model = #{specificationModel},</if>
<if test="typeMachine != null">type_machine = #{typeMachine},</if>
<if test="inventoryUnit != null">inventory_unit = #{inventoryUnit},</if>
<if test="currentVersion != null">current_version = #{currentVersion},</if>
<if test="confirmNo != null">confirm_no = #{confirmNo},</if>
<if test="confirmName != null">confirm_name = #{confirmName},</if>
<if test="confirmTime != null">confirm_time = #{confirmTime},</if>
update_info_time = CONCAT_WS(',',NOW(),update_info_time),
</trim>
where bom_id = #{bomId}
</update>
<delete id="deleteSysBomById" parameterType="Long">
delete from sys_bom where bom_id = #{bomId}
</delete>
<delete id="deleteSysBomByIds" parameterType="String">
delete from sys_bom where bom_id in
<foreach item="bomId" collection="array" open="(" separator="," close=")">
#{bomId}
</foreach>
</delete>
</mapper>