|  | @@ -255,7 +255,7 @@
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <select id="queryCostAllocation" resultType="org.jeecg.modules.documents.costLossReview.entity.CostAllocationReview">
 | 
	
		
			
				|  |  | -        select plan_num as planNum,first_approve_date as approvalDate,first_approve_by as approvalMan,create_time as createTime,
 | 
	
		
			
				|  |  | +        select a.plan_num as planNum,a.first_approve_date as approvalDate,b.assigned_by as approvalMan,a.create_time as createTime,
 | 
	
		
			
				|  |  |          cost_info ->> '$.poStyleNum'  AS poStyleNum,
 | 
	
		
			
				|  |  |          cost_info ->> '$.exportSales'  AS exportSales,
 | 
	
		
			
				|  |  |          cost_info ->> '$.garmentContractno'  AS garmentContractno,
 | 
	
	
		
			
				|  | @@ -284,62 +284,66 @@
 | 
	
		
			
				|  |  |          cost_info ->> '$.accidentcnyAmount'  AS accidentcnyAmount,
 | 
	
		
			
				|  |  |          cost_info ->> '$.accidentUsdamount'  AS accidentUsdamount,
 | 
	
		
			
				|  |  |          cost_info ->> '$.remarks'  AS remarks
 | 
	
		
			
				|  |  | -        from sy_cost_json
 | 
	
		
			
				|  |  | +        from sy_cost_json a
 | 
	
		
			
				|  |  | +        left join sy_cost_approval_history b on a.plan_num = b.plan_no
 | 
	
		
			
				|  |  |          where 1=1
 | 
	
		
			
				|  |  |          <if test="sy.createTime != null and sy.createTime !=''">
 | 
	
		
			
				|  |  | -            AND date_format( create_time, '%Y-%m-%d' )= date_format(#{sy.createTime},'%Y-%m-%d');
 | 
	
		
			
				|  |  | +            AND date_format( a.create_time, '%Y-%m-%d' )= date_format(#{sy.createTime},'%Y-%m-%d');
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  |          <if test="sy.approvalMan != null and sy.approvalMan !=''">
 | 
	
		
			
				|  |  | -            AND first_approve_by LIKE CONCAT('%',#{sy.approvalMan},'%')
 | 
	
		
			
				|  |  | +            AND b.assigned_by LIKE CONCAT('%',#{sy.approvalMan},'%')
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  |          <if test="sy.approvalDate != null and sy.approvalDate !=''">
 | 
	
		
			
				|  |  | -            AND first_approve_date LIKE CONCAT('%',#{sy.approvalDate},'%')
 | 
	
		
			
				|  |  | +            AND a.first_approve_date LIKE CONCAT('%',#{sy.approvalDate},'%')
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  |          <if test="sy.planNum != null and sy.planNum !=''">
 | 
	
		
			
				|  |  | -            AND plan_num LIKE CONCAT('%',#{sy.planNum},'%')
 | 
	
		
			
				|  |  | +            AND a.plan_num LIKE CONCAT('%',#{sy.planNum},'%')
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  |          <if test="sy.poStyleNum != null and sy.poStyleNum !=''">
 | 
	
		
			
				|  |  | -            AND JSON_EXTRACT( cost_info, '$.poStyleNum' ) = #{sy.poStyleNum}
 | 
	
		
			
				|  |  | +            AND JSON_EXTRACT( a.cost_info, '$.poStyleNum' ) like CONCAT('%',#{sy.poStyleNum},'%')
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  |          <if test="sy.exportSales != null and sy.exportSales !=''">
 | 
	
		
			
				|  |  | -            AND JSON_EXTRACT( cost_info, '$.exportSales' ) LIKE CONCAT('%',#{sy.exportSales},'%')
 | 
	
		
			
				|  |  | +            AND JSON_EXTRACT( a.cost_info, '$.exportSales' ) LIKE CONCAT('%',#{sy.exportSales},'%')
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  |          <if test="sy.garmentContractno != null and sy.garmentContractno !=''">
 | 
	
		
			
				|  |  | -            AND JSON_EXTRACT( cost_info, '$.garmentContractno' ) LIKE CONCAT('%',#{sy.garmentContractno},'%')
 | 
	
		
			
				|  |  | +            AND JSON_EXTRACT( a.cost_info, '$.garmentContractno' ) LIKE CONCAT('%',#{sy.garmentContractno},'%')
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  |          <if test="sy.department != null and sy.department !=''">
 | 
	
		
			
				|  |  | -            AND JSON_EXTRACT( cost_info, '$.department' ) = #{sy.department}
 | 
	
		
			
				|  |  | +            AND JSON_EXTRACT( a.cost_info, '$.department' ) = #{sy.department}
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  |          <if test="sy.customerShortame != null and sy.customerShortame !=''">
 | 
	
		
			
				|  |  | -            AND JSON_EXTRACT( cost_info, '$.customerShortame' ) = #{sy.customerShortame}
 | 
	
		
			
				|  |  | +            AND JSON_EXTRACT( a.cost_info, '$.customerShortame' ) like CONCAT('%',#{sy.customerShortame},'%')
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  |          <if test="sy.processUnit != null and sy.processUnit !=''">
 | 
	
		
			
				|  |  | -            AND JSON_EXTRACT( cost_info, '$.processUnit') = #{sy.processUnit}
 | 
	
		
			
				|  |  | +            AND JSON_EXTRACT( a.cost_info, '$.processUnit') like CONCAT('%',#{sy.processUnit},'%')
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  |          <if test="sy.outdata != null and sy.outdata !=''">
 | 
	
		
			
				|  |  | -            AND JSON_EXTRACT( cost_info, '$.outdata' ) = CONVERT(#{sy.outdata},UNSIGNED)
 | 
	
		
			
				|  |  | +            AND JSON_EXTRACT( a.cost_info, '$.outdata' ) = CONVERT(#{sy.outdata},UNSIGNED)
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          <if test="sy.planQuantity != null and sy.planQuantity !=''">
 | 
	
		
			
				|  |  | -            AND JSON_EXTRACT( cost_info, '$.planQuantity' ) = #{sy.planQuantity}
 | 
	
		
			
				|  |  | +            AND JSON_EXTRACT( a.cost_info, '$.planQuantity' ) = #{sy.planQuantity}
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  |          <if test="sy.actualShipquantity != null and sy.actualShipquantity !=''">
 | 
	
		
			
				|  |  | -            AND JSON_EXTRACT( cost_info, '$.actualShipquantity' ) = #{sy.actualShipquantity}
 | 
	
		
			
				|  |  | +            AND JSON_EXTRACT( a.cost_info, '$.actualShipquantity' ) = #{sy.actualShipquantity}
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  |          <if test="sy.shortseveral != null and sy.shortseveral !=''">
 | 
	
		
			
				|  |  | -            AND JSON_EXTRACT( cost_info, '$.shortseveral' ) = #{sy.shortseveral}
 | 
	
		
			
				|  |  | +            AND JSON_EXTRACT( a.cost_info, '$.shortseveral' ) = #{sy.shortseveral}
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  |          <if test="sy.shortvalue != null and sy.shortvalue !=''">
 | 
	
		
			
				|  |  | -            AND JSON_EXTRACT( cost_info, '$.shortvalue') = #{sy.shortvalue}
 | 
	
		
			
				|  |  | +            AND JSON_EXTRACT( a.cost_info, '$.shortvalue') = #{sy.shortvalue}
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  |          <if test="sy.fabricshortcost != null and sy.fabricshortcost !=''">
 | 
	
		
			
				|  |  | -            AND JSON_EXTRACT( cost_info, '$.fabricshortcost' ) = #{sy.fabricshortcost}
 | 
	
		
			
				|  |  | +            AND JSON_EXTRACT( a.cost_info, '$.fabricshortcost' ) = #{sy.fabricshortcost}
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  |          <if test="sy.preparedBy != null and sy.preparedBy !=''">
 | 
	
		
			
				|  |  | -            AND JSON_EXTRACT( cost_info, '$.preparedBy' ) LIKE CONCAT('%',#{sy.preparedBy},'%')
 | 
	
		
			
				|  |  | +            AND JSON_EXTRACT( a.cost_info, '$.preparedBy' ) LIKE CONCAT('%',#{sy.preparedBy},'%')
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  |          <if test='sy.rejectDate != null and sy.rejectDate !="" and sy.rejectDate == "1"'>
 | 
	
		
			
				|  |  | -            AND JSON_EXTRACT( cost_info, '$.rejectDate' ) is not null
 | 
	
		
			
				|  |  | +            AND b.stuta = '驳回'
 | 
	
		
			
				|  |  | +        </if>
 | 
	
		
			
				|  |  | +        <if test="sy.status != null and sy.status !=''">
 | 
	
		
			
				|  |  | +            AND a.status = #{sy.status}
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      </select>
 |