|
|
@ -0,0 +1,50 @@ |
|
|
|
|
|
package com.thing.carbontrack.dict.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import com.mybatisflex.core.query.QueryColumn; |
|
|
|
|
|
import com.mybatisflex.core.query.QueryWrapper; |
|
|
|
|
|
import com.thing.carbontrack.dict.entity.IotCarbonUnitDictEntity; |
|
|
|
|
|
import com.thing.carbontrack.dict.mapper.IotCarbonUnitDictMapper; |
|
|
|
|
|
import com.thing.carbontrack.dict.service.IotCarbonUnitDictService; |
|
|
|
|
|
import com.thing.common.orm.service.impl.BaseServiceImpl; |
|
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
import static com.mybatisflex.core.query.QueryMethods.distinct; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 计量单位字典 |
|
|
|
|
|
* |
|
|
|
|
|
* @author xc |
|
|
|
|
|
* @since 3.0 2024-09-23 |
|
|
|
|
|
*/ |
|
|
|
|
|
@Service |
|
|
|
|
|
public class IotCarbonUnitDictServiceImpl extends BaseServiceImpl<IotCarbonUnitDictMapper, IotCarbonUnitDictEntity> implements IotCarbonUnitDictService { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public QueryWrapper getWrapper(Map<String, Object> params){ |
|
|
|
|
|
QueryWrapper wrapper = new QueryWrapper(); |
|
|
|
|
|
return wrapper; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public List<String> getList() { |
|
|
|
|
|
QueryColumn pName = new QueryColumn("p_name"); |
|
|
|
|
|
QueryWrapper wrapper = new QueryWrapper(); |
|
|
|
|
|
wrapper.select(distinct(pName)) |
|
|
|
|
|
.from("iot_carbon_unit_dict"); |
|
|
|
|
|
return this.listAs(wrapper,String.class); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public List<String> listByPName(String pName) { |
|
|
|
|
|
QueryColumn cName = new QueryColumn("c_name"); |
|
|
|
|
|
QueryWrapper wrapper = new QueryWrapper(); |
|
|
|
|
|
wrapper.select(distinct(cName)) |
|
|
|
|
|
.from("iot_carbon_unit_dict"); |
|
|
|
|
|
wrapper.eq("p_name",pName); |
|
|
|
|
|
return this.listAs(wrapper,String.class); |
|
|
|
|
|
} |
|
|
|
|
|
} |