Browse Source

9/27 novelty

xiexiang 1 year ago
parent
commit
7c64c2a12c

+ 6 - 9
src/main/java/cn/cslg/pas/controller/NoveltyProjectController.java

@@ -8,13 +8,11 @@ import cn.cslg.pas.common.model.cronModel.Records;
 import cn.cslg.pas.common.utils.Response;
 import cn.cslg.pas.common.vo.NoveltyProjectVO.QueryTemplateVO;
 import cn.cslg.pas.common.vo.QueryInventionPointVO;
-import cn.cslg.pas.common.vo.QueryNoveltyProjectVO;
 import cn.cslg.pas.common.vo.TechnicalCaseVO;
-import cn.cslg.pas.factorys.businessFactory.Business;
 import cn.cslg.pas.service.business.NoveltyProjectService;
 import cn.cslg.pas.service.business.TechnicalCaseService;
 import cn.cslg.pas.service.novelty.NoveltyReportTemplateService;
-import cn.cslg.pas.service.novelty.SearchRecordService;
+import cn.cslg.pas.service.novelty.NoveltySearchRecordService;
 import io.swagger.v3.oas.annotations.Operation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -26,7 +24,6 @@ import java.util.ArrayList;
 import java.util.List;
 
 import java.io.IOException;
-import java.util.List;
 
 @RequestMapping(Constants.API_XiaoSHI + "/noveltyProject")
 @RestController
@@ -42,7 +39,7 @@ public class NoveltyProjectController {
     private NoveltyReportTemplateService noveltyReportTemplateService;
 
     @Autowired
-    private SearchRecordService searchRecordService;
+    private NoveltySearchRecordService noveltySearchRecordService;
 
     @Operation(summary = "添加查新检索报告")
     @PostMapping("/addNoveltyProject")
@@ -150,14 +147,14 @@ public class NoveltyProjectController {
     @Operation(summary = "查询检索记录")
     @PostMapping("/querySearchRecord")
     public Response querySearchRecord(@RequestBody QuerySearchRecordDTO querySearchRecordDTO) throws IOException {
-        Records records = searchRecordService.querySearchRecord(querySearchRecordDTO);
+        Records records = noveltySearchRecordService.querySearchRecord(querySearchRecordDTO);
         return Response.success(records);
     }
 
     @Operation(summary = "添加检索记录")
     @PostMapping("/addSearchRecord")
     public Response addSearchRecord(@RequestBody NoveltyRetrieveRecordDTO noveltyRetrieveRecordDTO){
-        Integer id = searchRecordService.addSearchRecord(noveltyRetrieveRecordDTO);
+        Integer id = noveltySearchRecordService.addSearchRecord(noveltyRetrieveRecordDTO);
         Records records = new Records();
         records.setData(id);
         return Response.success(records);
@@ -166,7 +163,7 @@ public class NoveltyProjectController {
     @Operation(summary = "修改检索记录")
     @PostMapping("/updateSearchRecord")
     public Response updateSearchRecord(@RequestBody NoveltyRetrieveRecordDTO noveltyRetrieveRecordDTO){
-        Integer id = searchRecordService.updateSearchRecord(noveltyRetrieveRecordDTO);
+        Integer id = noveltySearchRecordService.updateSearchRecord(noveltyRetrieveRecordDTO);
         Records records = new Records();
         records.setData(id);
         return Response.success(records);
@@ -175,7 +172,7 @@ public class NoveltyProjectController {
     @Operation(summary = "删除检索记录")
     @PostMapping("/deleteSearchRecord")
     public Response deleteSearchRecord(@RequestBody List<Integer> retrieveIds){
-        List<Integer> ids = searchRecordService.deleteSearchRecord(retrieveIds);
+        List<Integer> ids = noveltySearchRecordService.deleteSearchRecord(retrieveIds);
         Records records =new Records();
         records.setData(ids);
         return Response.success(records);

+ 1 - 1
src/main/java/cn/cslg/pas/service/novelty/SearchRecordService.java

@@ -41,7 +41,7 @@ import java.util.stream.Collectors;
  */
 @Service
 @RequiredArgsConstructor(onConstructor_ = {@Lazy})
-public class SearchRecordService extends ServiceImpl<RetrieveRecordMapper, RetrieveRecord> {
+public class NoveltySearchRecordService extends ServiceImpl<RetrieveRecordMapper, RetrieveRecord> {
     private final CacheUtils cacheUtils;
     private final LoginUtils loginUtils;
 

+ 4 - 4
target/classes/application-dev.yml

@@ -51,7 +51,7 @@ spring:
             threadsInheritContextClassLoaderOfInitializingThread: true
           dataSource:
             default:
-              URL: jdbc:mysql://192.168.2.24:3306/pas?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8
+              URL: jdbc:mysql://192.168.2.24:3306/pas_prod2?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8
               user: root
               password: rrzTwWAYX8Gxh5JH
               driver: com.mysql.jdbc.Driver
@@ -60,9 +60,9 @@ spring:
     job-store-type: jdbc
     #初始化表结构
     jdbc:
-      initialize-schema: always
-authorUrl: http://localhost:8871
-PCSUrl: http://localhost:8871
+      initialize-schema:  always
+authorUrl: http://localhost:8885
+PCSUrl: http://localhost:8885
 #OPSUrl: http://192.168.2.24:5001
 OPSUrl: http://139.224.24.90:5001
 PASUrl: http://localhost:8879

+ 2 - 2
target/classes/application-prodNetIn.yml

@@ -25,9 +25,9 @@ spring:
   data:
     redis:
       host: 172.27.247.174
-authorUrl: http://localhost:8871
+authorUrl: http://localhost:8880
 
-PCSUrl: http://localhost:8871
+PCSUrl: http://localhost:8880
 #OPSUrl: http://192.168.1.24:5001
 OPSUrl: http://139.224.24.90:5001
 PASUrl: http://localhost:8877

+ 2 - 2
target/classes/application-prodNetOut.yml

@@ -24,9 +24,9 @@ spring:
         login-password: Cslg2022+
       web-stat-filter:
         exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"
-authorUrl: http://localhost:8871
+authorUrl: http://localhost:8880
 
-PCSUrl: http://localhost:8871
+PCSUrl: http://localhost:8880
 #OPSUrl: http://192.168.1.24:5001
 OPSUrl: http://139.224.24.90:5001
 PASUrl: http://localhost:8877

+ 2 - 2
target/classes/application-testNetIn.yml

@@ -58,9 +58,9 @@ spring:
 
     #数据库方式
     job-store-type: jdbc
-    #初始化表结构
+    #初始化表结构`
     jdbc:
-      initialize-schema: always
+      initialize-schema: never
 authorUrl: http://localhost:8880
 PCSUrl: http://localhost:8880
 #OPSUrl: http://192.168.1.24:5001

BIN
target/classes/cn/cslg/pas/common/core/annotation/LoggerAspect.class


BIN
target/classes/cn/cslg/pas/common/utils/CacheUtils.class


BIN
target/classes/cn/cslg/pas/common/utils/DateUtils.class


BIN
target/classes/cn/cslg/pas/common/utils/DateUtils2.class


BIN
target/classes/cn/cslg/pas/common/utils/FileUtils.class


BIN
target/classes/cn/cslg/pas/common/utils/Response.class


BIN
target/classes/cn/cslg/pas/controller/CommonController.class


BIN
target/classes/cn/cslg/pas/controller/PatentController.class


BIN
target/classes/cn/cslg/pas/controller/ProductCategoryController.class


BIN
target/classes/cn/cslg/pas/controller/outApi/PatentStarController.class


BIN
target/classes/cn/cslg/pas/exception/XiaoShiException.class


+ 16 - 102
target/classes/mapper/PermissionRecordMapper.xml

@@ -1,114 +1,28 @@
 <?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="cn.cslg.pas.mapper.PermissionRecordMapper">
-    <!--插入数据-->
-    <!--int add(PermissionRecord permissionRecord);-->
-    <insert id="add" useGeneratedKeys="true" keyProperty="id">
-        insert into permission_record(id, patent_no, licensor, licensee, licensee_country, license_time,
-                                      license_fee, license_dead_line, license_type, tenant_id, create_person_id,
-                                      create_person_name, create_time, modified_time)
-        values (#{id}, #{patentNo}, #{licensor}, #{licensee}, #{licenseeCountry},
-                #{licenseTime}, #{licenseFee}, #{licenseDeadLine}, #{licenseType}, #{tenantId}, #{createPersonId},
-                #{createPersonName}, #{createTime}, #{modifiedTime})
-    </insert>
-
-    <!--根据id修改数据-->
-    <!--int update(PermissionRecordDTO permissionRecordDTO);-->
-    <update id="update">
-        update permission_record
-        <set>
-            <if test="patentNo != null">
-                patent_no = #{patentNo},
-            </if>
-            <if test="licensor != null">
-                licensor = #{licensor},
-            </if>
-            <if test="licensee != null">
-                licensee = #{licensee},
-            </if>
-            <if test="licenseeCountry != null">
-                licensee_country = #{licenseeCountry},
-            </if>
-            <if test="licenseTime != null">
-                license_time = #{licenseTime},
-            </if>
-            <if test="licenseFee != null">
-                license_fee = #{licenseFee},
-            </if>
-            <if test="licenseDeadLine != null">
-                license_dead_line = #{licenseDeadLine},
-            </if>
-            <if test="licenseType != null">
-                license_type = #{licenseType},
-            </if>
-        </set>
-        where ID = #{id}
-    </update>
-
 
-    <!--根据patentNo专利号分页查询许可记录数据-->
-    <!--;-->
-    <resultMap id="permissionRecordMap" type="cn.cslg.pas.domain.PermissionRecord">
-        <id column="id" property="id"/>
-        <result column="patent_no" property="patentNo"/>
-        <result column="licensor" property="licensor"/>
-        <result column="licensee" property="licensee"/>
-        <result column="licensee_country" property="licenseeCountry"/>
-        <result column="license_time" property="licenseTime"/>
-        <result column="license_fee" property="licenseFee"/>
-        <result column="license_dead_line" property="licenseDeadLine"/>
-        <result column="license_type" property="licenseType"/>
-        <result column="create_person_id" property="createPersonId"/>
-        <result column="create_person_name" property="createPersonName"/>
-        <result column="create_time" property="createTime"/>
-        <result column="modified_time" property="modifiedTime"/>
-    </resultMap>
-    <!--根据patentNo专利号分页查询许可记录数据-->
-    <!--;-->
-    <resultMap id="permissionRecordVOMap" type="cn.cslg.pas.common.model.vo.PermissionRecordVO">
-        <id column="id" property="id"/>
-        <result column="patent_no" property="patentNo"/>
-        <result column="licensor" property="licensor"/>
-        <result column="licensee" property="licensee"/>
-        <result column="licensee_country" property="licenseeCountry"/>
-        <result column="license_time" property="licenseTime"/>
-        <result column="license_fee" property="licenseFee"/>
-        <result column="license_dead_line" property="licenseDeadLine"/>
-        <result column="license_type" property="licenseType"/>
-    </resultMap>
-    <select id="queryAllInfo" resultMap="permissionRecordVOMap">
-        select id,
-               patent_no,
-               licensor,
-               licensee,
-               licensee_country,
-               license_time,
-               license_fee,
-               license_dead_line,
-               license_type,
-               tenant_id
+    <select id="selectLicenseeMonthList" resultType="cn.cslg.pas.common.dto.es.SelectValueCurveDTO">
+        select sum(license_fee) as licenseFee,
+               DATE_FORMAT(license_time, '%Y-%m') as licenseTime
         from permission_record
-        where patent_no = #{patentNo}
-          and tenant_id = #{tenantId}
+        where patent_no = #{patentNo} and tenant_id = #{tenantId}
+        group by licenseTime;
     </select>
 
-    <!--根据专利号统计许可记录数量-->
-    <!--int countByPatentNo();-->
-    <select id="countByPatentNo" resultType="int">
-        select count(*)
+    <select id="selectLicenseeYearList" resultType="cn.cslg.pas.common.dto.es.SelectValueCurveDTO">
+        select sum(license_fee) as licenseFee,
+               CONCAT(DATE_FORMAT(license_time, '%Y'),'年') as licenseTime
         from permission_record
-        where patent_No = #{patentNo}
-          and tenant_id = #{tenantId}
+        where patent_no = #{patentNo} and tenant_id = #{tenantId}
+        group by licenseTime;
     </select>
 
-
-    <!--根据许可id删除数据-->
-    <!--int delete(Integer id);-->
-    <delete id="delete">
-        delete
+    <select id="selectLicenseeQuarterList" resultType="cn.cslg.pas.common.dto.es.SelectValueCurveDTO">
+        select sum(license_fee) as licenseFee,
+               CONCAT(YEAR(license_time),'年第',quarter(license_time),'季度') as licenseTime
         from permission_record
-        where id = #{id}
-    </delete>
-
+        where patent_no = #{patentNo} and tenant_id = #{tenantId}
+        group by licenseTime;
+    </select>
 </mapper>

+ 31 - 261
target/classes/mapper/ProductCategoryMapper.xml

@@ -1,276 +1,46 @@
 <?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">
-
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
 <mapper namespace="cn.cslg.pas.mapper.ProductCategoryMapper">
-    <!--插入数据-->
-    <!--int insert(ProductCategory productCategory);-->
-    <insert id="insert" useGeneratedKeys="true" keyProperty="id">
-        insert into product_category (product_category_name, remark, license_rate, tenant_id, create_person_id,
-                                      create_person_name)
-        values (#{productCategoryName}, #{remark}, #{licenseRate}, #{tenantId}, #{createPersonId},
-                #{createPersonName})
-    </insert>
-
-    <!--根据id删除数据-->
-    <!--int deleteById(Integer id);-->
-    <delete id="deleteById">
-        delete
-        from product_category
-        where id = #{id}
-    </delete>
-
-    <!--根据id修改数据-->
-    <!--int updateById(ProductCategory productCategory);-->
-    <update id="updateById">
-        update product_category
-        <set>
-            <if test="productCategoryName != null">
-                product_category_name = #{productCategoryName},
-            </if>
-            <if test="remark != null">
-                remark = #{remark},
-            </if>
-            <if test="licenseRate != null">
-                license_rate = #{licenseRate},
-            </if>
-        </set>
-        where id = #{id}
-    </update>
-
-    <!--根据产品类别名称统计数量-->
-    <!--int countByProductCategoryName(String productCategoryName);-->
-    <select id="countByProductCategoryName" resultType="int">
-        select count(*)
-        from product_category
-        where product_category_name = #{productCategoryName}
-          and tenant_id = #{tenantId}
-    </select>
-
-    <!--根据id和名称统计数量-->
-    <!--int countByIdAndName(Integer id, String productCategoryName, Integer tenantId);-->
-    <select id="countByIdAndName" resultType="int">
-        select count(*)
-        from product_category
-        where product_category_name = #{productCategoryName}
-          and tenant_id = #{tenantId}
-          and id != #{id}
-    </select>
-
-    <!--根据id统计数量-->
-    <!--int countById(Integer id);-->
-    <select id="countById" resultType="int">
-        select count(*)
-        from product_category
-        where id = #{id}
-    </select>
-
-    <!--分页查询产品类别和图片-->
-    <!--List<ProductCategoryVO> query(ProductCategoryQueryPageDTO productCategoryQueryPageDTO);-->
-    <select id="query" resultMap="queryMap">
-        select
-        id pc_id,
-        product_category_name,
-        remark,
-        license_rate,
-        create_person_name
-        from product_category
-        <where>
-            <if test="productCategoryName != null">
-                and product_category_name like '%${productCategoryName}%'
-            </if>
-            <if test="createPersonName != null">
-                and create_person_id in (select id from pcs_test.personnel where personnel_name like
-                '%${createPersonName}%')
-            </if>
-            <if test="productName != null">
-                and id in (select product_category_id from product where product_name like '%${productName}%')
-            </if>
-            <if test="patentNo != null">
-                and id in (select product_category_id from product where id in (select product_id from
-                asso_product_patent where patent_no = #{patentNo} union select product_id from
-                asso_structure_patent where patent_no = #{patentNo}))
-            </if>
-            <if test="true">
-                and tenant_id = #{tenantId}
-            </if>
-        </where>
-        order by pc_id
-    </select>
-
-    <resultMap id="queryMap" type="cn.cslg.pas.common.model.vo.ProductCategoryVO">
-        <id column="pc_id" property="id"/>
-        <result column="product_category_name" property="productCategoryName"/>
-        <result column="remark" property="remark"/>
-        <result column="license_rate" property="licenseRate"/>
-        <result column="create_person_name" property="createPersonName"/>
-        <collection property="pictures" ofType="cn.cslg.pas.common.model.vo.ProductCategoryPictureVO"
-                    select="query2" column="pc_id">
-        </collection>
-    </resultMap>
-
-    <select id="query2" resultMap="queryMap2">
-        select id, product_category_id, name, suffix, url
-        from asso_product_category_picture
-        where product_category_id = #{pc_id}
-    </select>
-
-    <resultMap id="queryMap2" type="cn.cslg.pas.common.model.vo.ProductCategoryPictureVO">
-        <id column="id" property="id"/>
-        <result column="product_category_id" property="productCategoryId"/>
-        <result column="name" property="name"/>
-        <result column="suffix" property="suffix"/>
-        <result column="url" property="url"/>
-    </resultMap>
-
-    <resultMap id="queryByDateMap" type="cn.cslg.pas.common.model.vo.ProductMarketDataTrendVO">
-        <result column="market_date" property="marketDate"/>
-        <result column="sale_total_money" property="saleTotalMoney"/>
-        <result column="custom_license_money" property="customLicenseMoney"/>
-    </resultMap>
-
-    <!--根据产品架构id、公司名称、营销地区、时间单位查询产品类别营销数据-->
-    <!--按照月份返回总体-->
-    <select id="categoryQueryByMonth" resultMap="queryByDateMap">
-        SELECT CONCAT(YEAR(CONCAT(sale_time,'-02')),'-',MONTH(CONCAT(sale_time,'-02'))) AS market_date,
-        sum(sale_money) AS sale_total_money,
-        CAST(sum(custom_license_rate * sale_money) AS DECIMAL (19, 2)) AS custom_license_money
-        FROM product_market_data
-        WHERE product_id IN(SELECT id AS product_id
-        FROM product
-        WHERE product_category_id = #{categoryId}
-        <if test="companyName != null and companyName != ''">
-            AND company_name = #{companyName}
-        </if>)
-        <if test="categoryArea != null and categoryArea != ''">
-            AND sale_area = #{categoryArea}
+    <!--namespace根据自己需要创建的的mapper的路径和名称填写-->
+    <select id="getProductCategory" resultType="cn.cslg.pas.common.vo.business.ProductCategoryVO">
+        select distinct category.id as id,category.name as name,category.license_rate as licenseRate,category.show_type as
+        showType,category.description,category.create_id as createId,category.create_time as createTime, category.tenant from product_category as category
+        left join product as product
+    on category.id = product.category_id
+        <if test="sql1!=''">
+
+            where ${sql1}
         </if>
-        GROUP BY market_date
-    </select>
 
-    <!--按照季度返回总体-->
-    <select id="categoryQueryBySeason" resultMap="queryByDateMap">
-        SELECT CONCAT(YEAR(CONCAT(sale_time,'-02')),'年','第',QUARTER(CONCAT(sale_time,'-02')),'季度') AS market_date,
-        sum(sale_money) AS sale_total_money,
-        CAST(sum(custom_license_rate * sale_money) AS DECIMAL (19, 2)) AS custom_license_money
-        FROM product_market_data
-        WHERE product_id IN(SELECT id AS product_id
-        FROM product
-        WHERE product_category_id = #{categoryId}
-        <if test="companyName != null and companyName != ''">
-            AND company_name = #{companyName}
-        </if>)
-        <if test="categoryArea != null and categoryArea != ''">
-            AND sale_area = #{categoryArea}
-        </if>
-        GROUP BY market_date
-    </select>
-    <!--按照年度返回总体-->
-    <select id="categoryQueryByYear" resultMap="queryByDateMap">
-        SELECT CONCAT(YEAR(CONCAT(sale_time,'-02')),'年') AS market_date,
-        sum(sale_money) AS sale_total_money,
-        CAST(sum(custom_license_rate * sale_money) AS DECIMAL (19, 2)) AS custom_license_money
-        FROM product_market_data
-        WHERE product_id IN(SELECT id AS product_id
-        FROM product
-        WHERE product_category_id = #{categoryId}
-        <if test="companyName != null and companyName != ''">
-            AND company_name = #{companyName}
-        </if>)
-        <if test="categoryArea != null and categoryArea != ''">
-            AND sale_area = #{categoryArea}
-        </if>
-        GROUP BY market_date
-    </select>
 
-    <!--按照年度返回每个-->
-    <select id="queryByYear" resultMap="queryByDateMap">
-        SELECT CONCAT(YEAR(CONCAT(sale_time,'-02')),'年') AS market_date,
-        sum(sale_money) AS sale_total_money,
-        CAST(sum(custom_license_rate * sale_money) AS DECIMAL (19, 2)) AS custom_license_money
-        FROM product_market_data
-        WHERE product_id = #{productId}
-        <if test="categoryArea != null and categoryArea != ''">
-            AND sale_Area = #{categoryArea}
-        </if>
-        GROUP BY market_date
+        ${sql2} ${sql3}
     </select>
 
-    <!--按照季度返回每个-->
-    <select id="queryBySeason" resultMap="queryByDateMap">
-        SELECT CONCAT(YEAR(CONCAT(sale_time,'-02')),'年','第',QUARTER(CONCAT(sale_time,'-02')),'季度') AS market_date,
-        sum(sale_money) AS sale_total_money,
-        CAST(sum(custom_license_rate * sale_money) AS DECIMAL (19, 2)) AS custom_license_money
-        FROM product_market_data
-        WHERE product_id = #{productId}
-        <if test="categoryArea != null and categoryArea != ''">
-            AND sale_Area = #{categoryArea}
-        </if>
-        GROUP BY market_date
-    </select>
+    <select id="getProductCategoryCount" resultType="java.lang.Long">
+       select count(*) from (select distinct category.id as id
+        from product_category as category
+        left join product as product
+        on category.id = product.category_id
+        <if test="sql!=''">
 
-    <!--按照月份返回每个-->
-    <select id="queryByMonth" resultMap="queryByDateMap">
-        SELECT CONCAT(YEAR(CONCAT(sale_time,'-02')),'-',MONTH(CONCAT(sale_time,'-02'))) AS market_date,
-        sum(sale_money) AS sale_total_money,
-        CAST(sum(custom_license_rate * sale_money) AS DECIMAL (19, 2)) AS custom_license_money
-        FROM product_market_data
-        WHERE product_id = #{productId}
-        <if test="categoryArea != null and categoryArea != ''">
-            AND sale_Area = #{categoryArea}
+            where ${sql}
         </if>
-        GROUP BY market_date
+        ) as c
     </select>
-
-
-    <!--根据架构id查询产品id和名称-->
-    <resultMap id="idNameMap" type="cn.cslg.pas.common.model.vo.ProductIdAndNameVO">
-        <result column="product_id" property="productId"/>
-        <result column="product_name" property="productName"/>
-    </resultMap>
-
-    <select id="queryProductIdAndNameByCategoryId" resultMap="idNameMap">
-        SELECT id AS product_id,product_name
-        FROM product
-        WHERE product_category_id = #{categoryId}
-        <if test="companyName != null and companyName != ''">
-            AND company_name = #{companyName}
+    <select id="getGroups" resultType="java.lang.String">
+        select ${selectField} from ${tableName}
+        <if test="sqls.get(0)!=''">
+            where ${sqls.get(0)}
         </if>
+        group by ${groupField} ${sqls.get(1)} ${sqls.get(2)}
     </select>
 
-
-    <!--根据产品id、架构id和专利号集合三者其一查询地区集合-->
-    <resultMap id="getAreaListMap" type="String">
-        <result column="sale_area" property="saleArea"/>
-    </resultMap>
-
-
-    <select id="getAreaList" resultMap="getAreaListMap">
-        SELECT DISTINCT sale_area
-        FROM product_market_data a left join product b on a.product_id =b.id
-        <where>
-            <if test="productId != null and productId != ''">
-                a.product_id = #{productId} and b.tenant_id=#{tenantId}
-            </if>
-            <if test="categoryId !=null and categoryId != ''">
-                product_id
-                IN(
-                SELECT id
-                FROM product
-                WHERE
-                product_category_id = #{categoryId})
-                and tenant_id=#{tenantId}
-            </if>
-            <if test="patentNoList != null and patentNoList.size() > 0 ">
-                product_id IN(
-                SELECT product_id
-                FROM asso_product_patent c left join product d on c.product_id =d.id
-                WHERE c.patent_no IN
-                <foreach collection="patentNoList" item="patentNo" index="index" open="(" close=")" separator=",">
-                    #{patentNo}
-                </foreach>
-                and d.tenant_id=#{tenantId}
-                )
-            </if>
-        </where>
+    <select id="getGroupsCount" resultType="java.lang.Long">
+        select count(*) from (select ${selectField} from ${tableName}
+        <if test="sqls.get(0)!=''">
+            where ${sqls.get(0)}
+        </if>
+        group by ${groupField}
+        ) as c
     </select>
 </mapper>

+ 38 - 420
target/classes/mapper/ProductMapper.xml

@@ -1,430 +1,48 @@
 <?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">
-
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
 <mapper namespace="cn.cslg.pas.mapper.ProductMapper">
-    <!--插入数据-->
-    <!--int insert(Product product);-->
-    <insert id="insert" useGeneratedKeys="true" keyProperty="id">
-        insert into product (product_name, market_time, company_name, tenant_id, create_person_tenant_id,
-                             product_explain, product_category_id, license_rate, create_person_id, create_person_name)
-        values (#{productName}, #{marketTime}, #{companyName}, #{tenantId}, #{createPersonTenantId}, #{productExplain},
-                #{productCategoryId}, #{licenseRate}, #{createPersonId}, #{createPersonName});
-    </insert>
-
-    <!--根据id删除产品-->
-    <!--int deleteById(Integer id);-->
-    <delete id="deleteById">
-        delete
-        from product
-        where id = #{id}
-    </delete>
-
-    <!--根据产品id修改数据-->
-    <!--int updateById(Product product);-->
-    <update id="updateById">
-        update product
-        <set>
-            product_name = #{productName},
-            market_time = #{marketTime},
-            company_name = #{companyName},
-            <if test="tenantId != null">
-                tenant_id = #{tenantId},
-            </if>
-            <if test="createPersonTenantId != null">
-                create_person_tenant_id = #{createPersonTenantId},
-            </if>
-            product_explain = #{productExplain},
-            product_category_id = #{productCategoryId},
-            license_rate = #{licenseRate},
-
-        </set>
-        where id = #{id}
-    </update>
-
-    <!--根据产品名称统计数量-->
-    <!--int countByProductName(String productName, Integer productCategoryId);-->
-    <select id="countByProductName" resultType="int">
+    <!--namespace根据自己需要创建的的mapper的路径和名称填写-->
+    <select id="getProduct" resultType="cn.cslg.pas.common.vo.business.ProductVO">
+        select product.id as id ,product.name as name , product.license_rate as licenseRate
+        ,product.category_id as categoryId,product.show_type as showType
+        ,product.description as description,
+        product.create_id as createId, product.tenant_id as tenantId,
+        product.market_time as
+        marketTime,product.create_time as createTime,
+        product.company_name,product.description as description
+        from
+        product as product left join product_category as category
+        on category.id = product.category_id
+        <if test="sql1!=''">
+            where ${sql1}
+        </if>
+        ${sql2} ${sql3}
+    </select>
+
+    <select id="getProductCount" resultType="java.lang.Long">
         select count(*)
-        from product
-        where product_name = #{productName}
-          and product_category_id = #{productCategoryId}
-    </select>
+        from product as product left join product_category as category
+        on category.id = product.category_id
+        <if test="sql!=''">
 
-    <!--根据id统计数量-->
-    <!--int countById(Integer id);-->
-    <select id="countById" resultType="int">
-        select count(*)
-        from product
-        where id = #{id}
-    </select>
+            where ${sql}
+        </if>
 
-    <!--根据id查询名称-->
-    <!-- String queryNameById(Integer id);;-->
-    <select id="queryNameById" resultType="String">
-        select product_Name
-        from product
-        where id = #{id}
     </select>
 
-
-    <!--根据所属产品类别id统计数量-->
-    <!--int countByProductCategoryId(Integer productCategoryId);-->
-    <select id="countByProductCategoryId" resultType="int">
-        select count(*)
-        from product
-        where product_category_id = #{productCategoryId}
-    </select>
-
-    <!--根据id查询数据-->
-    <!--ProductVO getStandardById(Integer id);-->
-    <select id="getStandardById" resultMap="queryMap">
-        select id as p_id,
-               product_name,
-               market_time,
-               company_name,
-               tenant_id,
-               product_explain,
-               product_category_id,
-               license_rate,
-               create_person_name
+    <select id="getProductOrCategoryNameOrder" resultType="cn.cslg.pas.common.vo.ProductOrCategoryVO">
+        select *
+        from (select id as id, name as name, 2 as type
         from product
-        where id = #{id}
+        union all
+        select id as id, name as name, 3 as type
+        from product_category) as c
+        order by name
+        <if test="orderType==0">
+            asc
+        </if>
+        <if test="orderType!=0">
+            desc
+        </if>
     </select>
-
-    <!--分页查询数据-->
-    <!--List<ProductVO> query(ProductQueryPageDTO productQueryPageDTO);-->
-    <select id="query" resultMap="queryMap">
-        select p.id p_id,
-        product_name,
-        market_time,
-        company_name,
-        p.tenant_id,
-        create_person_tenant_id,
-        product_explain,
-        product_category_id,
-        p.license_rate,
-        p.create_person_name,
-        product_category_name
-        from product p
-        join product_category pc on p.product_category_id = pc.id
-        <where>
-            <if test="productName != null and productName != ''">
-                and product_name like '%${productName}%'
-            </if>
-            <if test="companyName != null and companyName != ''">
-                and company_name like '%${companyName}%'
-            </if>
-            <if test="patentNo != null and patentNo != ''">
-                and p.id in
-                (select product_id from asso_product_patent where patent_no = #{patentNo})
-            </if>
-            <if test="productCategoryId != null and productCategoryId != ''">
-                and product_category_id = #{productCategoryId}
-            </if>
-            <if test="productCategoryName != null and productCategoryName != ''">
-                and product_category_id in (select id from product_category where product_category_name like
-                '%${productCategoryName}%')
-            </if>
-            <if test="true">
-                and create_person_tenant_id = #{createPersonTenantId}
-            </if>
-        </where>
-        order by
-        <choose>
-            <when test="orderBy != null and orderBy != ''">
-                ${orderBy} ${orderType}
-            </when>
-            <otherwise>
-                p_id
-            </otherwise>
-        </choose>
-    </select>
-
-    <resultMap id="queryMap" type="cn.cslg.pas.common.model.vo.ProductVO">
-        <id column="p_id" property="id"/>
-        <result column="product_name" property="productName"/>
-        <result column="market_time" property="marketTime"/>
-        <result column="company_name" property="companyName"/>
-        <result column="tenant_id" property="tenantId"/>
-        <result column="product_explain" property="productExplain"/>
-        <result column="product_category_id" property="productCategoryId"/>
-        <result column="license_rate" property="licenseRate"/>
-        <result column="create_person_name" property="createPersonName"/>
-        <collection property="pictures" ofType="cn.cslg.pas.common.model.vo.ProductPictureVO"
-                    select="query2" column="{p_id=p_id}">
-        </collection>
-        <collection property="productPatentNum" ofType="Integer"
-                    select="query3" column="{p_id=p_id}">
-        </collection>
-        <collection property="patentNum" ofType="Integer"
-                    select="query33" column="{p_id=p_id}">
-        </collection>
-        <collection property="productCategory" ofType="cn.cslg.pas.common.model.vo.ProductCategoryVO"
-                    select="query4" column="{pc_id=product_category_id}">
-        </collection>
-    </resultMap>
-
-    <select id="query2" resultMap="query2Map">
-        select id, product_id, name, suffix, url
-        from asso_product_picture
-        where product_id = #{p_id}
-    </select>
-
-    <resultMap id="query2Map" type="cn.cslg.pas.common.model.vo.ProductPictureVO">
-        <id column="id" property="id"/>
-        <result column="product_id" property="productId"/>
-        <result column="name" property="name"/>
-        <result column="suffix" property="suffix"/>
-        <result column="url" property="url"/>
-    </resultMap>
-
-    <select id="query3" resultType="Integer">
-        select count(distinct patent_no)
-        from asso_product_patent
-        where product_id = #{p_id}
-    </select>
-
-    <select id="query33" resultType="Integer">
-        select count(distinct patent_no)
-        from asso_structure_patent
-        where product_id = #{p_id}
-    </select>
-
-    <select id="query4" resultMap="query4Map">
-        select id pc_id,
-               product_category_name,
-               remark,
-               license_rate,
-               create_person_name
-        from product_category
-        where id = #{pc_id}
-    </select>
-
-    <resultMap id="query4Map" type="cn.cslg.pas.common.model.vo.ProductCategoryVO">
-        <id column="pc_id" property="id"/>
-        <result column="product_category_name" property="productCategoryName"/>
-        <result column="remark" property="remark"/>
-        <result column="license_rate" property="licenseRate"/>
-        <result column="create_person_name" property="createPersonName"/>
-        <collection property="pictures" ofType="cn.cslg.pas.common.model.vo.ProductCategoryPictureVO"
-                    select="query41" column="pc_id">
-        </collection>
-    </resultMap>
-
-    <select id="query41" resultMap="query41Map">
-        select id, product_category_id, name, suffix, url
-        from asso_product_category_picture
-        where product_category_id = #{pc_id}
-    </select>
-
-    <resultMap id="query41Map" type="cn.cslg.pas.common.model.vo.ProductCategoryPictureVO">
-        <id column="id" property="id"/>
-        <result column="product_category_id" property="productCategoryId"/>
-        <result column="name" property="name"/>
-        <result column="suffix" property="suffix"/>
-        <result column="url" property="url"/>
-    </resultMap>
-
-    <!--根据产品类别分组分页查询数据-->
-    <!--List<ProductGroupVO> queryByGroupProductCategoryId(ProductQueryPageDTO productQueryPageDTO);-->
-    <select id="queryByGroupProductCategoryId" resultMap="queryByGroupProductCategoryIdMap">
-        select product_category_id pci,
-        product_category_name,
-        create_person_tenant_id as createPersonTenantId,
-        ifnull(#{orderBy}, '') orderBy,
-        ifnull(#{orderType}, '') orderType,
-        ifnull(#{productName}, '') productName,
-        ifnull(#{companyName}, '') companyName,
-        ifnull(#{patentNo}, '') patentNo,
-        ifnull(#{productCategoryId}, '') productCategoryId,
-        ifnull(#{productCategoryName}, '') productCategoryName
-        from product p
-        join product_category pc on p.product_category_id = pc.id
-        <where>
-            <if test="productName != null and productName != ''">
-                and product_name like '%${productName}%'
-            </if>
-            <if test="companyName != null and companyName != ''">
-                and company_name like '%${companyName}%'
-            </if>
-            <if test="patentNo != null and patentNo != ''">
-                and p.id in
-                (select product_id from asso_product_patent where patent_no = #{patentNo})
-            </if>
-            <if test="productCategoryId != null and productCategoryId != ''">
-                and product_category_id = #{productCategoryId}
-            </if>
-            <if test="productCategoryName != null and productCategoryName != ''">
-                and product_category_id in (select id from product_category where product_category_name like
-                '%${productCategoryName}%')
-            </if>
-            <if test="true">
-                and p.create_person_tenant_id = #{createPersonTenantId}
-            </if>
-        </where>
-        group by product_category_id
-        order by product_category_id
-    </select>
-
-    <resultMap id="queryByGroupProductCategoryIdMap" type="cn.cslg.pas.common.model.vo.ProductGroupVO">
-        <result column="product_category_id" property="productCategoryId"/>
-        <result column="product_category_name" property="productCategoryName"/>
-        <collection property="products" ofType="cn.cslg.pas.common.model.vo.ProductVO"
-                    select="queryByGroupProductCategoryId2"
-                    column="{pci=pci, orderBy=orderBy, orderType=orderType, productName=productName, companyName=companyName,
-                             patentNo=patentNo, productCategoryId=productCategoryId, productCategoryName=productCategoryName, createPersonTenantId=createPersonTenantId}">
-        </collection>
-    </resultMap>
-
-    <select id="queryByGroupProductCategoryId2" resultMap="queryMap">
-        select p.id p_id,
-        product_name,
-        market_time,
-        company_name,
-        p.tenant_id,
-        product_explain,
-        product_category_id,
-        p.license_rate,
-        p.create_person_name,
-        product_category_name
-        from product p
-        join product_category pc on p.product_category_id = pc.id
-        <where>
-            <if test="productName != null and productName != ''">
-                and product_name like '%${productName}%'
-            </if>
-            <if test="companyName != null and companyName != ''">
-                and company_name like '%${companyName}%'
-            </if>
-            <if test="patentNo != null and patentNo != ''">
-                and p.id in
-                (select product_id from asso_product_patent where patent_no = #{patentNo}
-                union select product_id from asso_structure_patent where patent_no = #{patentNo})
-            </if>
-            <if test="productCategoryId != null and productCategoryId != ''">
-                and product_category_id = #{productCategoryId}
-            </if>
-            <if test="productCategoryName != null and productCategoryName != ''">
-                and product_category_id in (select id from product_category where product_category_name like
-                '%${productCategoryName}%')
-            </if>
-            <if test="true">
-                and product_category_id = #{pci}
-            </if>
-            <if test="true">
-                and p.create_person_tenant_id = #{createPersonTenantId}
-            </if>
-        </where>
-        order by
-        <choose>
-            <when test="orderBy != null and orderBy != ''">
-                ${orderBy} ${orderType}
-            </when>
-            <otherwise>
-                p_id
-            </otherwise>
-        </choose>
-    </select>
-
-    <!--根据公司分组分页查询数据-->
-    <!--List<ProductGroupVO> queryByGroupCompanyName(ProductQueryPageDTO productQueryPageDTO);-->
-    <select id="queryByGroupCompanyName" resultMap="queryByGroupCompanyNameMap">
-        select company_name cn,
-        create_person_tenant_id as createPersonTenantId,
-        ifnull(#{orderBy}, '') orderBy,
-        ifnull(#{orderType}, '') orderType,
-        ifnull(#{productName}, '') productName,
-        ifnull(#{companyName}, '') companyName,
-        ifnull(#{patentNo}, '') patentNo,
-        ifnull(#{productCategoryId}, '') productCategoryId,
-        ifnull(#{productCategoryName}, '') productCategoryName
-        from product
-        <where>
-            <if test="productName != null and productName != ''">
-                and product_name like '%${productName}%'
-            </if>
-            <if test="companyName != null and companyName != ''">
-                and company_name like '%${companyName}%'
-            </if>
-            <if test="patentNo != null and patentNo != ''">
-                and id in
-                (select product_id from asso_product_patent where patent_no = #{patentNo})
-            </if>
-            <if test="productCategoryId != null and productCategoryId != ''">
-                and product_category_id = #{productCategoryId}
-            </if>
-            <if test="productCategoryName != null and productCategoryName != ''">
-                and product_category_id in (select id from product_category where product_category_name like
-                '%${productCategoryName}%')
-            </if>
-            <if test="true">
-                and company_name is not null
-            </if>
-            <if test="true">
-                and create_person_tenant_id = #{createPersonTenantId}
-            </if>
-        </where>
-        group by company_name
-        order by company_name
-    </select>
-
-    <resultMap id="queryByGroupCompanyNameMap" type="cn.cslg.pas.common.model.vo.ProductGroupVO">
-        <result column="cn" property="companyName"/>
-        <collection property="products" ofType="cn.cslg.pas.common.model.vo.ProductVO"
-                    select="queryByGroupCompanyName2"
-                    column="{cn=cn, orderBy=orderBy, orderType=orderType, productName=productName, companyName=companyName,
-                             patentNo=patentNo, productCategoryId=productCategoryId, productCategoryName=productCategoryName, createPersonTenantId=createPersonTenantId}">
-        </collection>
-    </resultMap>
-
-    <select id="queryByGroupCompanyName2" resultMap="queryMap">
-        select p.id p_id,
-        product_name,
-        market_time,
-        company_name,
-        p.tenant_id,
-        product_explain,
-        product_category_id,
-        p.license_rate,
-        p.create_person_name,
-        product_category_name
-        from product p
-        join product_category pc on p.product_category_id = pc.id
-        <where>
-            <if test="productName != null and productName != ''">
-                and product_name like '%${productName}%'
-            </if>
-            <if test="companyName != null and companyName != ''">
-                and company_name like '%${companyName}%'
-            </if>
-            <if test="patentNo != null and patentNo != ''">
-                and p.id in
-                (select product_id from asso_product_patent where patent_no = #{patentNo}
-                union select product_id from asso_structure_patent where patent_no = #{patentNo})
-            </if>
-            <if test="productCategoryId != null and productCategoryId != ''">
-                and product_category_id = #{productCategoryId}
-            </if>
-            <if test="productCategoryName != null and productCategoryName != ''">
-                and product_category_id in (select id from product_category where product_category_name like
-                '%${productCategoryName}%')
-            </if>
-            <if test="true">
-                and company_name = #{cn}
-            </if>
-            <if test="true">
-                and p.create_person_tenant_id = #{createPersonTenantId}
-            </if>
-        </where>
-        order by
-        <choose>
-            <when test="orderBy != null and orderBy != ''">
-                ${orderBy} ${orderType}
-            </when>
-            <otherwise>
-                p_id
-            </otherwise>
-        </choose>
-    </select>
-
 </mapper>

+ 81 - 124
target/classes/mapper/ProductMarketDataMapper.xml

@@ -1,144 +1,101 @@
 <?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">
-
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
 <mapper namespace="cn.cslg.pas.mapper.ProductMarketDataMapper">
-    <!--插入数据-->
-    <!--int insert(ProductMarketData productMarketData);-->
-    <insert id="insert" useGeneratedKeys="true" keyProperty="id">
-        insert into product_market_data (product_id, sale_time, sale_area, sale_count, sale_money,
-                                         custom_license_rate, create_person_id, create_person_name)
-        values (#{productId}, #{saleTime}, #{saleArea}, #{saleCount}, #{saleMoney}, #{customLicenseRate},
-                #{createPersonId}, #{createPersonName});
-    </insert>
+    <!--namespace根据自己需要创建的的mapper的路径和名称填写-->
+    <select id="getProductMarketData" resultType="cn.cslg.pas.common.vo.business.ProductMarketDataVO">
+        select id, product_id as productId, sale_time as saleTime, sale_area as saleArea, sale_count as saleCount,
+        sale_money as saleMoney, custom_license_rate as customLicenseRate, create_id as createId,create_time as
+        createTime from product_market_data as pmd
+        <if test="sql1!=''">
 
-    <!--根据id删除数据-->
-    <!--int deleteById(Integer id);-->
-    <delete id="deleteById">
-        delete
-        from product_market_data
-        where id = #{id}
-    </delete>
+            where ${sql1}
+        </if>
+        ${sql2} ${sql3}
+    </select>
 
-    <!--根据id修改数据-->
-    <!--int update(ProductMarketData productMarketData);-->
-    <update id="update">
-        update product_market_data
-        <set>
-            <if test="productId != null">
-                product_id = #{productId},
-            </if>
-                sale_time = #{saleTime},
-                sale_area = #{saleArea},
-                sale_count = #{saleCount},
-                sale_money = #{saleMoney},
-                custom_license_rate = #{customLicenseRate},
+    <select id="getProductMarketDataCount" resultType="java.lang.Long">
+        select count(*) from product_market_data as pmd
+        <if test="sql!=''">
 
-        </set>
-        where id = #{id}
-    </update>
+            where ${sql}
+        </if>
+    </select>
 
-    <!--根据所属产品id、营销地区、营销时间统计数量-->
-    <!--int countByProductIdSaleAreaSaleTime(Integer productId, String saleArea, Date saleTime);-->
-    <select id="countByProductIdSaleAreaSaleTime" resultType="int">
-        select count(*)
-        from product_market_data
-        <where>
-            <if test="productId != null">
-                and product_id = #{productId}
-            </if>
-            <if test="saleArea != null">
-                and sale_area = #{saleArea}
-            </if>
-            <if test="saleTime != null">
-                and sale_time = #{saleTime}
-            </if>
-        </where>
+    <select id="getGroups" resultType="cn.cslg.pas.common.vo.GroupMarketDataVO">
+        select ${selectField} as marketDate,sum(sale_money) as saleMoneyTotal ,CAST(sum(custom_license_rate * sale_money)
+        AS DECIMAL (19, 2)) AS customLicenseMoney from ${tableName}
+        <if test="sqls.get(0)!=''">
+            where ${sqls.get(0)}
+        </if>
+        group by ${groupField} ${sqls.get(1)}  ${sqls.get(2)}
+    </select>
+
+    <select id="getPartGroups" resultType="cn.cslg.pas.common.vo.GroupMarketDataVO">
+        select pmd.product_id as productId, ${selectField} as marketDate,sum(sale_money) as saleMoneyTotal ,CAST(sum(custom_license_rate * sale_money)
+        AS DECIMAL (19, 2)) AS customLicenseMoney from ${tableName}
+        <if test="sqls.get(0)!=''">
+            where ${sqls.get(0)}
+        </if>
+        group by ${groupField},pmd.product_id ${sqls.get(1)}  ${sqls.get(2)}
     </select>
 
-    <!--根据id统计数量-->
-    <!--int countById(Integer id);-->
-    <select id="countById" resultType="int">
-        select count(*)
-        from product_market_data
-        where id = #{id}
+    <select id="getGroupsCount" resultType="java.lang.Long">
+        select count(*) from (select ${selectField} from ${tableName}
+        <if test="sqls.get(0)!=''">
+            where ${sqls.get(0)}
+        </if>
+        group by ${groupField}
     </select>
 
-    <!--分页查询数据-->
-    <!--List<ProductMarketDataVO> query(ProductMarketDataQueryPageDTO productMarketDataQueryPageDTO);-->
-    <select id="query" resultMap="queryMap">
-        select id,
-        product_id,
-        sale_time,
-        sale_area,
-        sale_count,
-        sale_money,
-        custom_license_rate
-        from product_market_data
+    <select id="selectSaleMonthList" resultType="cn.cslg.pas.common.dto.es.SelectValueCurveDTO">
+        select sale_area as saleArea,
+               sum(sale_money) as saleMoney,
+               DATE_FORMAT(sale_time, '%Y-%m') as saleTime,
+               sum(sale_money*custom_license_rate) as customLicense
+        from pas_prod2.product_market_data
         <where>
-            <if test="productId != null">
-                product_id = #{productId}
+            <if test="productIds != null and productIds.size > 0">
+                product_id in
+                <foreach collection="productIds" item="productId" index="index" open="(" separator="," close=")">
+                    #{productId}
+                </foreach>
             </if>
         </where>
-        order by
-        <choose>
-            <when test="orderBy != null and orderType != null">
-                ${orderBy} ${orderType}
-            </when>
-            <otherwise>
-                id desc
-            </otherwise>
-        </choose>
+        group by saleTime;
     </select>
 
-    <resultMap id="queryMap" type="cn.cslg.pas.common.model.vo.ProductMarketDataVO">
-        <id column="id" property="id"/>
-        <result column="product_id" property="productId"/>
-        <result column="sale_time" property="saleTime"/>
-        <result column="sale_area" property="saleArea"/>
-        <result column="sale_count" property="saleCount"/>
-        <result column="sale_money" property="saleMoney"/>
-        <result column="custom_license_rate" property="customLicenseRate"/>
-    </resultMap>
-
-    <resultMap id="queryByDateMap" type="cn.cslg.pas.common.model.vo.ProductMarketDataTrendVO">
-        <result column="market_date" property="marketDate"/>
-        <result column="sale_total_money" property="saleTotalMoney"/>
-        <result column="custom_license_money" property="customLicenseMoney"/>
-    </resultMap>
-
-    <select id="queryByYear" resultMap="queryByDateMap">
-        SELECT CONCAT(YEAR(CONCAT(sale_time,'-02')),'年') AS market_date,
-            sum(sale_money) AS sale_total_money,
-            CAST(sum(custom_license_rate * sale_money) AS DECIMAL (19, 2)) AS custom_license_money
-        FROM  product_market_data
-        WHERE product_id = #{productId}
-        <if test="saleArea != null and saleArea != ''">
-            AND sale_Area = #{saleArea}
-        </if>
-        GROUP BY market_date
+    <select id="selectSaleYearList" resultType="cn.cslg.pas.common.dto.es.SelectValueCurveDTO">
+        select sale_area as saleArea,
+               sum(sale_money) as saleMoney,
+               CONCAT(DATE_FORMAT(sale_time, '%Y'),'年') as saleTime,
+               sum(sale_money*custom_license_rate) as customLicense
+               from pas_prod2.product_market_data
+        <where>
+            <if test="productIds != null and productIds.size > 0">
+                product_id in
+                <foreach collection="productIds" item="productId" index="index" open="(" separator="," close=")">
+                    #{productId}
+                </foreach>
+            </if>
+        </where>
+        group by saleTime;
     </select>
 
-    <select id="queryBySeason" resultMap="queryByDateMap">
-        SELECT CONCAT(YEAR(CONCAT(sale_time,'-02')),'年','第',QUARTER(CONCAT(sale_time,'-02')),'季度') AS market_date,
-            sum(sale_money) AS sale_total_money,
-            CAST(sum(custom_license_rate * sale_money) AS DECIMAL (19, 2)) AS custom_license_money
-        FROM  product_market_data
-        WHERE product_id = #{productId}
-        <if test="saleArea != null and saleArea != ''">
-            AND sale_Area = #{saleArea}
-        </if>
-        GROUP BY market_date
+    <select id="selectSaleQuarterList" resultType="cn.cslg.pas.common.dto.es.SelectValueCurveDTO">
+        select sale_area as saleArea,
+               sum(sale_money) as saleMoney,
+               CONCAT(YEAR(sale_time),'年第',quarter(sale_time),'季度') as saleTime,
+               sum(sale_money*custom_license_rate) as customLicense
+               from pas_prod2.product_market_data
+        <where>
+            <if test="productIds != null and productIds.size > 0">
+                product_id in
+                <foreach collection="productIds" item="productId" index="index" open="(" separator="," close=")">
+                    #{productId}
+                </foreach>
+            </if>
+        </where>
+        group by saleTime;
     </select>
 
-    <select id="queryByMonth" resultMap="queryByDateMap">
-        SELECT CONCAT(YEAR(CONCAT(sale_time,'-02')),'-',MONTH(CONCAT(sale_time,'-02'))) AS market_date,
-            sum(sale_money) AS sale_total_money,
-            CAST(sum(custom_license_rate * sale_money) AS DECIMAL (19, 2)) AS custom_license_money
-        FROM  product_market_data
-        WHERE product_id = #{productId}
-        <if test="saleArea != null and saleArea != ''">
-            AND sale_Area = #{saleArea}
-        </if>
-        GROUP BY market_date
-    </select>
 </mapper>

+ 2 - 2
target/classes/mapper/WebLoginConfigMapper.xml

@@ -2,8 +2,8 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 
 <mapper namespace="cn.cslg.pas.mapper.WebLoginConfigMapper">
-    <select id="getPageList" parameterType="cn.cslg.pas.common.model.vo.QueryConfigVO"
-            resultType="cn.cslg.pas.common.model.vo.ConfigVO">
+    <select id="getPageList" parameterType="cn.cslg.pas.common.vo.QueryConfigVO"
+            resultType="cn.cslg.pas.common.vo.ConfigVO">
         select web_name as webName,web_address as webAddress ,login_account as loginAccount ,login_password as
         loginPassword,b.id as id
         ,a.id as webId