forked from luyan/epmet-cloud-lingshan
23 changed files with 744 additions and 6 deletions
@ -0,0 +1,38 @@ |
|||||
|
package com.epmet.dto.stats; |
||||
|
/** |
||||
|
* @author jianjun liu |
||||
|
* @email liujianjun@yunzongnet.com |
||||
|
* @date 2020-06-17 16:43 |
||||
|
**/ |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* desc:文章总数 统计返回结果 dto |
||||
|
* |
||||
|
* @author liujianjun |
||||
|
* @date 2020/6/17 16:43 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ArticleGridPublishedSummaryDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 6755654148306711602L; |
||||
|
|
||||
|
/** |
||||
|
* 客户id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
/** |
||||
|
* 网格Id |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
/** |
||||
|
* 发布文章总数 |
||||
|
*/ |
||||
|
private Integer publishedCount; |
||||
|
/** |
||||
|
* 状态为发布中的文章总数 |
||||
|
*/ |
||||
|
private Integer publishingCount; |
||||
|
} |
@ -0,0 +1,29 @@ |
|||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.service.StatsDemoService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.util.concurrent.ExecutorService; |
||||
|
|
||||
|
/** |
||||
|
* desc:宣传能力controller |
||||
|
*/ |
||||
|
@RequestMapping("publicity") |
||||
|
@RestController |
||||
|
public class PublicityController { |
||||
|
|
||||
|
@Autowired |
||||
|
private StatsDemoService demoService; |
||||
|
|
||||
|
@Autowired |
||||
|
private ExecutorService executorService; |
||||
|
|
||||
|
@PostMapping(value = "publicitySummaryStatsjob") |
||||
|
public Result<Boolean> publicitySummaryStatsjob(){ |
||||
|
return null; |
||||
|
} |
||||
|
} |
@ -0,0 +1,33 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dao.voice; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.entity.voice.ArticleEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* 文章表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-06-17 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface ArticleDao extends BaseDao<ArticleEntity> { |
||||
|
|
||||
|
} |
@ -0,0 +1,46 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dao.voice; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; |
||||
|
import com.epmet.entity.voice.ArticlePublishRangeEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 文章发布范围表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-06-17 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface ArticlePublishRangeDao extends BaseDao<ArticlePublishRangeEntity> { |
||||
|
|
||||
|
/** |
||||
|
* desc:查询网格发布文章总数及状态为发布中的文章总数 |
||||
|
* |
||||
|
* @param customerId |
||||
|
* @param createDate |
||||
|
* @return |
||||
|
*/ |
||||
|
List<ArticleGridPublishedSummaryDTO> selectByCreatedDate(@Param("customerId") String customerId, @Param("createDate") Date createDate); |
||||
|
} |
@ -0,0 +1,125 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.entity.voice; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 文章表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-06-17 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("article") |
||||
|
public class ArticleEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 客户ID |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 草稿ID |
||||
|
*/ |
||||
|
private String draftId; |
||||
|
|
||||
|
/** |
||||
|
* 文章标题 |
||||
|
*/ |
||||
|
private String title; |
||||
|
|
||||
|
/** |
||||
|
* 文章内容 精简内容 |
||||
|
*/ |
||||
|
private String previewContent; |
||||
|
|
||||
|
/** |
||||
|
* 是否置顶 1是;0否; |
||||
|
*/ |
||||
|
private Integer isTop; |
||||
|
|
||||
|
/** |
||||
|
* 发布范围描述 所有发布范围集合,顿号隔开 |
||||
|
*/ |
||||
|
private String publishRangeDesc; |
||||
|
|
||||
|
/** |
||||
|
* 发布单位ID |
||||
|
*/ |
||||
|
private String publisherId; |
||||
|
|
||||
|
/** |
||||
|
* 发布单位名称 |
||||
|
*/ |
||||
|
private String publisherName; |
||||
|
|
||||
|
/** |
||||
|
* 发布单位类型 机关:agency;部门:department;网格:grid |
||||
|
*/ |
||||
|
private String publisherType; |
||||
|
|
||||
|
/** |
||||
|
* 发布时间 |
||||
|
*/ |
||||
|
private Date publishDate; |
||||
|
|
||||
|
/** |
||||
|
* 发布状态 已发布:published;已下线:offline |
||||
|
*/ |
||||
|
private String statusFlag; |
||||
|
|
||||
|
/** |
||||
|
* 下线时间 |
||||
|
*/ |
||||
|
private Date offLineTime; |
||||
|
|
||||
|
/** |
||||
|
* 文章标签串 竖杠分割的标签名称 |
||||
|
*/ |
||||
|
private String tags; |
||||
|
|
||||
|
/** |
||||
|
* 组织ID |
||||
|
*/ |
||||
|
private String orgId; |
||||
|
|
||||
|
/** |
||||
|
* 组织ID路径 eg:字段为def:abc |
||||
|
*/ |
||||
|
private String orgIdPath; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID 数据权限使用 |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 部门ID 数据权限使用 |
||||
|
*/ |
||||
|
private String departmentId; |
||||
|
|
||||
|
} |
@ -0,0 +1,85 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.entity.voice; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 文章发布范围表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-06-17 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("article_publish_range") |
||||
|
public class ArticlePublishRangeEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 客户ID |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 文章ID |
||||
|
*/ |
||||
|
private String articleId; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 组织-网格名称 |
||||
|
*/ |
||||
|
private String agencyGridName; |
||||
|
|
||||
|
/** |
||||
|
* 组织ID |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
|
||||
|
/** |
||||
|
* 所有上级组织机构ID 以英文:隔开 |
||||
|
*/ |
||||
|
private String pids; |
||||
|
|
||||
|
/** |
||||
|
* 所有上级名称 以横杠隔开 |
||||
|
*/ |
||||
|
private String allParentName; |
||||
|
|
||||
|
/** |
||||
|
* 下线时间 |
||||
|
*/ |
||||
|
private Date offLineTime; |
||||
|
|
||||
|
/** |
||||
|
* 发布状态 已发布:published;已下线:offline |
||||
|
*/ |
||||
|
private String publishStatus; |
||||
|
|
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
package com.epmet.service; |
||||
|
|
||||
|
|
||||
|
public interface StatsPublicityService { |
||||
|
/** |
||||
|
* desc: 统计宣传能力的汇总信息 |
||||
|
* |
||||
|
* return: |
||||
|
* @date: 2020/6/17 16:11 |
||||
|
* @author: jianjun liu |
||||
|
* email:liujianjun@git.elinkit.com.cn |
||||
|
*/ |
||||
|
Boolean publicitySummary(); |
||||
|
|
||||
|
} |
@ -0,0 +1,68 @@ |
|||||
|
package com.epmet.service.impl; |
||||
|
|
||||
|
import com.epmet.commons.tools.utils.DateUtils; |
||||
|
import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; |
||||
|
import com.epmet.service.StatsPublicityService; |
||||
|
import com.epmet.service.stats.*; |
||||
|
import com.epmet.service.voice.ArticlePublishRangeService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.util.CollectionUtils; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* desc: 宣传能力数据统计 service |
||||
|
* |
||||
|
* @date: 2020/6/17 16:08 |
||||
|
* @author: jianjun liu |
||||
|
* email:liujianjun@git.elinkit.com.cn |
||||
|
*/ |
||||
|
@Service |
||||
|
public class StatsPublicityServiceImpl implements StatsPublicityService { |
||||
|
|
||||
|
@Autowired |
||||
|
private DimAgencyService dimAgencyService; |
||||
|
@Autowired |
||||
|
private DimDateService dimDateService; |
||||
|
@Autowired |
||||
|
private DimWeekService dimWeekService; |
||||
|
@Autowired |
||||
|
private DimMonthService dimMonthService; |
||||
|
@Autowired |
||||
|
private DimQuarterService dimQuarterService; |
||||
|
@Autowired |
||||
|
private DimYearService dimYearService; |
||||
|
@Autowired |
||||
|
private DimCustomerService dimCustomerService; |
||||
|
|
||||
|
@Autowired |
||||
|
private ArticlePublishRangeService articlePublishRangeService; |
||||
|
|
||||
|
@Override |
||||
|
public Boolean publicitySummary() { |
||||
|
int pageNo = 1; |
||||
|
int pageSize = 100; |
||||
|
List<String> customerIdList = null; |
||||
|
do { |
||||
|
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo, (pageNo - 1) * pageSize); |
||||
|
if (!CollectionUtils.isEmpty(customerIdList)) { |
||||
|
customerIdList.forEach(customerId -> { |
||||
|
|
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
} while (!CollectionUtils.isEmpty(customerIdList) || customerIdList.size() >= pageSize); |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
private String statsPublishArticle(String customerId, Date statsDate) { |
||||
|
//1.先查询昨天的 有没有数据 有则 昨日发布文章总数 = 昨日的发布文章数增量 + 统计表中已有的昨日的网格总数 ;
|
||||
|
// 否则 昨日发布文章总数 = 发布范围表中计算所有发布文章总数
|
||||
|
|
||||
|
List<ArticleGridPublishedSummaryDTO> articleCount = articlePublishRangeService.selectByCreatedDate(customerId, statsDate == null ? DateUtils.addDateDays(new Date(), -1) : statsDate); |
||||
|
|
||||
|
return null; |
||||
|
} |
||||
|
} |
@ -0,0 +1,46 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.service.voice; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; |
||||
|
import com.epmet.entity.voice.ArticlePublishRangeEntity; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 文章发布范围表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-06-17 |
||||
|
*/ |
||||
|
public interface ArticlePublishRangeService extends BaseService<ArticlePublishRangeEntity> { |
||||
|
|
||||
|
/** |
||||
|
* desc: 根据客户Id 、创建日期查询 发布范围数据 |
||||
|
* |
||||
|
* @param customerId |
||||
|
* @param createDate |
||||
|
* return: |
||||
|
* @date: 2020/6/17 16:59 |
||||
|
* @author: jianjun liu |
||||
|
* email:liujianjun@git.elinkit.com.cn |
||||
|
*/ |
||||
|
List<ArticleGridPublishedSummaryDTO> selectByCreatedDate(String customerId, Date createDate); |
||||
|
} |
@ -0,0 +1,33 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.service.voice; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.entity.voice.ArticleEntity; |
||||
|
|
||||
|
/** |
||||
|
* desc: 数据统计文章service |
||||
|
* |
||||
|
* return: |
||||
|
* @date: 2020/6/17 15:28 |
||||
|
* @author: jianjun liu |
||||
|
* email:liujianjun@git.elinkit.com.cn |
||||
|
*/ |
||||
|
public interface ArticleService extends BaseService<ArticleEntity> { |
||||
|
|
||||
|
} |
@ -0,0 +1,47 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.service.voice.impl; |
||||
|
|
||||
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.constant.DataSourceConstant; |
||||
|
import com.epmet.dao.voice.ArticlePublishRangeDao; |
||||
|
import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; |
||||
|
import com.epmet.entity.voice.ArticlePublishRangeEntity; |
||||
|
import com.epmet.service.voice.ArticlePublishRangeService; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 文章发布范围表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-06-17 |
||||
|
*/ |
||||
|
@Service |
||||
|
@DataSource(DataSourceConstant.GOV_VOICE) |
||||
|
public class ArticlePublishRangeServiceImpl extends BaseServiceImpl<ArticlePublishRangeDao, ArticlePublishRangeEntity> implements ArticlePublishRangeService { |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public List<ArticleGridPublishedSummaryDTO> selectByCreatedDate(String customerId, Date createDate) { |
||||
|
return baseDao.selectByCreatedDate(customerId,createDate); |
||||
|
} |
||||
|
} |
@ -0,0 +1,41 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.service.voice.impl; |
||||
|
|
||||
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.constant.DataSourceConstant; |
||||
|
import com.epmet.dao.voice.ArticleDao; |
||||
|
import com.epmet.entity.voice.ArticleEntity; |
||||
|
import com.epmet.service.voice.ArticleService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
/** |
||||
|
* 项目表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-05-11 |
||||
|
*/ |
||||
|
@Service |
||||
|
@DataSource(DataSourceConstant.GOV_VOICE) |
||||
|
public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntity> implements ArticleService { |
||||
|
@Autowired |
||||
|
private ArticleDao articleDao; |
||||
|
|
||||
|
} |
@ -0,0 +1,34 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.dao.voice.ArticleDao"> |
||||
|
|
||||
|
<resultMap type="com.epmet.entity.voice.ArticleEntity" id="articleMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="customerId" column="CUSTOMER_ID"/> |
||||
|
<result property="draftId" column="DRAFT_ID"/> |
||||
|
<result property="title" column="TITLE"/> |
||||
|
<result property="previewContent" column="PREVIEW_CONTENT"/> |
||||
|
<result property="isTop" column="IS_TOP"/> |
||||
|
<result property="publishRangeDesc" column="PUBLISH_RANGE_DESC"/> |
||||
|
<result property="publisherId" column="PUBLISHER_ID"/> |
||||
|
<result property="publisherName" column="PUBLISHER_NAME"/> |
||||
|
<result property="publisherType" column="PUBLISHER_TYPE"/> |
||||
|
<result property="publishDate" column="PUBLISH_DATE"/> |
||||
|
<result property="statusFlag" column="STATUS_FLAG"/> |
||||
|
<result property="offLineTime" column="OFF_LINE_TIME"/> |
||||
|
<result property="tags" column="TAGS"/> |
||||
|
<result property="orgId" column="ORG_ID"/> |
||||
|
<result property="orgIdPath" column="ORG_ID_PATH"/> |
||||
|
<result property="gridId" column="GRID_ID"/> |
||||
|
<result property="departmentId" column="DEPARTMENT_ID"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
<result property="revision" column="REVISION"/> |
||||
|
<result property="createdBy" column="CREATED_BY"/> |
||||
|
<result property="createdTime" column="CREATED_TIME"/> |
||||
|
<result property="updatedBy" column="UPDATED_BY"/> |
||||
|
<result property="updatedTime" column="UPDATED_TIME"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,40 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.dao.voice.ArticlePublishRangeDao"> |
||||
|
|
||||
|
<resultMap type="com.epmet.entity.voice.ArticlePublishRangeEntity" id="articlePublishRangeMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="customerId" column="CUSTOMER_ID"/> |
||||
|
<result property="articleId" column="ARTICLE_ID"/> |
||||
|
<result property="gridId" column="GRID_ID"/> |
||||
|
<result property="agencyGridName" column="AGENCY_GRID_NAME"/> |
||||
|
<result property="agencyId" column="AGENCY_ID"/> |
||||
|
<result property="pids" column="PIDS"/> |
||||
|
<result property="allParentName" column="ALL_PARENT_NAME"/> |
||||
|
<result property="offLineTime" column="OFF_LINE_TIME"/> |
||||
|
<result property="publishStatus" column="PUBLISH_STATUS"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
<result property="revision" column="REVISION"/> |
||||
|
<result property="createdBy" column="CREATED_BY"/> |
||||
|
<result property="createdTime" column="CREATED_TIME"/> |
||||
|
<result property="updatedBy" column="UPDATED_BY"/> |
||||
|
<result property="updatedTime" column="UPDATED_TIME"/> |
||||
|
</resultMap> |
||||
|
<select id="selectByCreatedDate" resultType="com.epmet.dto.stats.ArticleGridPublishedSummaryDTO"> |
||||
|
SELECT |
||||
|
GRID_ID, |
||||
|
count(ID) publishedCount, |
||||
|
sum( CASE PUBLISH_STATUS WHEN 'published' THEN 1 ELSE 0 END ) publishingCount |
||||
|
FROM |
||||
|
article_publish_range |
||||
|
WHERE |
||||
|
CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} and |
||||
|
CREATED_TIME <![CDATA[ <#{createDate,jdbcType=TIMESTAMP}]]> |
||||
|
GROUP BY |
||||
|
CUSTOMER_ID, |
||||
|
GRID_ID |
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
</mapper> |
Loading…
Reference in new issue