50 lines
3.3 KiB
Java
50 lines
3.3 KiB
Java
|
package com.ruoyi.quote.mapper;
|
||
|
|
||
|
import com.ruoyi.quote.domain.MaterialDto;
|
||
|
import org.apache.ibatis.annotations.Mapper;
|
||
|
import org.apache.ibatis.annotations.Param;
|
||
|
import org.apache.ibatis.annotations.Select;
|
||
|
|
||
|
import java.util.List;
|
||
|
|
||
|
/**
|
||
|
* @ClassName QuoteMapper
|
||
|
* @Description TODO
|
||
|
* @Author JIAL
|
||
|
* @Date 2024/3/5 16:07
|
||
|
* @Version 1.0
|
||
|
*/
|
||
|
@Mapper
|
||
|
public interface QuoteMapper {
|
||
|
|
||
|
@Select("select a.material_id AS uid, a.material_xingh AS model,a.material_guig AS specification,a.material_diany AS voltLevel,a.material_dw AS measureUnit,c.type_name AS prodCategory,\n" +
|
||
|
"b.price matCostPrice, d.factory_total_ratio/100 manuCost,d.factory_pj_ratio/100 wdFSurcharge,\n" +
|
||
|
"cc.红本价格 AS redBookPrice,cc.红本价格*0.8 rbFacPrice,dd.成本价格 AS redBookCost\n" +
|
||
|
"from c_material a \n" +
|
||
|
"left join \n" +
|
||
|
"(select a.cost_material_id,sum((isnull(a.cost_cl_qty,0)+isnull(a.cost_cl_qty_2,0))*b.material_price) price from c_material_cost a\n" +
|
||
|
"left join c_yl_material b on a.cost_cl_id=b.material_no\n" +
|
||
|
"group by a.cost_material_id\n" +
|
||
|
")b on a.material_id=b.cost_material_id\n" +
|
||
|
"left join c_material_type_factory c on a.material_type_id = c.type_no\n" +
|
||
|
"left join c_factory d on d.factory_no = c.factory_id\n" +
|
||
|
"left join(select 型号,规格,电压等级,红本价格 from [REDBOOK].[RedBook].[dbo].rb_product_price \n" +
|
||
|
" where version_uid_0 = (select max(version_uid_0) from [REDBOOK].[RedBook].[dbo].rb_product_price a\n" +
|
||
|
" left join [REDBOOK].[RedBook].[dbo].rb_productVersion b on b.uid_0 = a.version_uid_0\n" +
|
||
|
" where b.tong_price_0 ='70') and 型号 like '$%{vagueMaterialName}%' \n" +
|
||
|
")as cc on cc.型号=a.material_xingh collate Chinese_PRC_CI_AS and cc.规格 = a.material_guig collate Chinese_PRC_CI_AS \n" +
|
||
|
"and cc.电压等级 = a.material_diany collate Chinese_PRC_CI_AS\n" +
|
||
|
"\n" +
|
||
|
"left join(select 型号,规格,电压等级,成本价格 from [REDBOOK].[RedBook].[dbo].rb_productbase_price \n" +
|
||
|
" where version_uid_0 = (select max(version_uid_0) from [REDBOOK].[RedBook].[dbo].rb_product_price a\n" +
|
||
|
" left join [REDBOOK].[RedBook].[dbo].rb_productVersion b on b.uid_0 = a.version_uid_0\n" +
|
||
|
" where b.tong_price_0 ='70') and 型号 like '$%{vagueMaterialName}%' \n" +
|
||
|
")as dd on dd.型号=a.material_xingh collate Chinese_PRC_CI_AS and dd.规格 = a.material_guig collate Chinese_PRC_CI_AS \n" +
|
||
|
" and dd.电压等级= a.material_diany collate Chinese_PRC_CI_AS\n" +
|
||
|
"where a.material_xingh like '${precMaterialName}%' AND a.material_xingh like '%${vagueMaterialName}%' AND a.material_guig like '%${vagueModel}%'"
|
||
|
)
|
||
|
List<MaterialDto> queryMaterialListByParam(@Param("precMaterialName") String precMaterialName,
|
||
|
@Param("vagueMaterialName")String vagueMaterialName,
|
||
|
@Param("vagueModel") String vagueModel);
|
||
|
}
|