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

216 lines
12 KiB
XML

<?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.os.mes.prod.mapper.ProdOrderInfoMapper">
<resultMap type="ProdOrderInfo" id="ProdOrderInfoResult">
<result property="objId" column="obj_id"/>
<result property="orderCode" column="order_code"/>
<result property="saleOrderCode" column="sale_order_code"/>
<result property="saleOrderLineNumber" column="sale_order_line_number"/>
<result property="materialCode" column="material_code"/>
<result property="materialName" column="material_name"/>
<result property="matkl" column="matkl"/>
<result property="bomCode" column="bom_code"/>
<result property="orderAmount" column="order_amount"/>
<result property="completeAmount" column="complete_amount"/>
<result property="orderType" column="order_type"/>
<result property="orderStatus" column="order_status"/>
<result property="finishFlag" column="finish_flag"/>
<result property="beginDate" column="begin_date"/>
<result property="endDate" column="end_date"/>
<result property="realBeginDate" column="real_begin_date"/>
<result property="realEndDate" column="real_end_date"/>
<result property="factoryCode" column="factory_code"/>
<result property="isRelease" column="is_release"/>
<result property="workCenterCode" column="work_center_code"/>
<result property="routingCode" column="routing_code"/>
<result property="printName" column="print_name"/>
<result property="isFlag" column="is_flag"/>
<result property="createdBy" column="created_by"/>
<result property="createdTime" column="created_time"/>
<result property="updatedBy" column="updated_by"/>
<result property="updatedTime" column="updated_time"/>
</resultMap>
<sql id="selectProdOrderInfoVo">
select obj_id,
order_code,
sale_order_code,
sale_order_line_number,
material_code,
material_name,
matkl,
bom_code,
order_amount,
complete_amount,
order_type,
order_status,
finish_flag,
begin_date,
end_date,
real_begin_date,
real_end_date,
factory_code,
is_release,
work_center_code,
routing_code,
print_name,
is_flag,
created_by,
created_time,
updated_by,
updated_time
from prod_order_info
</sql>
<select id="selectProdOrderInfoList" parameterType="ProdOrderInfo" resultMap="ProdOrderInfoResult">
<include refid="selectProdOrderInfoVo"/>
<where>
<if test="orderCode != null and orderCode != ''">and order_code = #{orderCode}</if>
<if test="saleOrderCode != null and saleOrderCode != ''">and sale_order_code = #{saleOrderCode}</if>
<if test="saleOrderLineNumber != null and saleOrderLineNumber != ''">and sale_order_line_number =
#{saleOrderLineNumber}
</if>
<if test="materialCode != null and materialCode != ''">and material_code = #{materialCode}</if>
<if test="materialName != null and materialName != ''">and material_name like concat('%', #{materialName},
'%')
</if>
<if test="matkl != null and matkl != ''">and matkl = #{matkl}</if>
<if test="bomCode != null and bomCode != ''">and bom_code = #{bomCode}</if>
<if test="orderAmount != null ">and order_amount = #{orderAmount}</if>
<if test="completeAmount != null ">and complete_amount = #{completeAmount}</if>
<if test="orderType != null and orderType != ''">and order_type = #{orderType}</if>
<if test="orderStatus != null and orderStatus != ''">and order_status = #{orderStatus}</if>
<if test="finishFlag != null and finishFlag != ''">and finish_flag = #{finishFlag}</if>
<if test="params.beginBeginDate != null and params.beginBeginDate != '' and params.endBeginDate != null and params.endBeginDate != ''">
and begin_date between #{params.beginBeginDate} and #{params.endBeginDate}
</if>
<if test="endDate != null ">and end_date = #{endDate}</if>
<if test="realBeginDate != null ">and real_begin_date = #{realBeginDate}</if>
<if test="realEndDate != null ">and real_end_date = #{realEndDate}</if>
<if test="factoryCode != null and factoryCode != ''">and factory_code = #{factoryCode}</if>
<if test="isRelease != null and isRelease != ''">and is_release = #{isRelease}</if>
<if test="workCenterCode != null and workCenterCode != ''">and work_center_code = #{workCenterCode}</if>
<if test="routingCode != null and routingCode != ''">and routing_code = #{routingCode}</if>
<if test="printName != null and printName != ''">and print_name like concat('%', #{printName}, '%')</if>
<if test="isFlag != null and isFlag != ''">and is_flag = #{isFlag}</if>
<if test="createdBy != null and createdBy != ''">and created_by = #{createdBy}</if>
<if test="createdTime != null ">and created_time = #{createdTime}</if>
<if test="updatedBy != null and updatedBy != ''">and updated_by = #{updatedBy}</if>
<if test="updatedTime != null ">and updated_time = #{updatedTime}</if>
</where>
</select>
<select id="selectProdOrderInfoByObjId" parameterType="Long" resultMap="ProdOrderInfoResult">
<include refid="selectProdOrderInfoVo"/>
where obj_id = #{objId}
</select>
<insert id="insertProdOrderInfo" parameterType="ProdOrderInfo" useGeneratedKeys="true" keyProperty="objId">
insert into prod_order_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderCode != null">order_code,</if>
<if test="saleOrderCode != null">sale_order_code,</if>
<if test="saleOrderLineNumber != null">sale_order_line_number,</if>
<if test="materialCode != null">material_code,</if>
<if test="materialName != null">material_name,</if>
<if test="matkl != null">matkl,</if>
<if test="bomCode != null">bom_code,</if>
<if test="orderAmount != null">order_amount,</if>
<if test="completeAmount != null">complete_amount,</if>
<if test="orderType != null">order_type,</if>
<if test="orderStatus != null">order_status,</if>
<if test="finishFlag != null">finish_flag,</if>
<if test="beginDate != null">begin_date,</if>
<if test="endDate != null">end_date,</if>
<if test="realBeginDate != null">real_begin_date,</if>
<if test="realEndDate != null">real_end_date,</if>
<if test="factoryCode != null">factory_code,</if>
<if test="isRelease != null">is_release,</if>
<if test="workCenterCode != null">work_center_code,</if>
<if test="routingCode != null">routing_code,</if>
<if test="printName != null">print_name,</if>
<if test="isFlag != null">is_flag,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdTime != null">created_time,</if>
<if test="updatedBy != null">updated_by,</if>
<if test="updatedTime != null">updated_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderCode != null">#{orderCode},</if>
<if test="saleOrderCode != null">#{saleOrderCode},</if>
<if test="saleOrderLineNumber != null">#{saleOrderLineNumber},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="materialName != null">#{materialName},</if>
<if test="matkl != null">#{matkl},</if>
<if test="bomCode != null">#{bomCode},</if>
<if test="orderAmount != null">#{orderAmount},</if>
<if test="completeAmount != null">#{completeAmount},</if>
<if test="orderType != null">#{orderType},</if>
<if test="orderStatus != null">#{orderStatus},</if>
<if test="finishFlag != null">#{finishFlag},</if>
<if test="beginDate != null">#{beginDate},</if>
<if test="endDate != null">#{endDate},</if>
<if test="realBeginDate != null">#{realBeginDate},</if>
<if test="realEndDate != null">#{realEndDate},</if>
<if test="factoryCode != null">#{factoryCode},</if>
<if test="isRelease != null">#{isRelease},</if>
<if test="workCenterCode != null">#{workCenterCode},</if>
<if test="routingCode != null">#{routingCode},</if>
<if test="printName != null">#{printName},</if>
<if test="isFlag != null">#{isFlag},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
<if test="updatedBy != null">#{updatedBy},</if>
<if test="updatedTime != null">#{updatedTime},</if>
</trim>
</insert>
<update id="updateProdOrderInfo" parameterType="ProdOrderInfo">
update prod_order_info
<trim prefix="SET" suffixOverrides=",">
<if test="orderCode != null">order_code = #{orderCode},</if>
<if test="saleOrderCode != null">sale_order_code = #{saleOrderCode},</if>
<if test="saleOrderLineNumber != null">sale_order_line_number = #{saleOrderLineNumber},</if>
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="matkl != null">matkl = #{matkl},</if>
<if test="bomCode != null">bom_code = #{bomCode},</if>
<if test="orderAmount != null">order_amount = #{orderAmount},</if>
<if test="completeAmount != null">complete_amount = #{completeAmount},</if>
<if test="orderType != null">order_type = #{orderType},</if>
<if test="orderStatus != null">order_status = #{orderStatus},</if>
<if test="finishFlag != null">finish_flag = #{finishFlag},</if>
<if test="beginDate != null">begin_date = #{beginDate},</if>
<if test="endDate != null">end_date = #{endDate},</if>
<if test="realBeginDate != null">real_begin_date = #{realBeginDate},</if>
<if test="realEndDate != null">real_end_date = #{realEndDate},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
<if test="isRelease != null">is_release = #{isRelease},</if>
<if test="workCenterCode != null">work_center_code = #{workCenterCode},</if>
<if test="routingCode != null">routing_code = #{routingCode},</if>
<if test="printName != null">print_name = #{printName},</if>
<if test="isFlag != null">is_flag = #{isFlag},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
</trim>
where obj_id = #{objId}
</update>
<delete id="deleteProdOrderInfoByObjId" parameterType="Long">
delete
from prod_order_info
where obj_id = #{objId}
</delete>
<delete id="deleteProdOrderInfoByObjIds" parameterType="String">
delete from prod_order_info where obj_id in
<foreach item="objId" collection="array" open="(" separator="," close=")">
#{objId}
</foreach>
</delete>
</mapper>