You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.3 KiB
39 lines
1.3 KiB
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
<mapper namespace="com.thing.carbontrack.bom.mapper.IotCarbonBomMapper">
|
|
|
|
<select id="queryBomCarbonByMid" resultType="com.thing.carbontrack.bom.dto.BomCarbonReq">
|
|
SELECT SUM
|
|
( transport_use ) AS transport_use,
|
|
SUM
|
|
( mu_final_use ) AS mu_final_use
|
|
FROM
|
|
iot_carbon_bom
|
|
where product_id = #{productId}
|
|
</select>
|
|
|
|
|
|
<select id="listByProductId" resultType="com.thing.carbontrack.productionResult.dto.MptDetail">
|
|
SELECT
|
|
aa.m_type as materialType,
|
|
aa.mcode as materialCode,
|
|
aa.mname as materialName,
|
|
aa.unit,
|
|
aa.dosage as dosage,
|
|
aa.weight,
|
|
aa.w_unit as wwunit ,
|
|
aa.mu_final_use as acquireCarbon,
|
|
aa.supplier_name,
|
|
aa.supplier_address,
|
|
cc.name as transportType,
|
|
aa.transport_km,
|
|
aa.transport_use
|
|
FROM
|
|
iot_carbon_bom as aa
|
|
LEFT JOIN iot_carbon_ratio as bb on aa.cr_id = bb.id
|
|
LEFT JOIN iot_carbon_energy_variety as cc on bb.ev_id = cc.id
|
|
WHERE
|
|
product_id = #{productId}
|
|
</select>
|
|
</mapper>
|