Browse Source

添加根据客户id获取网格数据方法

master
jianjun 5 years ago
parent
commit
209471a0d1
  1. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java
  2. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java
  3. 11
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java

@ -18,13 +18,10 @@
package com.epmet.dao.stats; package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.org.CustomerGridEntity;
import com.epmet.dto.group.result.CustomerGridInfoResultDTO; import com.epmet.dto.group.result.CustomerGridInfoResultDTO;
import com.epmet.entity.stats.DimGridEntity; import com.epmet.entity.stats.DimGridEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.List; import java.util.List;
@ -37,9 +34,15 @@ import java.util.List;
@Mapper @Mapper
public interface DimGridDao extends BaseDao<DimGridEntity> { public interface DimGridDao extends BaseDao<DimGridEntity> {
DimGridEntity getLastCreatedGridDimEntity(); DimGridEntity getLastCreatedGridDimEntity();
List<CustomerGridInfoResultDTO> selectCustomerGrid(); List<CustomerGridInfoResultDTO> selectCustomerGrid();
/**
* desc:根据客户Id获取 该客户下的网格数据
* @param customerId
* @return
*/
List<DimGridEntity> getGridListByCustomerId(@Param("customerId") String customerId);
} }

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java

@ -21,6 +21,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.stats.DimGridDao; import com.epmet.dao.stats.DimGridDao;
@ -112,8 +114,8 @@ public class DimGridServiceImpl extends BaseServiceImpl<DimGridDao, DimGridEntit
@Override @Override
public List<DimGridEntity> getGridListByCustomerId(String customerId) { public List<DimGridEntity> getGridListByCustomerId(String customerId) {
if (StringUtils.isBlank(customerId)){ if (StringUtils.isBlank(customerId)){
throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg());
} }
//baseDao.getGridListByCustomerId(customerId); return baseDao.getGridListByCustomerId(customerId);
return null;
} }
} }

11
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml

@ -23,5 +23,16 @@
dc.del_flag = 0 dc.del_flag = 0
AND dg.del_flag = 0 AND dg.del_flag = 0
</select> </select>
<select id="getGridListByCustomerId" resultType="com.epmet.entity.stats.DimGridEntity">
SELECT
ID
CUSTOMER_ID,
AGENCY_ID
FROM
dim_grid
WHERE
DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
</select>
</mapper> </mapper>
Loading…
Cancel
Save