wuzeyu
2023-11-27 6fee9c7feb67b19c9512aeec59b86d20a86e38bf
pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/block/BlockSv.java
@@ -1,15 +1,15 @@
package com.dy.pipIrrBase.block;
import com.alibaba.fastjson2.JSON;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.daoBa.BaBlockMapper;
import com.dy.pipIrrGlobal.pojoBa.BaBlock;
import com.dy.pipIrrGlobal.pojoBa.BaClientType;
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.apache.commons.beanutils.BeanUtils ;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.Map;
import java.util.List;
@@ -33,24 +33,33 @@
        return this.dao.selectByPrimaryKey(id) ;
    }
    /**
     * 得到所有片区
     * @return 所有片区集合
     */
    public QueryResultVo<List<BaBlock>> selectAll(){
        QueryResultVo<List<BaBlock>> rsVo = new QueryResultVo<>() ;
        rsVo.obj = this.dao.selectAll() ;
        return rsVo ;
    }
    /**
     * 得到一个片区
     * @param vo 查询条件值对象
     * @return 片区实体
     */
    public QueryResultVo<List<BaBlock>> selectSome(QueryVo vo) throws Exception{
        Map<String, Object> params = new HashMap<>();
        BeanUtils.populate(vo, params);
    @SuppressWarnings("unchecked")
    public QueryResultVo<List<BaBlock>> selectSome(QueryVo vo){
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(vo) ;
        Long itemTotal = this.dao.selectTotal(params) ;
        QueryResultVo<List<BaBlock>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = vo.pageSize ;
        rsVo.pageCurr = vo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = this.dao.selectSome(params) ;
        List<BaBlock> list = this.dao.selectSome(params) ;
        return (QueryResultVo.<List<BaBlock>>builder().content(list)).build() ;
        return rsVo ;
    }
    /**
@@ -58,6 +67,7 @@
     * @param po 实体
     * @return 数量
     */
    @Transactional
    public int save(BaBlock po){
        return this.dao.insert(po) ;
    }
@@ -67,6 +77,7 @@
     * @param po 实体
     * @return 数量
     */
    @Transactional
    public int update(BaBlock po){
        return this.dao.updateByPrimaryKeySelective(po) ;
    }
@@ -76,6 +87,7 @@
     * @param id 实体ID
     * @return 数量
     */
    @Transactional
    public int delete(Long id){
        return this.dao.deleteLogicById(id) ;
    }