|
@@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<association property="processNames" column="id" select="getProcessNames"/>
|
|
<association property="processNames" column="id" select="getProcessNames"/>
|
|
<association property="receiptNum" column="id" select="getReceiptNum"/>
|
|
<association property="receiptNum" column="id" select="getReceiptNum"/>
|
|
<collection property="outsourcedOrderDetailProcessList" column="id" ofType="cn.ezhizao.project.business.domain.BizOutsourcedOrderDetailProcess" select="getOutsourcedOrderDetailProcessList"/>
|
|
<collection property="outsourcedOrderDetailProcessList" column="id" ofType="cn.ezhizao.project.business.domain.BizOutsourcedOrderDetailProcess" select="getOutsourcedOrderDetailProcessList"/>
|
|
|
|
+ <collection property="returnReceiptDetailList" column="id" ofType="cn.ezhizao.project.business.domain.BizReturnReceiptDetail" select="getReturnReceiptDetailList"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<select id="getList" parameterType="BizOutsourcedOrderDetail" resultMap="BizOutsourcedOrderDetailResult">
|
|
<select id="getList" parameterType="BizOutsourcedOrderDetail" resultMap="BizOutsourcedOrderDetailResult">
|
|
@@ -29,6 +30,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="newCarrierCount != null "> AND new_carrier_count = #{newCarrierCount}</if>
|
|
<if test="newCarrierCount != null "> AND new_carrier_count = #{newCarrierCount}</if>
|
|
</trim>
|
|
</trim>
|
|
</select>
|
|
</select>
|
|
|
|
+ <select id="getFinishedOutsourceDetailList" parameterType="BizOutsourcedOrderDetail" resultMap="BizOutsourcedOrderDetailResult">
|
|
|
|
+ SELECT distinct t1.id,t1.lot_code,t1.product_description,t1.original_carrier,t1.new_carrier,
|
|
|
|
+ (select form_date from biz_return_receipt_detail where biz_return_receipt_detail.outsource_detail_id = t1.id and biz_return_receipt_detail.deleted = 0 and t1.deleted = 0 limit 1) as form_date
|
|
|
|
+ FROM biz_outsourced_order_detail t1 left join biz_outsourced_order_detail_process t2 on t1.id = t2.detail_id
|
|
|
|
+ <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
|
|
|
|
+ t1.deleted = 0 and t2.status = 1
|
|
|
|
+ <if test="formCode != null and formCode != ''"> AND t1.form_code = #{formCode}</if>
|
|
|
|
+ <if test="startTime != null "> AND (
|
|
|
|
+ SELECT brrd.form_date
|
|
|
|
+ FROM biz_return_receipt_detail brrd
|
|
|
|
+ WHERE brrd.outsource_detail_id = t1.id
|
|
|
|
+ AND brrd.deleted = 0
|
|
|
|
+ AND t1.deleted = 0
|
|
|
|
+ LIMIT 1
|
|
|
|
+ ) > #{startTime}</if>
|
|
|
|
+ <if test="endTime != null "> AND (
|
|
|
|
+ SELECT brrd.form_date
|
|
|
|
+ FROM biz_return_receipt_detail brrd
|
|
|
|
+ WHERE brrd.outsource_detail_id = t1.id
|
|
|
|
+ AND brrd.deleted = 0
|
|
|
|
+ AND t1.deleted = 0
|
|
|
|
+ LIMIT 1
|
|
|
|
+ ) < #{endTime}</if>
|
|
|
|
+ <if test="notFinishedDetailIds != null and notFinishedDetailIds.size > 0">
|
|
|
|
+ AND t1.id NOT IN
|
|
|
|
+ <foreach collection="notFinishedDetailIds" index="index" item="id" separator="," open="(" close=")">
|
|
|
|
+ #{id,jdbcType=BIGINT}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="supplierName != null and supplierName != ''"> AND t1.supplier_name like concat('%', #{supplierName}, '%')</if>
|
|
|
|
+ <if test="deliveryMethod != null "> AND t1.delivery_method = #{deliveryMethod}</if>
|
|
|
|
+ <if test="packagingMethod != null and packagingMethod != ''"> AND t1.packaging_method = #{packagingMethod}</if>
|
|
|
|
+ <if test="productDescription != null and productDescription != ''"> AND t1.product_description = #{productDescription}</if>
|
|
|
|
+ <if test="technologyVersion != null and technologyVersion != ''"> AND t1.technology_version = #{technologyVersion}</if>
|
|
|
|
+ <if test="originalCarrier != null and originalCarrier != ''"> AND t1.original_carrier = #{originalCarrier}</if>
|
|
|
|
+ <if test="originalCarrierCount != null "> AND t1.original_carrier_count = #{originalCarrierCount}</if>
|
|
|
|
+ <if test="newCarrier != null and newCarrier != ''"> AND t1.new_carrier = #{newCarrier}</if>
|
|
|
|
+ <if test="newCarrierCount != null "> AND t1.new_carrier_count = #{newCarrierCount}</if>
|
|
|
|
+ </trim>
|
|
|
|
+ order by t1.create_time desc
|
|
|
|
+ </select>
|
|
<select id="getOutsourcedOrderDetailProcessList" resultType="cn.ezhizao.project.business.domain.BizOutsourcedOrderDetailProcess">
|
|
<select id="getOutsourcedOrderDetailProcessList" resultType="cn.ezhizao.project.business.domain.BizOutsourcedOrderDetailProcess">
|
|
select * from biz_outsourced_order_detail_process
|
|
select * from biz_outsourced_order_detail_process
|
|
<trim prefix=" WHERE" suffix="" suffixOverrides="AND">
|
|
<trim prefix=" WHERE" suffix="" suffixOverrides="AND">
|
|
@@ -37,6 +79,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
</trim>
|
|
</trim>
|
|
order by process_step_number
|
|
order by process_step_number
|
|
</select>
|
|
</select>
|
|
|
|
+ <select id="getReturnReceiptDetailList" resultType="cn.ezhizao.project.business.domain.BizReturnReceiptDetail">
|
|
|
|
+ select * from biz_return_receipt_detail
|
|
|
|
+ <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
|
|
|
|
+ deleted = 0
|
|
|
|
+ <if test="id != null"> AND outsource_detail_id = #{id}</if>
|
|
|
|
+ </trim>
|
|
|
|
+ order by process_step_number
|
|
|
|
+ </select>
|
|
|
|
+
|
|
<select id="getProcessNames" resultType="String">
|
|
<select id="getProcessNames" resultType="String">
|
|
SELECT
|
|
SELECT
|
|
GROUP_CONCAT(t.process_alias)
|
|
GROUP_CONCAT(t.process_alias)
|