Przeglądaj źródła

添加历史分享查询

koushanshan 1 rok temu
rodzic
commit
0b98331a92

+ 11 - 0
src/main/java/com/dk/oauth/controller/integral/IntegralShareController.java

@@ -65,4 +65,15 @@ public class IntegralShareController{
         return integralShareService.insert(integralShareVO);
         return integralShareService.insert(integralShareVO);
     }
     }
 
 
+    /**
+     * @desc   : 查询历史记录分页、关联、条件查询
+     * @date   : 2024/7/30 16:05
+     * @author : 寇珊珊
+     */
+    @ApiOperation(value = "查询历史记录分页、关联、条件查询", notes = "查询历史记录分页、关联、条件查询")
+    @PostMapping({"select_history_record"})
+    public ResponseResultVO<PageList<IntegralShareResponse>> selectHistoryRecord(@RequestBody IntegralShareQuery integralShareQuery ) {
+        return integralShareService.selectHistoryRecord(integralShareQuery);
+    }
+
 }
 }

+ 8 - 0
src/main/java/com/dk/oauth/mapper/integral/IntegralShareMapper.java

@@ -37,5 +37,13 @@ public interface IntegralShareMapper extends BaseMapper<IntegralShare>{
      * @author : 寇珊珊
      * @author : 寇珊珊
      */
      */
     Long countByCond(IntegralShareQuery integralShareQuery);
     Long countByCond(IntegralShareQuery integralShareQuery);
+
+    /**
+     * @desc   : 查询历史记录
+     * @date   : 2024/7/30 15:58
+     * @author : 寇珊珊
+     */
+    List<IntegralShareResponse> selectHistoryRecordByCond(IntegralShareQuery integralShareQuery);
+
 }
 }
 
 

+ 19 - 0
src/main/java/com/dk/oauth/mapper/integral/IntegralShareMapper.xml

@@ -35,6 +35,7 @@
         <result column="cp_name" property="cpName"/>
         <result column="cp_name" property="cpName"/>
         <result column="integral_type" property="integralType"/>
         <result column="integral_type" property="integralType"/>
         <result column="integral_type_name" property="integralTypeName"/>
         <result column="integral_type_name" property="integralTypeName"/>
+        <result column="number_of_shares" property="numberOfShares"/>
     </resultMap>
     </resultMap>
 
 
     <!-- 通用条件列 -->
     <!-- 通用条件列 -->
@@ -156,4 +157,22 @@
             )
             )
         </foreach>
         </foreach>
     </insert>
     </insert>
+
+
+    <!-- 查询历史记录(条件查询+分页)列表 -->
+    <select id="selectHistoryRecordByCond" resultMap="BaseResultMapResponse">
+        SELECT
+        <include refid="Base_Column_List_Response"/>
+        ,tac.cp_name
+        ,sys.f_get_name_i18n(tdk.kind_name_i18n,#{i18n}) as integral_type_name
+        ,(select  count(1) from  dkic_a.t_mst_integral_item tmii where tmii.cp_id = tmis.cp_id) as number_of_shares
+        FROM dkic_a.t_mst_integral_share tmis
+        left join dkic_a.t_a_company tac on tac.cp_id = tmis.cp_id
+        LEFT JOIN sys.t_data_kind tdk ON tmis.integral_type = tdk.kind_code
+        <include refid="Condition"/>
+        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
+            limit #{end} offset #{start}
+        </if>
+    </select>
+
 </mapper>
 </mapper>

+ 4 - 0
src/main/java/com/dk/oauth/model/response/integral/IntegralShareResponse.java

@@ -117,6 +117,10 @@ public class IntegralShareResponse {
     @ApiModelProperty(value = "积分类型 (【系统字典】注册;签到;分享;使用)")
     @ApiModelProperty(value = "积分类型 (【系统字典】注册;签到;分享;使用)")
     private String integralTypeName;
     private String integralTypeName;
 
 
+    @Excel(name = "分享个数")
+    @ApiModelProperty(value = "分享个数")
+    private String numberOfShares;
+
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
 
 
 }
 }

+ 11 - 0
src/main/java/com/dk/oauth/service/integral/IntegralShareService.java

@@ -95,6 +95,7 @@ public class IntegralShareService extends BaseService<IntegralShare> {
 					.setShareDateFlag(true)
 					.setShareDateFlag(true)
 					.setIntegralType(Constant.IntegralType.INTEGRAL_TYPE_INVITE.getName())
 					.setIntegralType(Constant.IntegralType.INTEGRAL_TYPE_INVITE.getName())
 			);
 			);
+
 			//积分策略可每日分享次数  是否等于 当日已经分享的次数
 			//积分策略可每日分享次数  是否等于 当日已经分享的次数
 			if(shareSize >0 ){
 			if(shareSize >0 ){
 				//当日已进行过邀请
 				//当日已进行过邀请
@@ -135,4 +136,14 @@ public class IntegralShareService extends BaseService<IntegralShare> {
 		return  ResponseResultUtil.success();
 		return  ResponseResultUtil.success();
 	}
 	}
 
 
+	/**
+	 * @desc   : 查询历史记录
+	 * @date   : 2024/7/24 15:47
+	 * @author : 寇珊珊
+	 */
+	@Pagination
+	public ResponseResultVO<PageList<IntegralShareResponse>> selectHistoryRecord(IntegralShareQuery integralShareQuery) {
+		return super.mergeListWithCount(integralShareQuery, integralShareMapper.selectHistoryRecordByCond(integralShareQuery),
+				integralShareMapper.countByCond(integralShareQuery));
+	}
 }
 }