@ -142,7 +142,9 @@
<!-- 备注 -->
bmc.remarks,
<!-- 创建组织名称 -->
bmc.createOrg
bmc.createOrg,
<!-- 配置编码 -->
bmc.configCode
FROM base_model_config bmc
<where >
${ew.sqlSegment}
@ -174,7 +176,7 @@
<select id= "selectDown" resultType= "com.yxt.anrui.base.api.basemodelconfig.BaseVehicleModelConfigDownVo" >
SELECT bmc.sid<!-- , bmc.vehicleCode -->
FROM base_model_config bmc
${ew.customSqlSegment}
${ew.customSqlSegment}
</select>
<select id= "getAppChooseListByModelSid"
@ -192,7 +194,7 @@
bmc.otherConfig,
bmc.remarks
FROM base_model_config bmc
${ew.customSqlSegment}
${ew.customSqlSegment}
</select>
<select id= "selectAppConfigListByModelSid"
@ -223,8 +225,8 @@
bmc.multimedia,
bv.guidedPrice
FROM base_vehicle bv
LEFT JOIN base_model_config bmc ON bv.modelConfigSid = bmc.sid
LEFT JOIN base_vehicle_model bvm ON bv.modelSid = bvm.sid
LEFT JOIN base_model_config bmc ON bv.modelConfigSid = bmc.sid
LEFT JOIN base_vehicle_model bvm ON bv.modelSid = bvm.sid
WHERE bvm.sid = #{modelSid}
</select>
<select id= "selectAppConfigListByModelSid2"
@ -258,16 +260,16 @@
FROM base_vehmodel_config bvc
WHERE bvc.configurationItemsSid = bmc.sid) AS priceValidity
FROM base_vehmodel_config bvc
LEFT JOIN base_model_config bmc ON bvc.configurationItemsSid = bmc.sid
LEFT JOIN base_vehicle_model bvm ON bvc.modelSid = bvm.sid
LEFT JOIN base_model_config bmc ON bvc.configurationItemsSid = bmc.sid
LEFT JOIN base_vehicle_model bvm ON bvc.modelSid = bvm.sid
WHERE bvm.sid = #{modelSid}
</select>
<select id= "selectVehicleQuantity" resultType= "java.lang.String" >
SELECT count(*)
FROM base_model_config bmc
LEFT JOIN base_vehmodel_config bvc ON bvc.configurationItemsSid = bmc.sid
LEFT JOIN base_vehicle_model bvm ON bvc.modelSid = bvm.sid
LEFT JOIN base_vehmodel_config bvc ON bvc.configurationItemsSid = bmc.sid
LEFT JOIN base_vehicle_model bvm ON bvc.modelSid = bvm.sid
WHERE bmc.sid = #{sid}
AND bvm.sid = #{modelSid}
</select>
@ -295,8 +297,8 @@
bmc.multimedia,
bmc.otherConfig
FROM base_vehmodel_config bvc
LEFT JOIN base_model_config bmc ON bmc.sid = bvc.configurationItemsSid
LEFT JOIN base_vehicle_model bvm ON bvm.sid = bvc.modelSid
LEFT JOIN base_model_config bmc ON bmc.sid = bvc.configurationItemsSid
LEFT JOIN base_vehicle_model bvm ON bvm.sid = bvc.modelSid
WHERE bvc.modelSid = #{modelSid}
AND bvc.configurationItemsSid = #{configSid}
AND bvc.useOrgSid = #{useOrg}
@ -443,10 +445,10 @@
<!-- 更多配置 -->
bc.otherConfig
from base_model_config bc
left join base_vehmodel_config bv on bv.configurationItemsSid = bc.sid
left join base_vehicle_model bm on bm.sid = bv.modelSid
left join base_vehmodel_config bv on bv.configurationItemsSid = bc.sid
left join base_vehicle_model bm on bm.sid = bv.modelSid
where bc.sid = #{sid}
and bm.sid = #{modelSid}
and bm.sid = #{modelSid}
</select>
<select id= "getAppProductionSchedulingDetailsVo"
resultType="com.yxt.anrui.base.api.basemodelconfig.AppModelConfigDetailsVo">
@ -471,17 +473,19 @@
bmc.multimedia,
bmc.otherConfig
FROM bus_vehicle_apply_detail bvad
LEFT JOIN base_model_config bmc ON bmc.sid = bvad.configSid
LEFT JOIN base_vehicle_model bvm ON bvm.sid = bvad.vehicleSid
LEFT JOIN base_model_config bmc ON bmc.sid = bvad.configSid
LEFT JOIN base_vehicle_model bvm ON bvm.sid = bvad.vehicleSid
WHERE bmc.sid = #{configSid}
AND bvm.sid = #{modelSid}
</select>
<select id= "getModelConfigList" resultType= "com.yxt.anrui.base.api.basemodelconfig.ModelConfigVo" >
SELECT bvm.vehicleAlias AS modelName,
SELECT bvm.vehicleAlias AS modelName,
bvm.brandName,
bvm.vehicleVersionValue,
if(MIN(bvc.guidedPrice)=MAX(bvc.guidedPrice),convert(MAX(bvc.guidedPrice)/10000,decimal(10,2)),CONCAT(convert(MIN(bvc.guidedPrice)/10000,decimal(10,2)), '-', convert(MAX(bvc.guidedPrice)/10000,decimal(10,2)))) AS price,
if(MIN(bvc.guidedPrice) = MAX(bvc.guidedPrice), convert(MAX(bvc.guidedPrice) / 10000, decimal (10, 2)),
CONCAT(convert(MIN(bvc.guidedPrice) / 10000, decimal (10, 2)), '-',
convert(MAX(bvc.guidedPrice) / 10000, decimal (10, 2)))) AS price,
bvm.vehicleTypeValue,
bvm.productLineValue,
bvm.powerValue,
@ -496,51 +500,53 @@
bvm.specifications,
bvm.insideCode
FROM base_vehicle_model bvm
LEFT JOIN base_vehmodel_config bvc ON bvc.modelSid = bvm.sid
LEFT JOIN base_vehmodel_config bvc ON bvc.modelSid = bvm.sid
where bvm.sid = #{modelSid}
and bvc.useOrgSid = #{useOrgSid}
</select>
<select id= "getModelConfigPageList"
resultType="com.yxt.anrui.base.api.basemodelconfig.AppModelConfigListVo">
SELECT bmc.sid as configSid,
bmc.carColor,
bmc.slowMachine,
bmc.rearViewMirror,
bmc.tireSize,
bmc.specification,
bmc.rearAxleRatio,
bmc.airConditioner,
bmc.hubMaterial,
bmc.baffleModel,
bmc.suspension,
bmc.seat,
bmc.tireCover,
bmc.saddle,
bmc.wheelbase,
bmc.bumper,
bmc.configuringBao,
bmc.independentSources,
bmc.fuelTank,
bmc.multimedia,
convert(bvc.guidedPrice/10000,decimal(10,2)) as price,
bvc.priceValidity,
bvm.sid as modelSid,
bvm.vehicleAlias as modelName,
bvm.brandName as brand,
bvm.carBrand as brandSid,
(SELECT count(*)
FROM base_vehicle bv
WHERE bv.modelSid = bvc.modelSid
AND bv.modelConfigSid = bvc.configurationItemsSid
AND bv.lockedState = #{lockedStateKey}
and bv.useOrgSid = #{orgSid}) AS nowCarNum,
(select SUM(distinct cast((cast(bo.platformNo as signed)-IFNULL(cast(bo.lockingNum as signed),'0')) as signed)) as quantity from bus_vehicle_order bo
SELECT bmc.sid as configSid,
bmc.carColor,
bmc.slowMachine,
bmc.rearViewMirror,
bmc.tireSize,
bmc.specification,
bmc.rearAxleRatio,
bmc.airConditioner,
bmc.hubMaterial,
bmc.baffleModel,
bmc.suspension,
bmc.seat,
bmc.tireCover,
bmc.saddle,
bmc.wheelbase,
bmc.bumper,
bmc.configuringBao,
bmc.independentSources,
bmc.fuelTank,
bmc.multimedia,
convert(bvc.guidedPrice/10000,decimal(10,2)) as price,
bvc.priceValidity,
bvm.sid as modelSid,
bvm.vehicleAlias as modelName,
bvm.brandName as brand,
bvm.carBrand as brandSid,
(SELECT count(*)
FROM base_vehicle bv
WHERE bv.modelSid = bvc.modelSid
AND bv.modelConfigSid = bvc.configurationItemsSid
AND bv.lockedState = #{lockedStateKey}
and bv.useOrgSid = #{orgSid}) AS nowCarNum,
(select SUM(distinct cast((cast(bo.platformNo as signed)-IFNULL(cast(bo.lockingNum as signed),'0')) as signed))
as quantity from bus_vehicle_order bo
LEFT JOIN bus_vehicle_apply_detail bd on bo.purchaseRequisitionSid = bd.applySid
where bo.useOrgSid =#{orgSid} and bd.vehicleSid = bvc.modelSid and bd.configSid = bvc.configurationItemsSid) AS produceCarNum
where bo.useOrgSid =#{orgSid} and bd.vehicleSid = bvc.modelSid and bd.configSid = bvc.configurationItemsSid) AS
produceCarNum
FROM base_vehmodel_config bvc
LEFT JOIN base_model_config bmc ON bvc.configurationItemsSid = bmc.sid
LEFT JOIN base_vehicle_model bvm ON bvc.modelSid = bvm.sid
LEFT JOIN base_model_config bmc ON bvc.configurationItemsSid = bmc.sid
LEFT JOIN base_vehicle_model bvm ON bvc.modelSid = bvm.sid
<where >
${ew.sqlSegment}
<if test= "orgSid != null and orgSid != ''" >
@ -556,10 +562,14 @@
WHERE bv.modelSid = #{modelSid}
and bv.modelConfigSid = #{configSid}
AND bv.lockedState = #{state}
and bv.useOrgSid = bvc.useOrgSid) AS nowCarNum,
(select SUM(distinct cast((cast(bo.platformNo as signed)-IFNULL(cast(bo.lockingNum as signed),'0')) as signed)) as quantity from bus_vehicle_order bo
LEFT JOIN bus_vehicle_apply_detail bd on bo.purchaseRequisitionSid = bd.applySid
where bo.useOrgSid =bvc.useOrgSid and bd.vehicleSid = #{modelSid} and bd.configSid = #{configSid}) AS produceCarNum
and bv.useOrgSid = bvc.useOrgSid) AS nowCarNum,
(select SUM(distinct cast((cast(bo.platformNo as signed) -
IFNULL(cast(bo.lockingNum as signed), '0')) as signed)) as quantity
from bus_vehicle_order bo
LEFT JOIN bus_vehicle_apply_detail bd on bo.purchaseRequisitionSid = bd.applySid
where bo.useOrgSid = bvc.useOrgSid
and bd.vehicleSid = #{modelSid}
and bd.configSid = #{configSid}) AS produceCarNum
FROM base_vehmodel_config bvc
WHERE bvc.modelSid = #{modelSid}
AND bvc.configurationItemsSid = #{configSid}
@ -593,51 +603,53 @@
-- bv.salePrice as price,
bmc.otherConfig
FROM base_vehicle bv
LEFT JOIN base_model_config bmc ON bv.modelConfigSid = bmc.sid
LEFT JOIN base_vehicle_model bvm ON bv.modelSid = bvm.sid
LEFT JOIN base_model_config bmc ON bv.modelConfigSid = bmc.sid
LEFT JOIN base_vehicle_model bvm ON bv.modelSid = bvm.sid
WHERE bvm.sid = #{modelSid}
AND bmc.sid = #{configSid}
</select>
<select id= "getNowConfigList" resultType= "com.yxt.anrui.base.api.basemodelconfig.AppModelConfigListVo" >
SELECT bmc.sid as configSid,
bmc.carColor,
bmc.slowMachine,
bmc.rearViewMirror,
bmc.tireSize,
bmc.specification,
bmc.rearAxleRatio,
bmc.airConditioner,
bmc.hubMaterial,
bmc.baffleModel,
bmc.suspension,
bmc.seat,
bmc.tireCover,
bmc.saddle,
bmc.wheelbase,
bmc.bumper,
bmc.configuringBao,
bmc.independentSources,
bmc.fuelTank,
bmc.multimedia,
bvc.guidedPrice as price,
bvc.priceValidity,
bvm.sid as modelSid,
bvm.vehicleAlias as modelName,
bvm.brandName as brand,
bvm.carBrand as brandSid,
(SELECT
count(*)
FROM base_vehicle bv
WHERE bv.modelSid = bvc.modelSid
AND bv.modelConfigSid = bvc.configurationItemsSid
AND bv.lockedState = #{state}
and bv.useOrgSid = #{orgSid}) AS nowCarNum,
(select SUM(distinct cast((cast(bo.platformNo as signed)-IFNULL(cast(bo.lockingNum as signed),'0')) as signed)) as quantity from bus_vehicle_order bo
SELECT bmc.sid as configSid,
bmc.carColor,
bmc.slowMachine,
bmc.rearViewMirror,
bmc.tireSize,
bmc.specification,
bmc.rearAxleRatio,
bmc.airConditioner,
bmc.hubMaterial,
bmc.baffleModel,
bmc.suspension,
bmc.seat,
bmc.tireCover,
bmc.saddle,
bmc.wheelbase,
bmc.bumper,
bmc.configuringBao,
bmc.independentSources,
bmc.fuelTank,
bmc.multimedia,
bvc.guidedPrice as price,
bvc.priceValidity,
bvm.sid as modelSid,
bvm.vehicleAlias as modelName,
bvm.brandName as brand,
bvm.carBrand as brandSid,
(SELECT
count(*)
FROM base_vehicle bv
WHERE bv.modelSid = bvc.modelSid
AND bv.modelConfigSid = bvc.configurationItemsSid
AND bv.lockedState = #{state}
and bv.useOrgSid = #{orgSid}) AS nowCarNum,
(select SUM(distinct cast((cast(bo.platformNo as signed)-IFNULL(cast(bo.lockingNum as signed),'0')) as signed))
as quantity from bus_vehicle_order bo
LEFT JOIN bus_vehicle_apply_detail bd on bo.purchaseRequisitionSid = bd.applySid
where bo.useOrgSid =#{orgSid} and bd.vehicleSid = bvc.modelSid and bd.configSid = bvc.configurationItemsSid) AS produceCarNum
where bo.useOrgSid =#{orgSid} and bd.vehicleSid = bvc.modelSid and bd.configSid = bvc.configurationItemsSid) AS
produceCarNum
FROM base_vehmodel_config bvc
LEFT JOIN base_model_config bmc ON bvc.configurationItemsSid = bmc.sid
LEFT JOIN base_vehicle_model bvm ON bvc.modelSid = bvm.sid
LEFT JOIN base_model_config bmc ON bvc.configurationItemsSid = bmc.sid
LEFT JOIN base_vehicle_model bvm ON bvc.modelSid = bvm.sid
<where >
${ew.sqlSegment}
<if test= "orgSid != null and orgSid != ''" >
@ -658,7 +670,7 @@
ORDER BY
nowCarNum DESC
nowCarNum DESC
</select>
<select id= "checkByConfigName" resultType= "int" >
@ -677,46 +689,48 @@
</select>
<select id= "getPcModelConfigList" resultType= "com.yxt.anrui.base.api.basemodelconfig.AppModelConfigListVo" >
SELECT bmc.sid as configSid,
bmc.carColor,
bmc.slowMachine,
bmc.rearViewMirror,
bmc.tireSize,
bmc.specification,
bmc.rearAxleRatio,
bmc.airConditioner,
bmc.hubMaterial,
bmc.baffleModel,
bmc.suspension,
bmc.seat,
bmc.tireCover,
bmc.saddle,
bmc.wheelbase,
bmc.bumper,
bmc.configuringBao,
bmc.independentSources,
bmc.fuelTank,
bmc.multimedia,
convert(bvc.guidedPrice/10000,decimal(10,2)) as price,
bvc.priceValidity,
bvc.manufactorSettlementPrice,
bvm.sid as modelSid,
bvm.vehicleAlias as modelName,
bvm.brandName as brand,
bvm.carBrand as brandSid,
bvc.sid vehModelConfigSid,
(SELECT count(*)
FROM base_vehicle bv
WHERE bv.modelSid = bvc.modelSid
AND bv.modelConfigSid = bvc.configurationItemsSid
AND bv.lockedState = #{lockedStateKey}
and bv.useOrgSid = #{orgSid}) AS nowCarNum,
(select SUM(distinct cast((cast(bo.platformNo as signed)-IFNULL(cast(bo.lockingNum as signed),'0')) as signed)) as quantity from bus_vehicle_order bo
SELECT bmc.sid as configSid,
bmc.carColor,
bmc.slowMachine,
bmc.rearViewMirror,
bmc.tireSize,
bmc.specification,
bmc.rearAxleRatio,
bmc.airConditioner,
bmc.hubMaterial,
bmc.baffleModel,
bmc.suspension,
bmc.seat,
bmc.tireCover,
bmc.saddle,
bmc.wheelbase,
bmc.bumper,
bmc.configuringBao,
bmc.independentSources,
bmc.fuelTank,
bmc.multimedia,
convert(bvc.guidedPrice/10000,decimal(10,2)) as price,
bvc.priceValidity,
bvc.manufactorSettlementPrice,
bvm.sid as modelSid,
bvm.vehicleAlias as modelName,
bvm.brandName as brand,
bvm.carBrand as brandSid,
bvc.sid vehModelConfigSid,
(SELECT count(*)
FROM base_vehicle bv
WHERE bv.modelSid = bvc.modelSid
AND bv.modelConfigSid = bvc.configurationItemsSid
AND bv.lockedState = #{lockedStateKey}
and bv.useOrgSid = #{orgSid}) AS nowCarNum,
(select SUM(distinct cast((cast(bo.platformNo as signed)-IFNULL(cast(bo.lockingNum as signed),'0')) as signed))
as quantity from bus_vehicle_order bo
LEFT JOIN bus_vehicle_apply_detail bd on bo.purchaseRequisitionSid = bd.applySid
where bo.useOrgSid =#{orgSid} and bd.vehicleSid = bvc.modelSid and bd.configSid = bvc.configurationItemsSid) AS produceCarNum
where bo.useOrgSid =#{orgSid} and bd.vehicleSid = bvc.modelSid and bd.configSid = bvc.configurationItemsSid) AS
produceCarNum
FROM base_vehmodel_config bvc
LEFT JOIN base_model_config bmc ON bvc.configurationItemsSid = bmc.sid
LEFT JOIN base_vehicle_model bvm ON bvc.modelSid = bvm.sid
LEFT JOIN base_model_config bmc ON bvc.configurationItemsSid = bmc.sid
LEFT JOIN base_vehicle_model bvm ON bvc.modelSid = bvm.sid
<where >
${ew.sqlSegment}
<if test= "orgSid != null and orgSid != ''" >
@ -727,9 +741,13 @@
</select>
<select id= "fetchConfigName" resultType= "java.lang.String" >
SELECT
CONCAT(configName,otherConfig) configName
FROM base_model_config
SELECT CONCAT(configName, otherConfig) configName
FROM base_model_config
WHERE createOrgSId = #{createOrgSid}
</select>
<select id= "selectCount" resultType= "int" >
SELECT IFNULL(MAX(configCode),0) CODE
FROM base_model_config
</select>
</mapper>