Browse Source

出生管理列表接口更改为sql查询

master
wanggongfeng 3 years ago
parent
commit
61a7c9aac5
  1. 80
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BirthRecordListFormDTO.java
  2. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcBirthRecordDao.java
  3. 15
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcBirthRecordServiceImpl.java
  4. 82
      epmet-user/epmet-user-server/src/main/resources/mapper/IcBirthRecordDao.xml

80
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BirthRecordListFormDTO.java

@ -0,0 +1,80 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/5/10 10:02
*/
@NoArgsConstructor
@Data
public class BirthRecordListFormDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = 5077167613040462646L;
/**
* 客户ID
*/
private String customerId;
private String staffId;
private String icResiUserId;
/**
* 组织Id
*/
private String agencyId;
/**
* 网格ID
*/
private String gridId;
/**
* 小区ID
*/
private String villageId;
/**
* 楼栋ID
*/
private String buildId;
/**
* 单元ID
*/
private String unitId;
/**
* 房屋ID
*/
private String homeId;
/**
* 姓名
*/
private String name;
/**
* 手机
*/
private String mobile;
/**
* 身份证
*/
private String idCard;
/**
* 性别
*/
private String gender;
/**
* 出生日开始
*/
private String startTime;
/**
* 出生日期结束
*/
private String endTime;
/**
* 是否福利
*/
private String isWelfare;
}

10
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcBirthRecordDao.java

@ -1,9 +1,13 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcBirthRecordDTO;
import com.epmet.dto.form.BirthRecordListFormDTO;
import com.epmet.entity.IcBirthRecordEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 出生管理
*
@ -12,5 +16,7 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface IcBirthRecordDao extends BaseDao<IcBirthRecordEntity> {
}
List<IcBirthRecordDTO> selectListByEntity(BirthRecordListFormDTO birthRecordListFormDTO);
}

15
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcBirthRecordServiceImpl.java

@ -23,6 +23,7 @@ import com.epmet.dao.IcResiUserDao;
import com.epmet.dto.ChangeWelfareDTO;
import com.epmet.dto.IcBirthRecordDTO;
import com.epmet.dto.form.BirthRecordFormDTO;
import com.epmet.dto.form.BirthRecordListFormDTO;
import com.epmet.dto.form.BirthRecordUpdateDTO;
import com.epmet.dto.form.IcResiUserTransferFormDTO;
import com.epmet.dto.result.AllGridsByUserIdResultDTO;
@ -79,10 +80,16 @@ public class IcBirthRecordServiceImpl extends BaseServiceImpl<IcBirthRecordDao,
}
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage());
LambdaQueryWrapper<IcBirthRecordEntity> wrapper = getWrapper(formDTO, staffInfo);
List<IcBirthRecordEntity> entityList = baseDao.selectList(wrapper);
PageInfo<IcBirthRecordEntity> pageInfo = new PageInfo<>(entityList);
List<IcBirthRecordDTO> list = ConvertUtils.sourceToTarget(entityList, IcBirthRecordDTO.class);
// LambdaQueryWrapper<IcBirthRecordEntity> wrapper = getWrapper(formDTO, staffInfo);
// List<IcBirthRecordEntity> entityList = baseDao.selectList(wrapper);
BirthRecordListFormDTO birthRecordListFormDTO = ConvertUtils.sourceToTarget(formDTO, BirthRecordListFormDTO.class);
birthRecordListFormDTO.setAgencyId(staffInfo.getAgencyId());
List<IcBirthRecordDTO> list = baseDao.selectListByEntity(birthRecordListFormDTO);
PageInfo<IcBirthRecordDTO> pageInfo = new PageInfo<>(list);
// List<IcBirthRecordDTO> list = ConvertUtils.sourceToTarget(entityList, IcBirthRecordDTO.class);
if (CollectionUtils.isNotEmpty(list)) {
//查询网格名称

82
epmet-user/epmet-user-server/src/main/resources/mapper/IcBirthRecordDao.xml

@ -34,6 +34,86 @@
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="selectListByEntity" parameterType="com.epmet.dto.form.BirthRecordListFormDTO" resultType="com.epmet.dto.IcBirthRecordDTO">
select
iru.ID as icResiUserId,
ibr.ID,
ibr.CUSTOMER_ID,
ibr.AGENCY_ID,
ibr.PIDS,
ibr.GRID_ID,
ibr.VILLAGE_ID,
ibr.BUILD_ID,
ibr.UNIT_ID,
ibr.HOME_ID,
ibr.NAME,
ibr.MOBILE,
ibr.GENDER,
ibr.ID_CARD,
ibr.BIRTHDAY,
ibr.BIRTHPLACE,
ibr.IS_WELFARE,
ibr.FATHER,
ibr.MOTHER,
ibr.COUNT,
ibr.REPORT_DATE,
ibr.HOUSEHOLDER_NAME,
ibr.HOUSEHOLDER_RELATION,
ibr.IS_CHECK,
ibr.DEL_FLAG,
ibr.REVISION,
ibr.CREATED_BY,
ibr.CREATED_TIME,
ibr.UPDATED_BY,
ibr.UPDATED_TIME
from ic_birth_record ibr
left join ic_resi_user iru on iru.ID_CARD = ibr.ID_CARD and iru.DEL_FLAG = 0
where ibr.DEL_FLAG = 0
<if test='customerId != "" and customerId != null'>
AND ibr.CUSTOMER_ID = #{customerId}
</if>
<if test='agencyId != "" and agencyId != null'>
AND (ibr.AGENCY_ID = #{agencyId} or FIND_IN_SET(#{agencyId},ibr.PIDS))
</if>
<if test='gridId != "" and gridId != null'>
AND ibr.GRID_ID = #{gridId}
</if>
<if test='villageId != "" and villageId != null'>
AND ibr.VILLAGE_ID = #{villageId}
</if>
<if test='buildId != "" and buildId != null'>
AND ibr.BUILD_ID = #{buildId}
</if>
<if test='unitId != "" and unitId != null'>
AND ibr.UNIT_ID = #{unitId}
</if>
<if test='homeId != "" and homeId != null'>
AND ibr.HOME_ID = #{homeId}
</if>
<if test='gender != "" and gender != null'>
AND ibr.GENDER = #{gender}
</if>
<if test='isWelfare != "" and isWelfare != null'>
AND ibr.IS_WELFARE = #{isWelfare}
</if>
<if test='name != "" and name != null'>
AND ibr.NAME like concat('%',#{name},'%')
</if>
<if test='mobile != "" and mobile != null'>
AND ibr.MOBILE like concat('%',#{mobile},'%')
</if>
<if test='idCard != "" and idCard != null'>
AND ibr.ID_CARD like concat('%',#{idCard},'%')
</if>
<if test='startTime != "" and startTime != null'>
AND ibr.BIRTHDAY <![CDATA[>=]]> #{startTime}
</if>
<if test='endTime != "" and endTime != null'>
AND ibr.BIRTHDAY <![CDATA[<=]]> #{endTime}
</if>
order by ibr.CREATED_TIME desc
</select>
</mapper>
</mapper>

Loading…
Cancel
Save