提交 9db891dd authored 作者: renjianyu's avatar renjianyu

--no commit message

上级 1901923f
package com.zrqx.resource.bg.controller.statistics;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zrqx.core.constant.resource.ResourceRequestPath;
import com.zrqx.core.model.resource.sensitiveword.SensitiveWord;
import com.zrqx.core.model.resource.statistics.Statistics;
import com.zrqx.core.util.response.CallBack;
import com.zrqx.core.vo.resource.workmanagement.WorkmanagementCountVo;
import com.zrqx.resource.bg.mapper.workmanagement.WorkManagementMapper;
import com.zrqx.resource.bg.service.sensitiveword.SensitiveWordService;
import com.zrqx.resource.bg.service.statistics.StatisticsService;
import com.zrqx.resource.bg.service.workmanagement.WorkManagementService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
* 统计 Controller
*/
@RestController
@RequestMapping(ResourceRequestPath.BG+ResourceRequestPath.STATISTICS)
@Api(description = "统计")
public class StatisticsController {
@Autowired
private StatisticsService service;
@Autowired
private WorkManagementService workmanagementService;
@Autowired
private WorkManagementMapper workManagementMapper;
@ApiOperation(value = "整体分析", notes = "整体分析")
@GetMapping(value = ResourceRequestPath.GET)
public CallBack<Statistics> getSelect() {
return CallBack.success(service.selectAll().get(0));
}
@ApiOperation(value = "查询作品点击量前十", notes = "查询作品点击量前十")
@GetMapping(value = ResourceRequestPath.GET + ResourceRequestPath.LIST )
public CallBack<List<WorkmanagementCountVo>> getById() {
return CallBack.success(workManagementMapper.listWork());
}
}
......@@ -12,6 +12,7 @@ import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.core.model.resource.workmanagement.WorkManagement;
import com.zrqx.core.vo.resource.ebook.EbookListVO;
import com.zrqx.core.vo.resource.ebook.ExcelEbookListVo;
import com.zrqx.core.vo.resource.workmanagement.WorkmanagementCountVo;
import com.zrqx.core.vo.resource.workmanagement.WorkmanagementListVo;
/**
......@@ -61,99 +62,19 @@ public interface WorkManagementMapper extends BaseMapper<WorkManagement>{
+ " ORDER BY uploadTime desc"
+ "</script>")
List<WorkmanagementListVo> page(@Param("form")WorkmanagementForm form);
@Select("<script>"
+ "SELECT "
+ " bb.id,bb.name,bb.author,bb.isbn, "
+ " be.bookCover,be.price,be.realPrice,be.uploadTime,be.updateTime,be.bookStatus "
+ " FROM res_book bb "
+ " LEFT JOIN res_ebook be ON bb.id = be.id "
+ " LEFT JOIN res_ebook_diy_type bdt ON be.id = bdt.ebookid"
+ " WHERE 1 = 1 and be.bookStatus = 4 and be.realPrice IS NOT NULL "
+ "<if test='"+ NOTBLANK +"(form.diyTypeCode)' >"
+ "and bdt.Code like concat(#{form.diyTypeCode},'%') "
+ "</if>"
+ "<if test='"+ NOTBLANK +"(form.title)'>"
+ " AND bb.name like concat('%',#{form.title},'%')"
+ "</if>"
+ "<if test='form.ids != null and form.ids.size > 0'>"
+ "and bb.id not in "
+ " <foreach collection=\"form.ids\" index=\"index\" item=\"id\" open=\"(\" separator=\",\" close=\")\">"
+ "#{id}"
+ "</foreach>"
+ "</if>"
+ "</script>")
List<EbookListVO> queryByTileAndDiyType(@Param("form")QueryResourceForPoPForm form);
/**
* 根据图书类型查询图书
* @return
*/
@Select("select id from res_ebook where epubFile is not null")
List<String> selectBooksByType();
/**
* 查询导出图书信息
* 查询作品游览量排行前十
* @Title page
* @param form
* @return
* @return List<BookVo>
* @author Conan
* @date 2020年7月15日 下午2:33:32
*/
@Select("<script>"
+ "SELECT "
+ " bb.id,bb.name,bb.author,bb.isbn,bb.copyrightTerm,bb.translator,bb.executiveEditor,bb.publishTime,bb.publisher,bb.fontCount,bb.revision,bb.printCount,bb.printNo,bb.format,bb.totalPages,bb.CIP,bb.midpicid,bb.zipCode, "
+ " be.realprice,be.entityRealPrice,be.uploadTime,be.updateTime,be.bookStatus "
+ " FROM res_book bb "
+ " LEFT JOIN res_ebook be ON bb.id = be.id "
+ " LEFT JOIN res_ebook_diy_type bdt ON be.id = bdt.ebookid"
+ " WHERE 1 = 1 "
+ "<if test='option==1'>"
+ " AND bb.author is null "
+ "</if>"
+ "<if test='option==2'>"
+ " AND be.bookCover is null "
+ "</if>"
+ "<if test='option==3'>"
+ " AND be.summary is null "
+ "</if>"
+ "<if test='option==4'>"
+ " AND be.realPrice is null "
+ "</if>"
+ "<if test='bookStatus!=null'>"
+ " AND be.bookStatus = #{bookStatus} "
+ "</if>"
+ "<if test='bookStatus==null'>"
+ " AND be.bookStatus != 6 "
+ "</if>"
+ "<if test='type!=null'>"
+ " AND bb.type = #{type} "
+ "</if>"
+ "<if test='bookType!=null'>"
+ " AND be.bookType = #{bookType} "
+ "</if>"
+ "<if test='status!=null'>"
+ " AND bb.status = #{status} "
+ "</if>"
+ "<if test='"+ NOTBLANK +"(diyTypeCode)' >"
+ "and bdt.code like concat(#{diyTypeCode},'%') "
+ "</if>"
+ "<if test='"+ NOTBLANK +"(nai)'>"
+ " AND (bb.name like concat('%',#{nai},'%') OR bb.author like concat('%',#{nai},'%') OR bb.isbn like concat('%',#{nai},'%')) "
+ "</if>"
+ "<if test='"+ NOTBLANK +"(name)'>"
+ " AND bb.name like concat('%',#{name},'%')"
+ "</if>"
+ "<if test='"+ NOTBLANK +"(author)'>"
+ " AND bb.author like concat('%',#{author},'%')"
+ "</if>"
+ "<if test='"+ NOTBLANK +"(isbn)'>"
+ " AND bb.isbn like concat('%',#{isbn},'%')"
+ "</if>"
+ "<if test='"+ NOTBLANK +"(beginTime)'>"
+ " AND be.uploadTime &gt;= concat(#{beginTime}, ' 00:00:00')"
+ "</if>"
+ "<if test='beginTime!=null and endTime!=null'>"
+ " AND be.uploadTime &lt;= concat(#{endTime}, ' 23:59:59')"
+ "</if>"
+ " order by be.uploadTime desc "
+ " select seriesdescribe name,visitcount from res_work_management ORDER BY visitcount desc LIMIT 10 "
+ "</script>")
List<ExcelEbookListVo> exportBookList(QueryEbookInfoForm form);
List<WorkmanagementCountVo> listWork();
}
package com.zrqx.resource.fg.mapper.statistics;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import com.zrqx.core.form.resource.bg.QueryResourceForPoPForm;
import com.zrqx.core.form.resource.bg.ebook.QueryEbookInfoForm;
import com.zrqx.core.form.resource.bg.workmanagement.WorkmanagementForm;
import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.core.model.resource.statistics.Statistics;
import com.zrqx.core.model.resource.workmanagement.WorkManagement;
import com.zrqx.core.vo.resource.ebook.EbookListVO;
import com.zrqx.core.vo.resource.ebook.ExcelEbookListVo;
import com.zrqx.core.vo.resource.workmanagement.WorkmanagementListVo;
/**
* 统计-mapper
* @author Conan
* @date 2020年7月13日上午10:03:52
*/
public interface FgStatisticsMapper extends BaseMapper<Statistics>{
}
package com.zrqx.resource.fg.service.statistics;
import java.text.ParseException;
import com.zrqx.core.form.resource.bg.ebook.QueryEbookInfoForm;
import com.zrqx.core.form.resource.bg.ebook.SaveUpdateEbookForm;
import com.zrqx.core.form.resource.bg.workmanagement.SaveUpdateWorkForm;
import com.zrqx.core.form.resource.bg.workmanagement.WorkmanagementForm;
import com.zrqx.core.model.resource.statistics.Statistics;
import com.zrqx.core.model.resource.workmanagement.WorkManagement;
import com.zrqx.core.service.BaseService;
import com.zrqx.core.util.page.PageInfo;
import com.zrqx.core.util.page.PageParam;
import com.zrqx.core.vo.resource.ebook.EbookListVO;
import com.zrqx.core.vo.resource.workmanagement.WorkmanagementListVo;
/**
* 统计-service
*/
public interface FgStatisticsService extends BaseService<Statistics, String>{
}
package com.zrqx.resource.fg.service.statistics;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zrqx.core.form.resource.bg.workmanagement.SaveUpdateWorkForm;
import com.zrqx.core.form.resource.bg.workmanagement.WorkmanagementForm;
import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.core.model.resource.ebook.EbookDiyType;
import com.zrqx.core.model.resource.statistics.Statistics;
import com.zrqx.core.model.resource.workmanagement.WorkManagement;
import com.zrqx.core.model.resource.workmanagement.WorkManagementDiyType;
import com.zrqx.core.model.resource.workmanagement.WorkManagementImg;
import com.zrqx.core.model.resource.workmanagement.WorkManagementWork;
import com.zrqx.core.service.BaseServiceImpl;
import com.zrqx.core.util.bean.BeanUtils;
import com.zrqx.core.util.page.PageInfo;
import com.zrqx.core.util.page.PageParam;
import com.zrqx.core.vo.resource.workmanagement.WorkImgVo;
import com.zrqx.core.vo.resource.workmanagement.WorkManagementWorkVo;
import com.zrqx.core.vo.resource.workmanagement.WorkmanagementListVo;
import com.zrqx.resource.bg.mapper.statistics.StatisticsMapper;
import com.zrqx.resource.bg.mapper.workmanagement.WorkManagementDiyTypeMapper;
import com.zrqx.resource.bg.mapper.workmanagement.WorkManagementImgMapper;
import com.zrqx.resource.bg.mapper.workmanagement.WorkManagementMapper;
import com.zrqx.resource.fg.mapper.statistics.FgStatisticsMapper;
import io.swagger.annotations.ApiModelProperty;
import tk.mybatis.mapper.entity.Example;
/**
* 统计-serviceimpl
*
* @author Conan
* @date 2020年7月13日上午10:05:36
*/
@Service
public class FgStatisticsServiceImpl extends BaseServiceImpl<Statistics, String>
implements FgStatisticsService {
@Autowired
private FgStatisticsMapper statisticsMapper;
@Override
public BaseMapper<Statistics> getMapper() {
return statisticsMapper;
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论