| package com.dy.pmsPlatform.proParam; | 
|   | 
| import com.dy.common.webUtil.QueryResultVo; | 
| import com.dy.pmsGlobal.daoPlt.PltProParamsMapper; | 
| import com.dy.pmsGlobal.pojoPlt.PltProductParams; | 
| import lombok.extern.slf4j.Slf4j; | 
| import org.apache.dubbo.common.utils.PojoUtils; | 
| import org.springframework.beans.factory.annotation.Autowired; | 
| import org.springframework.stereotype.Service; | 
| import org.springframework.transaction.annotation.Transactional; | 
|   | 
| import java.util.List; | 
| import java.util.Map; | 
|   | 
| @Slf4j | 
| @Service | 
| public class ParamSv { | 
|   | 
|     private PltProParamsMapper dao; | 
|   | 
|     @Autowired | 
|     public void setDao(PltProParamsMapper dao) { | 
|         this.dao = dao; | 
|     } | 
|   | 
|     @Transactional | 
|     public int save(PltProductParams param) { | 
|         int count = dao.insert(param); | 
|         return count; | 
|     } | 
|   | 
|     /** | 
|      * 逻辑删除实体 | 
|      * @param id 实体ID | 
|      * @return 影响记录数量 | 
|      */ | 
|     @Transactional | 
|     public int delete(Long id) { | 
|         return this.dao.deleteLogicById(id); | 
|     } | 
|   | 
|   | 
|   | 
|     @Transactional | 
|     public int update(PltProductParams param) { | 
|         int count = dao.updateByPrimaryKeySelective(param); | 
|         return count; | 
|     } | 
|   | 
|   | 
|     public PltProductParams selectById(String paramId) { | 
|         return dao.selectByPrimaryKey(Long.valueOf(paramId)); | 
|     } | 
|   | 
|     /** | 
|      * 获取参数列表 | 
|      */ | 
|     public QueryResultVo<List<PltProductParams>> selectSome(QueryVo queryVo) { | 
|         Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); | 
|   | 
|         //查询符合条件的记录总数 | 
|         Long itemTotal = this.dao.selectSomeCount(params); | 
|   | 
|         QueryResultVo<List<PltProductParams>> rsVo = new QueryResultVo<>(queryVo.pageSize, queryVo.pageCurr) ; | 
|         //计算分页等信息 | 
|         rsVo.calculateAndSet(itemTotal, params); | 
|   | 
|         //查询符合条件的记录 | 
|         rsVo.obj = this.dao.selectSome(params) ; | 
|         return rsVo ; | 
|     } | 
|   | 
| } |