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.

177 lines
9.2 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.aucma.base.mapper.BaseOrderInfoMapper">
<resultMap type="BaseOrderInfo" id="BaseOrderInfoResult">
<result property="objId" column="obj_id"/>
<result property="orderCode" column="order_code"/>
<result property="saleOrderCode" column="saleorder_code"/>
<result property="saleOrderLineNumber" column="saleorder_linenumber"/>
<result property="materialCode" column="material_code"/>
<result property="materialName" column="material_name"/>
<result property="matkl" column="matkl"/>
<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="beginDate" column="begin_date"/>
<result property="endDate" column="end_date"/>
<result property="factoryCode" column="factory_code"/>
<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"/>
<result property="completeDate" column="complete_date"/>
</resultMap>
<sql id="selectBaseOrderInfoVo">
select obj_id,
order_code,
saleorder_code,
saleorder_linenumber,
material_code,
material_name,
matkl,
order_amount,
complete_amount,
order_type,
order_status,
begin_date,
end_date,
factory_code,
is_flag,
created_by,
created_time,
updated_by,
updated_time,
complete_date
from base_orderinfo
</sql>
<select id="selectBaseOrderInfoList" parameterType="BaseOrderInfo" resultMap="BaseOrderInfoResult">
<include refid="selectBaseOrderInfoVo"/>
<where>
<if test="orderCode != null and orderCode != ''">and order_code = #{orderCode}</if>
<if test="saleOrderCode != null and saleOrderCode != ''">and saleorder_code = #{saleOrderCode}</if>
<if test="saleOrderLineNumber != null and saleOrderLineNumber != ''">and saleorder_linenumber =
#{saleOrderLineNumber}
</if>
<if test="materialCode != null and materialCode != ''">and material_code = #{materialCode}</if>
<if test="materialName != null and materialName != ''">and material_name like concat(concat('%',
#{materialName}), '%')
</if>
<if test="matkl != null and matkl != ''">and matkl = #{matkl}</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="beginDate != null ">and begin_date = #{beginDate}</if>
<if test="endDate != null ">and end_date = #{endDate}</if>
<if test="factoryCode != null and factoryCode != ''">and factory_code = #{factoryCode}</if>
<if test="isFlag != null ">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>
<if test="completeDate != null ">and complete_date = #{completeDate}</if>
</where>
</select>
<select id="selectBaseOrderInfoByObjId" parameterType="Long" resultMap="BaseOrderInfoResult">
<include refid="selectBaseOrderInfoVo"/>
where obj_id = #{objId}
</select>
<insert id="insertBaseOrderInfo" parameterType="BaseOrderInfo">
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
SELECT seq_base_orderinfo.NEXTVAL as objId FROM DUAL
</selectKey>
insert into base_orderinfo
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="objId != null">obj_id,</if>
<if test="orderCode != null">order_code,</if>
<if test="saleOrderCode != null">saleorder_code,</if>
<if test="saleOrderLineNumber != null">saleorder_linenumber,</if>
<if test="materialCode != null">material_code,</if>
<if test="materialName != null">material_name,</if>
<if test="matkl != null">matkl,</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="beginDate != null">begin_date,</if>
<if test="endDate != null">end_date,</if>
<if test="factoryCode != null">factory_code,</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>
<if test="completeDate != null">complete_date,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="objId != null">#{objId},</if>
<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="orderAmount != null">#{orderAmount},</if>
<if test="completeAmount != null">#{completeAmount},</if>
<if test="orderType != null">#{orderType},</if>
<if test="orderStatus != null">#{orderStatus},</if>
<if test="beginDate != null">#{beginDate},</if>
<if test="endDate != null">#{endDate},</if>
<if test="factoryCode != null">#{factoryCode},</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>
<if test="completeDate != null">#{completeDate},</if>
</trim>
</insert>
<update id="updateBaseOrderInfo" parameterType="BaseOrderInfo">
update base_orderinfo
<trim prefix="SET" suffixOverrides=",">
<if test="orderCode != null">order_code = #{orderCode},</if>
<if test="saleOrderCode != null">saleorder_code = #{saleOrderCode},</if>
<if test="saleOrderLineNumber != null">saleorder_linenumber = #{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="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="beginDate != null">begin_date = #{beginDate},</if>
<if test="endDate != null">end_date = #{endDate},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</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>
<if test="completeDate != null">complete_date = #{completeDate},</if>
</trim>
where obj_id = #{objId}
</update>
<delete id="deleteBaseOrderInfoByObjId" parameterType="Long">
delete
from base_orderinfo
where obj_id = #{objId}
</delete>
<delete id="deleteBaseOrderInfoByObjIds" parameterType="String">
delete from base_orderinfo where obj_id in
<foreach item="objId" collection="array" open="(" separator="," close=")">
#{objId}
</foreach>
</delete>
</mapper>