Browse Source

分页查询

dev
yinzuomei 3 years ago
parent
commit
cc09e3c628
  1. 51
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/icpartyact/result/IcPartyActPageResultDTO.java
  2. 6
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActController.java
  3. 9
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyActDao.java
  4. 3
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyActService.java
  5. 10
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java
  6. 44
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActDao.xml

51
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/icpartyact/result/IcPartyActPageResultDTO.java

@ -1,8 +1,10 @@
package com.epmet.resi.partymember.dto.icpartyact.result;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Description
@ -12,5 +14,54 @@ import java.io.Serializable;
@Data
public class IcPartyActPageResultDTO implements Serializable {
private static final long serialVersionUID = 1414832133227703667L;
private String icPartyActId;
/**
* 活动主题
*/
private String topic;
/**
* 发布活动党组织名称
*/
private String publishPartyOrgName;
/**
* 活动发布人姓名
*/
private String publishStaffName;
/**
* 活动类型来源于ic_party_act_type_dict
*/
private String actType;
/**
* 活动类型来源于ic_party_act_type_dict
*/
private String actTypeName;
/**
* 举办活动时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date holdTime;
/**
* 活动地点
*/
private String address;
/**
* 是否发布0未发布1已发布
*/
private String isPublish;
/**
* 活动发布人
*/
private String publishStaffId;
}

6
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActController.java

@ -59,7 +59,7 @@ public class IcPartyActController {
}
/**
* 活动列表分页
* 活动列表分页查询(工作端小程序通用)
* @param tokenDto
* @param formDTO
* @return
@ -74,12 +74,16 @@ public class IcPartyActController {
/**
* 活动列表活动详情
* 居民端小程序活动详情工作端小程序活动详情通用
* @param tokenDto
* @param icPartyActId
* @return
*/
@PostMapping("act-detail/{icPartyActId}")
public Result<IcPartyActDetailResDTO> actDetail(@LoginUser TokenDto tokenDto, @PathVariable("icPartyActId")String icPartyActId){
if(StringUtils.isBlank(icPartyActId)){
return new Result<>();
}
return new Result<IcPartyActDetailResDTO>().ok(icPartyActService.queryActDetail(tokenDto.getCustomerId(),tokenDto.getUserId(),icPartyActId));
}

9
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyActDao.java

@ -2,7 +2,9 @@ package com.epmet.modules.partyOrg.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.partyOrg.entity.IcPartyActEntity;
import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActPageFormDTO;
import com.epmet.resi.partymember.dto.icpartyact.result.IcPartActTypeDTO;
import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActPageResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.ActAndScheduleListFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO;
import org.apache.ibatis.annotations.Mapper;
@ -26,4 +28,11 @@ public interface IcPartyActDao extends BaseDao<IcPartyActEntity> {
List<IcPartActTypeDTO> actTypeList(String customerId);
List<ActAndScheduleListResultDTO.ActivityListDTO> getActivityList(ActAndScheduleListFormDTO formDTO);
/**
* pc活动列表分页
* @param formDTO
* @return
*/
List<IcPartyActPageResultDTO> selectPageList(IcPartyActPageFormDTO formDTO);
}

3
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyActService.java

@ -2,7 +2,6 @@ package com.epmet.modules.partyOrg.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.rocketmq.messages.PartyMeetingMessageMQMsg;
import com.epmet.commons.tools.dto.form.mq.MqBaseFormDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.modules.partyOrg.entity.IcPartyActEntity;
import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActAddOrUpdateFormDTO;
@ -49,7 +48,7 @@ public interface IcPartyActService extends BaseService<IcPartyActEntity> {
Map<String, String> addOrUpdate(IcPartyActAddOrUpdateFormDTO formDTO);
/**
* 活动列表-分页查询
* 活动列表分页查询(工作端小程序通用)
* @param formDTO
* @return
*/

10
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java

@ -35,6 +35,8 @@ import com.epmet.resi.partymember.dto.partyOrg.form.ActAndScheduleListFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.HomeMonthTotalFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -192,7 +194,7 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
/**
* 活动列表-分页查询
* 活动列表分页查询(工作端小程序通用)
*
* @param formDTO
* @return
@ -201,9 +203,9 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
public PageData<IcPartyActPageResultDTO> pageList(IcPartyActPageFormDTO formDTO) {
CustomerStaffInfoCacheResult staffInfo = queryStaffInfo(formDTO.getCustomerId(), formDTO.getPublishStaffId());
formDTO.setStaffAgencyId(staffInfo.getAgencyId());
// todo
return null;
PageInfo<IcPartyActPageResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(),
formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.selectPageList(formDTO));
return new PageData<>(pageInfo.getList(), pageInfo.getTotal());
}
/**

44
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActDao.xml

@ -70,4 +70,48 @@
</if>
AND pa.PUBLISH_ORG_PATH LIKE CONCAT(#{path},'%')
</select>
<select id="selectPageList" parameterType="com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActPageFormDTO" resultType="com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActPageResultDTO">
SELECT
a.ID AS icPartyActId,
a.TOPIC,
a.PUBLISH_PARTY_ORG_NAME AS publishPartyOrgName,
a.PUBLISH_STAFF_NAME AS publishStaffName,
d.TYPE_NAME AS actTypeName,
a.HOLD_TIME,
a.ADDRESS,
a.IS_PUBLISH,
a.PUBLISH_STAFF_ID
FROM
ic_party_act a
LEFT JOIN ic_party_act_type_dict d ON ( a.ACT_TYPE = d.TYPE_KEY )
WHERE
a.DEL_FLAG = '0'
AND a.CUSTOMER_ID = #{customerId}
<if test='null != staffAgencyId and staffAgencyId != "" '>
and a.ORG_ID_PATH CONCAT('%',#{staffAgencyId},'%')
</if>
<if test='null != address and address != "" '>
AND a.ADDRESS LIKE CONCAT('%',#{address},'%')
</if>
<if test='null != topic and topic != "" '>
AND a.TOPIC LIKE concat('%',#{topic},'%')
</if>
<if test='null != isPublish and isPublish != "" '>
AND a.IS_PUBLISH = #{isPublish}
</if>
<if test='null != publishPartyOrgId and publishPartyOrgId != "" '>
AND a.PUBLISH_ORG_PATH LIKE CONCAT('%',#{publishPartyOrgId},'%')
</if>
<if test='null != actType and actType != "" '>
AND a.ACT_TYPE = #{actType}
</if>
<if test='null != startDate and startDate != ""'>
AND DATE_FORMAT(a.HOLD_TIME,'%Y%m%d') >= #{startDate}
</if>
<if test='null != endDate and endDate != ""'>
AND DATE_FORMAT(a.HOLD_TIME,'%Y%m%d') <![CDATA[ <= ]]> #{endDate}
</if>
order by a.HOLD_TIME desc
</select>
</mapper>
Loading…
Cancel
Save