|
|
|
@ -13,6 +13,7 @@
|
|
|
|
|
<result property="materialCode" column="material_code"/>
|
|
|
|
|
<result property="materialName" column="material_name"/>
|
|
|
|
|
<result property="productLineCode" column="productline_code"/>
|
|
|
|
|
<result property="productLineName" column="productLineName"/>
|
|
|
|
|
<result property="planAmount" column="plan_amount"/>
|
|
|
|
|
<result property="completeAmount" column="complete_amount"/>
|
|
|
|
|
<result property="beginTime" column="begin_time"/>
|
|
|
|
@ -25,62 +26,65 @@
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectProductPlanInfoVo">
|
|
|
|
|
select obj_id,
|
|
|
|
|
plan_code,
|
|
|
|
|
order_code,
|
|
|
|
|
saleorder_code,
|
|
|
|
|
saleorder_linenumber,
|
|
|
|
|
material_code,
|
|
|
|
|
material_name,
|
|
|
|
|
productline_code,
|
|
|
|
|
plan_amount,
|
|
|
|
|
complete_amount,
|
|
|
|
|
begin_time,
|
|
|
|
|
end_time,
|
|
|
|
|
is_flag,
|
|
|
|
|
created_by,
|
|
|
|
|
created_time,
|
|
|
|
|
updated_by,
|
|
|
|
|
updated_time
|
|
|
|
|
from product_planinfo
|
|
|
|
|
select pp.obj_id,
|
|
|
|
|
pp.plan_code,
|
|
|
|
|
pp.order_code,
|
|
|
|
|
pp.saleorder_code,
|
|
|
|
|
pp.saleorder_linenumber,
|
|
|
|
|
pp.material_code,
|
|
|
|
|
pp.material_name,
|
|
|
|
|
pp.productline_code,
|
|
|
|
|
pl.PRODUCT_LINE_NAME productLineName,
|
|
|
|
|
pp.plan_amount,
|
|
|
|
|
pp.complete_amount,
|
|
|
|
|
pp.begin_time,
|
|
|
|
|
pp.end_time,
|
|
|
|
|
pp.is_flag,
|
|
|
|
|
pp.created_by,
|
|
|
|
|
pp.created_time,
|
|
|
|
|
pp.updated_by,
|
|
|
|
|
pp.updated_time
|
|
|
|
|
from product_planinfo pp
|
|
|
|
|
left join BASE_PRODUCTLINE pl on pl.PRODUCT_LINE_CODE = pp.productline_code
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectProductPlanInfoList" parameterType="ProductPlanInfo" resultMap="ProductPlanInfoResult">
|
|
|
|
|
<include refid="selectProductPlanInfoVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="planCode != null and planCode != ''">and plan_code like concat(concat('%', #{planCode}), '%')
|
|
|
|
|
<if test="planCode != null and planCode != ''">and pp.plan_code like concat(concat('%', #{planCode}), '%')
|
|
|
|
|
</if>
|
|
|
|
|
<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 =
|
|
|
|
|
<if test="orderCode != null and orderCode != ''">and pp.order_code = #{orderCode}</if>
|
|
|
|
|
<if test="saleOrderCode != null and saleOrderCode != ''">and pp.saleorder_code = #{saleOrderCode}</if>
|
|
|
|
|
<if test="saleorderLinenumber != null and saleorderLinenumber != ''">and pp.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('%',
|
|
|
|
|
<if test="materialCode != null and materialCode != ''">and pp.material_code = #{materialCode}</if>
|
|
|
|
|
<if test="materialName != null and materialName != ''">and pp.material_name like concat(concat('%',
|
|
|
|
|
#{materialName}), '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="productLineCode != null and productLineCode != ''">and productline_code = #{productLineCode}</if>
|
|
|
|
|
<if test="planAmount != null ">and plan_amount = #{planAmount}</if>
|
|
|
|
|
<if test="completeAmount != null ">and complete_amount = #{completeAmount}</if>
|
|
|
|
|
<if test="productLineCode != null and productLineCode != ''">and pp.productline_code = #{productLineCode}</if>
|
|
|
|
|
<if test="planAmount != null ">and pp.plan_amount = #{planAmount}</if>
|
|
|
|
|
<if test="completeAmount != null ">and pp.complete_amount = #{completeAmount}</if>
|
|
|
|
|
<if test="params.beginBeginTime != null and params.beginBeginTime != '' and params.endBeginTime != null and params.endBeginTime != ''">
|
|
|
|
|
and begin_time between to_date(#{params.beginBeginTime}, 'yyyy-mm-dd hh24:mi:ss') and
|
|
|
|
|
and pp.begin_time between to_date(#{params.beginBeginTime}, 'yyyy-mm-dd hh24:mi:ss') and
|
|
|
|
|
to_date(#{params.endBeginTime}, 'yyyy-mm-dd hh24:mi:ss')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="params.beginEndTime != null and params.beginEndTime != '' and params.endEndTime != null and params.endEndTime != ''">
|
|
|
|
|
and end_time between to_date(#{params.beginEndTime}, 'yyyy-mm-dd hh24:mi:ss') and
|
|
|
|
|
and pp.end_time between to_date(#{params.beginEndTime}, 'yyyy-mm-dd hh24:mi:ss') and
|
|
|
|
|
to_date(#{params.endEndTime}, 'yyyy-mm-dd hh24:mi:ss')
|
|
|
|
|
</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="isFlag != null ">and pp.is_flag = #{isFlag}</if>
|
|
|
|
|
<if test="createdBy != null and createdBy != ''">and pp.created_by = #{createdBy}</if>
|
|
|
|
|
<if test="createdTime != null ">and pp.created_time = #{createdTime}</if>
|
|
|
|
|
<if test="updatedBy != null and updatedBy != ''">and pp.updated_by = #{updatedBy}</if>
|
|
|
|
|
<if test="updatedTime != null ">and pp.updated_time = #{updatedTime}</if>
|
|
|
|
|
</where>
|
|
|
|
|
order by pp.plan_code desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectProductPlanInfoByObjId" parameterType="Long" resultMap="ProductPlanInfoResult">
|
|
|
|
|
<include refid="selectProductPlanInfoVo"/>
|
|
|
|
|
where obj_id = #{objId}
|
|
|
|
|
where pp.obj_id = #{objId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertProductPlanInfo" parameterType="ProductPlanInfo">
|
|
|
|
|