|
@@ -60,12 +60,22 @@
|
|
|
from supply_stock_out a
|
|
|
left join material_library ml on ml.material_code = a.material_number
|
|
|
<where>
|
|
|
- <if test="projectDefinitionList.size>0">
|
|
|
- and a.project_definition in
|
|
|
- <foreach collection="projectDefinitionList" item="projectDefinition" index="index" open="(" separator="," close=")">
|
|
|
- #{projectDefinition}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
+ <choose>
|
|
|
+ <when test="null != submittalsId and '' != submittalsId">
|
|
|
+ and a.project_definition in (select project_definition from supply_stock_out where submittals_id = #{submittalsId} )
|
|
|
+ and (a.submittals_id is null or a.submittals_id = '')
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ <if test="projectDefinitionList.size>0">
|
|
|
+ and a.project_definition in
|
|
|
+ <foreach collection="projectDefinitionList" item="projectDefinition" index="index" open="(" separator="," close=")">
|
|
|
+ #{projectDefinition}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ and (a.submittals_id is null or a.submittals_id = '')
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+
|
|
|
</where>
|
|
|
order by a.project_definition asc,a.actual_quantity_issued desc,a.posting_account_date asc
|
|
|
</select>
|