| | |
| | | <result column="version" property="version"/> |
| | | <result column="locked_quantity" property="lockedQuantity"/> |
| | | <result column="warn_num" property="warnNum"/> |
| | | <result column="manufacturer_id" property="manufacturerId"/> |
| | | <result column="source" property="source"/> |
| | | <result column="supplier_id" property="supplierId"/> |
| | | </resultMap> |
| | | <update id="updateAddStockInventory"> |
| | | update stock_inventory |
| | |
| | | </if> |
| | | <if test="ew.source != null and ew.source != ''"> |
| | | source = #{ew.source}, |
| | | </if> |
| | | <if test="ew.manufacturerId != null"> |
| | | manufacturer_id = #{ew.manufacturerId}, |
| | | </if> |
| | | <if test="ew.supplierId != null"> |
| | | supplier_id = #{ew.supplierId}, |
| | | </if> |
| | | update_time = now() |
| | | </set> |
| | |
| | | si.update_time, |
| | | COALESCE(si.warn_num, 0) as warn_num, |
| | | si.version, |
| | | si.source, |
| | | si.manufacturer_id, |
| | | si.supplier_id, |
| | | (si.qualitity - COALESCE(si.locked_quantity, 0)) as un_locked_quantity, |
| | | pm.model, |
| | | si.remark, |
| | |
| | | MAX(update_time) as update_time, |
| | | MAX(warn_num) as warn_num, |
| | | MAX(version) as version, |
| | | MAX(supplier_id) as supplier_id, |
| | | model, |
| | | MAX(remark) as remark, |
| | | unit, |
| | |
| | | si.update_time, |
| | | COALESCE(si.warn_num, 0) as warn_num, |
| | | si.version, |
| | | si.supplier_id, |
| | | (si.qualitity - COALESCE(si.locked_quantity, 0)) as un_locked_quantity, |
| | | pm.model, |
| | | si.remark, |
| | |
| | | su.update_time, |
| | | 0 as warn_num, |
| | | su.version, |
| | | null as supplier_id, |
| | | (su.qualitity - COALESCE(su.locked_quantity, 0)) as un_locked_quantity, |
| | | pm.model, |
| | | su.remark, |
| | |
| | | product_name, |
| | | product_id, |
| | | MAX(manufacturer_id) as manufacturer_id, |
| | | MAX(supplier_id) as supplier_id, |
| | | MAX(manufacturer_name) as manufacturerName, |
| | | MAX(supplier_name) as supplierName, |
| | | MAX(qualifiedSource) as qualifiedSource, |
| | | MAX(unQualifiedSource) as unQualifiedSource, |
| | | |
| | |
| | | p.product_name, |
| | | p.id as product_id, |
| | | si.manufacturer_id, |
| | | si.supplier_id, |
| | | m.name as manufacturer_name, |
| | | sm.supplier_name as supplier_name, |
| | | si.source as qualifiedSource, |
| | | null as unQualifiedSource, |
| | | |
| | |
| | | left join product_model pm on si.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id |
| | | left join manufacturer m on si.manufacturer_id = m.id |
| | | left join supplier_manage sm on si.supplier_id = sm.id |
| | | |
| | | union all |
| | | |
| | |
| | | pm.unit, |
| | | p.product_name, |
| | | p.id as product_id, |
| | | su.manufacturer_id, |
| | | m.name as manufacturer_name, |
| | | null as manufacturer_id, |
| | | null as supplier_id, |
| | | null as manufacturer_name, |
| | | null as supplier_name, |
| | | null as qualifiedSource, |
| | | su.source as unQualifiedSource, |
| | | |
| | |
| | | from stock_uninventory su |
| | | left join product_model pm on su.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id |
| | | left join manufacturer m on su.manufacturer_id = m.id |
| | | ) as combined |
| | | <where> |
| | | <if test="ew.productModelId != null and ew.productModelId > 0"> |
| | |
| | | product_name, |
| | | product_id, |
| | | manufacturer_id, |
| | | manufacturer_name |
| | | supplier_id, |
| | | manufacturer_name, |
| | | supplier_name |
| | | order by |
| | | batch_no |
| | | </select> |