Browse Source

联建活动查询test1

master
yinzuomei 3 years ago
parent
commit
86d1de24e7
  1. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java
  2. 81
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml

8
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java

@ -102,14 +102,14 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
@Override
public PageData<IcPartyActivityDTO> search(PartyActivityFormDTO formDTO) {
if (null == formDTO.getStartTime()) {
/*if (null == formDTO.getStartTime()) {
Date startDate = DateUtils.parse("1900-01-01 00:00:00", DateUtils.DATE_TIME_PATTERN);
formDTO.setStartTime(startDate);
}
if (null == formDTO.getEndTime()) {
Date endDate = DateUtils.parse("2099-12-31 00:00:00", DateUtils.DATE_TIME_PATTERN);
formDTO.setEndTime(endDate);
}
}*/
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
List<IcPartyActivityEntity> list = baseDao.selectActivityList(formDTO);
PageInfo<IcPartyActivityEntity> pageInfo = new PageInfo<>(list);
@ -159,14 +159,14 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
@Override
public List<IcPartyActivityDTO> list(PartyActivityFormDTO formDTO) {
if (null == formDTO.getStartTime()) {
/*if (null == formDTO.getStartTime()) {
Date startDate = DateUtils.parse("1900-01-01 00:00:00", DateUtils.DATE_TIME_PATTERN);
formDTO.setStartTime(startDate);
}
if (null == formDTO.getEndTime()) {
Date endDate = DateUtils.parse("2099-12-31 00:00:00", DateUtils.DATE_TIME_PATTERN);
formDTO.setEndTime(endDate);
}
}*/
List<IcPartyActivityEntity> list = baseDao.selectActivityList(formDTO);
List<IcPartyActivityDTO> dtoList = ConvertUtils.sourceToTarget(list, IcPartyActivityDTO.class);

81
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml

@ -51,55 +51,27 @@
a.ID,
a.ACT_ID,
a.GRID_ID,
b.unitId,
c.serviceMatter,
TITLE,
TARGET,
CONTENT,
PEOPLE_COUNT,
ACTIVITY_TIME,
ADDRESS,
LONGITUDE,
LATITUDE,
RESULT,
ur.UNIT_ID,
GROUP_CONCAT( sr.SERVICE_MATTER ) AS serviceMatter,
a.TITLE,
a.TARGET,
a.CONTENT,
a.PEOPLE_COUNT,
a.ACTIVITY_TIME,
a.ADDRESS,
a.LONGITUDE,
a.LATITUDE,
a.RESULT,
a.AGENCY_ID,
a.CUSTOMER_ID
FROM
ic_party_activity a
INNER JOIN (
SELECT
ur.ACTIVITY_ID,
GROUP_CONCAT( ur.UNIT_ID ) AS unitId
FROM
ic_activity_unit_relation ur
WHERE
ur.DEL_FLAG = '0'
<if test='null != agencyId and "" != agencyId'>
AND (ur.AGENCY_ID = #{agencyId} or ur.PIDS like concat('%',#{agencyId},'%'))
</if>
<if test='null != unitId and "" != unitId'>
AND ur.UNIT_ID = #{unitId}
</if>
GROUP BY
ur.ACTIVITY_ID
) b ON a.ID = b.ACTIVITY_ID
INNER JOIN (
SELECT
sr.ACTIVITY_ID,
GROUP_CONCAT( sr.SERVICE_MATTER ) AS serviceMatter
FROM
ic_activity_service_relation sr
WHERE
sr.DEL_FLAG = '0'
<if test='null != agencyId and "" != agencyId'>
AND (sr.AGENCY_ID = #{agencyId} or sr.PIDS like concat('%',#{agencyId},'%'))
</if>
<if test='null != serviceMatter and "" != serviceMatter'>
AND sr.SERVICE_MATTER = #{serviceMatter}
</if>
GROUP BY
sr.ACTIVITY_ID
) c ON a.ID = c.ACTIVITY_ID
left join ic_activity_unit_relation ur
on (ur.ACTIVITY_ID=a.id
and ur.del_flag='0')
left JOIN ic_activity_service_relation sr
on(a.ID = sr.ACTIVITY_ID
and sr.del_flag='0')
WHERE
a.DEL_FLAG = '0'
<if test='null != agencyId and "" != agencyId'>
@ -109,11 +81,22 @@
AND a.GRID_ID = #{gridId}
</if>
<if test='null != title and "" != title'>
AND TITLE LIKE concat('%', #{title}, '%')
AND a.TITLE LIKE concat('%', #{title}, '%')
</if>
AND ACTIVITY_TIME BETWEEN #{startTime} AND #{endTime}
ORDER BY ACTIVITY_TIME DESC
<if test='null != unitId and "" != unitId'>
AND ur.UNIT_ID = #{unitId}
</if>
<if test='null != serviceMatter and "" != serviceMatter'>
AND sr.SERVICE_MATTER = #{serviceMatter}
</if>
<if test=" null != startTime and startTime != '' ">
AND a.ACTIVITY_TIME <![CDATA[ >= ]]> #{startTime}
</if>
<if test="null != endTime and endTime != '' ">
AND a.ACTIVITY_TIME <![CDATA[ <= ]]> #{endTime}
</if>
GROUP BY a.id
ORDER BY a.ACTIVITY_TIME DESC
</select>
<select id="getActivityList" resultType="com.epmet.entity.IcPartyActivityEntity" parameterType = "com.epmet.dto.form.PartyActivityFormDTO">

Loading…
Cancel
Save