forked from luyan/epmet-cloud-lingshan
				
			
				 18 changed files with 0 additions and 962 deletions
			
			
		@ -1,26 +0,0 @@ | 
				
			|||
package com.epmet.dataaggre.dto.epmetuser.form; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import javax.validation.constraints.NotBlank; | 
				
			|||
import java.io.Serializable; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Description 查看详情,回显表单 | 
				
			|||
 * @Author yinzuomei | 
				
			|||
 * @Date 2021/10/27 10:22 下午 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class IcResiDetailFormDTO implements Serializable { | 
				
			|||
    public interface AddUserInternalGroup { | 
				
			|||
    } | 
				
			|||
    @NotBlank(message = "icResiUserId不能为空",groups = AddUserInternalGroup.class) | 
				
			|||
    private String icResiUserId; | 
				
			|||
 | 
				
			|||
    @NotBlank(message = "formCode不能为空", groups = AddUserInternalGroup.class) | 
				
			|||
    private String formCode; | 
				
			|||
 | 
				
			|||
    @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) | 
				
			|||
    private String customerId; | 
				
			|||
} | 
				
			|||
 | 
				
			|||
@ -1,38 +0,0 @@ | 
				
			|||
package com.epmet.dataaggre.dto.epmetuser.form; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import javax.validation.constraints.NotBlank; | 
				
			|||
import javax.validation.constraints.NotNull; | 
				
			|||
import java.io.Serializable; | 
				
			|||
import java.util.List; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Description 居民信息,分页查询入参 | 
				
			|||
 * @Author yinzuomei | 
				
			|||
 * @Date 2021/10/27 2:06 下午 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class IcResiUserPageFormDTO implements Serializable { | 
				
			|||
    public interface AddUserInternalGroup { | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @NotNull(message = "pageNo不能为空", groups = AddUserInternalGroup.class) | 
				
			|||
    private Integer pageNo; | 
				
			|||
 | 
				
			|||
    @NotNull(message = "pageSize不能为空", groups = AddUserInternalGroup.class) | 
				
			|||
    private Integer pageSize; | 
				
			|||
 | 
				
			|||
    @NotBlank(message = "formCode不能为空", groups = AddUserInternalGroup.class) | 
				
			|||
    private String formCode; | 
				
			|||
 | 
				
			|||
    @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) | 
				
			|||
    private String customerId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 表对应的字段及值 | 
				
			|||
     */ | 
				
			|||
    private List<ResiUserQueryValueDTO> conditions; | 
				
			|||
    private Boolean pageFlag; | 
				
			|||
} | 
				
			|||
 | 
				
			|||
@ -1,20 +0,0 @@ | 
				
			|||
package com.epmet.dataaggre.dto.epmetuser.form; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import java.io.Serializable; | 
				
			|||
import java.util.List; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Description TODO | 
				
			|||
 * @Author yinzuomei | 
				
			|||
 * @Date 2021/10/27 6:02 下午 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class ResiUserQueryValueDTO implements Serializable { | 
				
			|||
    private String queryType; | 
				
			|||
    private List<String> columnValue; | 
				
			|||
    private String columnName; | 
				
			|||
    private String tableName; | 
				
			|||
} | 
				
			|||
 | 
				
			|||
@ -1,173 +0,0 @@ | 
				
			|||
package com.epmet.dataaggre.dto.epmetuser.result; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import java.io.Serializable; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Description 居民信息分页查询表单返参 | 
				
			|||
 * @Author yinzuomei | 
				
			|||
 * @Date 2021/10/27 2:07 下午 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class IcResiUserPageResultDTO implements Serializable { | 
				
			|||
    private String icResiUserId; | 
				
			|||
    private String gridId; | 
				
			|||
    private String gridName; | 
				
			|||
    /** | 
				
			|||
     * 所属小区ID | 
				
			|||
     */ | 
				
			|||
    private String villageId; | 
				
			|||
    private String vallageName; | 
				
			|||
 | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 所属楼宇Id | 
				
			|||
     */ | 
				
			|||
    private String buildId; | 
				
			|||
    private String buildName; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 单元id | 
				
			|||
     */ | 
				
			|||
    private String unitId; | 
				
			|||
    private String unitName; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 所属家庭Id | 
				
			|||
     */ | 
				
			|||
    private String homeId; | 
				
			|||
    private String homeName; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 姓名 | 
				
			|||
     */ | 
				
			|||
    private String name; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 手机号 | 
				
			|||
     */ | 
				
			|||
    private String mobile; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 性别 | 
				
			|||
     */ | 
				
			|||
    private String gender; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 身份证号 | 
				
			|||
     */ | 
				
			|||
    private String idCard; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 出生日期 | 
				
			|||
     */ | 
				
			|||
    private String birthday; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 备注 | 
				
			|||
     */ | 
				
			|||
    private String remarks; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 是否党员 | 
				
			|||
     */ | 
				
			|||
    private Boolean isParty; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 是否低保户 | 
				
			|||
     */ | 
				
			|||
    private Boolean isDbh; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 是否保障房 | 
				
			|||
     */ | 
				
			|||
    private Boolean isEnsureHouse; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 是否失业 | 
				
			|||
     */ | 
				
			|||
    private Boolean isUnemployed; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 是否育龄妇女 | 
				
			|||
     */ | 
				
			|||
    private Boolean isYlfn; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 是否退役军人 | 
				
			|||
     */ | 
				
			|||
    private Boolean isVeterans; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 是否统战人员 | 
				
			|||
     */ | 
				
			|||
    private Boolean isUnitedFront; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 是否信访人员 | 
				
			|||
     */ | 
				
			|||
    private Boolean isXfry; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 是否志愿者 | 
				
			|||
     */ | 
				
			|||
    private Boolean isVolunteer; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 是否老年人 | 
				
			|||
     */ | 
				
			|||
    private Boolean isOldPeople; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 是否空巢 | 
				
			|||
     */ | 
				
			|||
    private Boolean isKc; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 是否失独 | 
				
			|||
     */ | 
				
			|||
    private Boolean isSd; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 是否失能 | 
				
			|||
     */ | 
				
			|||
    private Boolean isSn; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 是否失智 | 
				
			|||
     */ | 
				
			|||
    private Boolean isSz; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 是否残疾 | 
				
			|||
     */ | 
				
			|||
    private Boolean isCj; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 是否大病 | 
				
			|||
     */ | 
				
			|||
    private Boolean isDb; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 是否慢病 | 
				
			|||
     */ | 
				
			|||
    private Boolean isMb; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 是否特殊人群 | 
				
			|||
     */ | 
				
			|||
    private Boolean isSpecial; | 
				
			|||
 | 
				
			|||
 | 
				
			|||
    // 以下属性都需要单独处理,不是直接取数据库的字段
 | 
				
			|||
    private String demandCategoryIds; | 
				
			|||
 | 
				
			|||
    private String demandName; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 房屋类型,1楼房,2平房,3别墅 | 
				
			|||
     */ | 
				
			|||
    private String houseType; | 
				
			|||
} | 
				
			|||
 | 
				
			|||
@ -1,61 +0,0 @@ | 
				
			|||
package com.epmet.dataaggre.dto.govorg.result; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import java.io.Serializable; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Description TODO | 
				
			|||
 * @Author yinzuomei | 
				
			|||
 * @Date 2021/10/28 2:05 下午 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class HouseInfoDTO implements Serializable { | 
				
			|||
    private static final long serialVersionUID = -5204197079709062825L; | 
				
			|||
    /** | 
				
			|||
     * 所属家庭Id | 
				
			|||
     */ | 
				
			|||
    private String homeId; | 
				
			|||
 | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 小区id | 
				
			|||
     */ | 
				
			|||
    private String neighborHoodId; | 
				
			|||
    /** | 
				
			|||
     * 小区名称 | 
				
			|||
     */ | 
				
			|||
    private String neighborHoodName; | 
				
			|||
 | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 所属楼栋id | 
				
			|||
     */ | 
				
			|||
    private String buildingId; | 
				
			|||
    /** | 
				
			|||
     * 楼栋名称 | 
				
			|||
     */ | 
				
			|||
    private String buildingName; | 
				
			|||
 | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 所属单元id | 
				
			|||
     */ | 
				
			|||
    private String buildingUnitId; | 
				
			|||
    /** | 
				
			|||
     * 单元名 | 
				
			|||
     */ | 
				
			|||
    private String unitName; | 
				
			|||
 | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 门牌号 | 
				
			|||
     */ | 
				
			|||
    private String doorName; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 房屋类型,1楼房,2平房,3别墅 | 
				
			|||
     */ | 
				
			|||
    private String houseType; | 
				
			|||
} | 
				
			|||
 | 
				
			|||
@ -1,72 +0,0 @@ | 
				
			|||
package com.epmet.dataaggre.controller; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.tools.annotation.LoginUser; | 
				
			|||
import com.epmet.commons.tools.page.PageData; | 
				
			|||
import com.epmet.commons.tools.security.dto.TokenDto; | 
				
			|||
import com.epmet.commons.tools.utils.Result; | 
				
			|||
import com.epmet.commons.tools.validator.ValidatorUtils; | 
				
			|||
import com.epmet.dataaggre.dto.epmetuser.form.IcResiDetailFormDTO; | 
				
			|||
import com.epmet.dataaggre.dto.epmetuser.form.IcResiUserPageFormDTO; | 
				
			|||
import com.epmet.dataaggre.dto.epmetuser.result.IcResiUserPageResultDTO; | 
				
			|||
import com.epmet.dataaggre.service.epmetuser.IcResiUserService; | 
				
			|||
import org.springframework.beans.factory.annotation.Autowired; | 
				
			|||
import org.springframework.web.bind.annotation.RequestBody; | 
				
			|||
import org.springframework.web.bind.annotation.RequestMapping; | 
				
			|||
import org.springframework.web.bind.annotation.RestController; | 
				
			|||
 | 
				
			|||
import java.util.Map; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Description TODO | 
				
			|||
 * @Author yinzuomei | 
				
			|||
 * @Date 2021/10/27 2:03 下午 | 
				
			|||
 */ | 
				
			|||
@RestController | 
				
			|||
@RequestMapping("icresiuser") | 
				
			|||
public class IcResiUserController { | 
				
			|||
 | 
				
			|||
    @Autowired | 
				
			|||
    private IcResiUserService icResiUserService; | 
				
			|||
 | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 分页查询居民信息列表 | 
				
			|||
     * | 
				
			|||
     * @param tokenDto | 
				
			|||
     * @param pageFormDTO | 
				
			|||
     * @return  com.epmet.commons.tools.utils.Result<com.epmet.commons.tools.page.PageData<com.epmet.dataaggre.dto.epmetuser.result.IcResiUserPageResultDTO>> | 
				
			|||
     * @author yinzuomei | 
				
			|||
     * @date 2021/10/28 10:29 上午 | 
				
			|||
     */ | 
				
			|||
    //@PostMapping("listresi1")
 | 
				
			|||
    public Result<PageData<IcResiUserPageResultDTO>> queryListResi(@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO){ | 
				
			|||
        //pageFormDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");
 | 
				
			|||
        pageFormDTO.setCustomerId(tokenDto.getCustomerId()); | 
				
			|||
        ValidatorUtils.validateEntity(pageFormDTO,IcResiUserPageFormDTO.AddUserInternalGroup.class); | 
				
			|||
        return new Result<PageData<IcResiUserPageResultDTO>>().ok(icResiUserService.pageResi(pageFormDTO)); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    //@PostMapping("listresi")
 | 
				
			|||
    public Result<PageData<Map<String,Object>>> queryListResi1(@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO){ | 
				
			|||
        //pageFormDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");
 | 
				
			|||
        pageFormDTO.setCustomerId(tokenDto.getCustomerId()); | 
				
			|||
        ValidatorUtils.validateEntity(pageFormDTO,IcResiUserPageFormDTO.AddUserInternalGroup.class); | 
				
			|||
        return new Result<PageData<Map<String,Object>>>().ok(icResiUserService.pageResiMap(pageFormDTO)); | 
				
			|||
    } | 
				
			|||
    /** | 
				
			|||
     * 编辑页面,显示居民信息详情 | 
				
			|||
     * | 
				
			|||
     * @param pageFormDTO | 
				
			|||
     * @return  com.epmet.commons.tools.utils.Result | 
				
			|||
     * @author yinzuomei | 
				
			|||
     * @date 2021/10/28 10:29 上午 | 
				
			|||
     */ | 
				
			|||
    //@PostMapping("detail")
 | 
				
			|||
    public Result queryIcResiDetail(@LoginUser TokenDto tokenDto,@RequestBody IcResiDetailFormDTO pageFormDTO){ | 
				
			|||
        //pageFormDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");
 | 
				
			|||
        pageFormDTO.setCustomerId(tokenDto.getCustomerId()); | 
				
			|||
        ValidatorUtils.validateEntity(pageFormDTO,IcResiDetailFormDTO.AddUserInternalGroup.class); | 
				
			|||
        return new Result().ok(icResiUserService.queryIcResiDetail(pageFormDTO)); | 
				
			|||
    } | 
				
			|||
} | 
				
			|||
 | 
				
			|||
@ -1,45 +0,0 @@ | 
				
			|||
package com.epmet.dataaggre.dao.epmetuser; | 
				
			|||
 | 
				
			|||
import com.epmet.dataaggre.dto.epmetuser.IcFormResColumnDTO; | 
				
			|||
import com.epmet.dataaggre.dto.epmetuser.form.ResiUserQueryValueDTO; | 
				
			|||
import com.epmet.dataaggre.dto.epmetuser.result.IcResiUserPageResultDTO; | 
				
			|||
import org.apache.ibatis.annotations.Mapper; | 
				
			|||
import org.apache.ibatis.annotations.Param; | 
				
			|||
 | 
				
			|||
import java.util.List; | 
				
			|||
import java.util.Map; | 
				
			|||
 | 
				
			|||
@Mapper | 
				
			|||
public interface IcResiUserDao { | 
				
			|||
    List<IcResiUserPageResultDTO> selectListResi(@Param("customerId") String customerId, | 
				
			|||
                                                 @Param("formCode") String formCode, | 
				
			|||
                                                 @Param("conditions") List<ResiUserQueryValueDTO> conditions, | 
				
			|||
                                                 @Param("resultColumns") List<IcFormResColumnDTO> resultColumns, | 
				
			|||
                                                 @Param("subTables") List<String> subTables); | 
				
			|||
    List<Map<String,Object>> selectListResiMap(@Param("customerId") String customerId, | 
				
			|||
                                                 @Param("formCode") String formCode, | 
				
			|||
                                                 @Param("conditions") List<ResiUserQueryValueDTO> conditions, | 
				
			|||
                                                 @Param("resultColumns") List<IcFormResColumnDTO> resultColumns, | 
				
			|||
                                                 @Param("subTables") List<String> subTables); | 
				
			|||
    /** | 
				
			|||
     * 查询主表 | 
				
			|||
     * | 
				
			|||
     * @param icResiUserId | 
				
			|||
     * @return  java.util.List<java.util.Map<java.lang.String,java.lang.Object>> | 
				
			|||
     * @author yinzuomei | 
				
			|||
     * @date 2021/10/28 11:20 上午 | 
				
			|||
     */ | 
				
			|||
    List<Map<String, Object>> selectById(String icResiUserId); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 根据ic_resi_user.id去查询各个子表记录,动态传入表名 | 
				
			|||
     * | 
				
			|||
     * @param icResiUserId | 
				
			|||
     * @param tableName | 
				
			|||
     * @return  java.util.List<java.util.Map<java.lang.String,java.lang.Object>> | 
				
			|||
     * @author yinzuomei | 
				
			|||
     * @date 2021/10/28 11:19 上午 | 
				
			|||
     */ | 
				
			|||
    List<Map<String, Object>> selectSubTableRecords(@Param("icResiUserId") String icResiUserId,@Param("tableName") String tableName); | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -1,32 +0,0 @@ | 
				
			|||
package com.epmet.dataaggre.service.epmetuser; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.tools.page.PageData; | 
				
			|||
import com.epmet.dataaggre.dto.epmetuser.form.IcResiDetailFormDTO; | 
				
			|||
import com.epmet.dataaggre.dto.epmetuser.form.IcResiUserPageFormDTO; | 
				
			|||
import com.epmet.dataaggre.dto.epmetuser.result.IcResiUserPageResultDTO; | 
				
			|||
 | 
				
			|||
import java.util.Map; | 
				
			|||
 | 
				
			|||
public interface IcResiUserService { | 
				
			|||
    /** | 
				
			|||
     * 分页查询居民信息列表 | 
				
			|||
     * | 
				
			|||
     * @param pageFormDTO | 
				
			|||
     * @return  com.epmet.commons.tools.page.PageData<com.epmet.dataaggre.dto.epmetuser.result.IcResiUserPageResultDTO> | 
				
			|||
     * @author yinzuomei | 
				
			|||
     * @date 2021/10/28 10:30 上午 | 
				
			|||
     */ | 
				
			|||
    @Deprecated | 
				
			|||
    PageData<IcResiUserPageResultDTO> pageResi(IcResiUserPageFormDTO pageFormDTO); | 
				
			|||
 | 
				
			|||
    PageData<Map<String,Object>> pageResiMap(IcResiUserPageFormDTO formDTO); | 
				
			|||
    /** | 
				
			|||
     * 编辑页面,显示居民信息详情 | 
				
			|||
     * | 
				
			|||
     * @param pageFormDTO | 
				
			|||
     * @return  java.util.Map | 
				
			|||
     * @author yinzuomei | 
				
			|||
     * @date 2021/10/28 10:29 上午 | 
				
			|||
     */ | 
				
			|||
     Map queryIcResiDetail(IcResiDetailFormDTO pageFormDTO); | 
				
			|||
} | 
				
			|||
@ -1,255 +0,0 @@ | 
				
			|||
package com.epmet.dataaggre.service.epmetuser.impl; | 
				
			|||
 | 
				
			|||
import com.alibaba.fastjson.JSON; | 
				
			|||
import com.epmet.commons.dynamic.datasource.annotation.DataSource; | 
				
			|||
import com.epmet.commons.tools.constant.NumConstant; | 
				
			|||
import com.epmet.commons.tools.constant.StrConstant; | 
				
			|||
import com.epmet.commons.tools.enums.GenderEnum; | 
				
			|||
import com.epmet.commons.tools.enums.HouseTypeEnum; | 
				
			|||
import com.epmet.commons.tools.page.PageData; | 
				
			|||
import com.epmet.dataaggre.constant.DataSourceConstant; | 
				
			|||
import com.epmet.dataaggre.constant.OrgConstant; | 
				
			|||
import com.epmet.dataaggre.dao.epmetuser.IcResiUserDao; | 
				
			|||
import com.epmet.dataaggre.dto.epmetuser.IcFormResColumnDTO; | 
				
			|||
import com.epmet.dataaggre.dto.epmetuser.form.IcResiDetailFormDTO; | 
				
			|||
import com.epmet.dataaggre.dto.epmetuser.form.IcResiUserPageFormDTO; | 
				
			|||
import com.epmet.dataaggre.dto.epmetuser.result.IcResiUserPageResultDTO; | 
				
			|||
import com.epmet.dataaggre.dto.govorg.result.GridsInfoListResultDTO; | 
				
			|||
import com.epmet.dataaggre.dto.govorg.result.HouseInfoDTO; | 
				
			|||
import com.epmet.dataaggre.service.epmetuser.IcResiUserService; | 
				
			|||
import com.epmet.dataaggre.service.govorg.GovOrgService; | 
				
			|||
import com.epmet.dataaggre.service.opercustomize.CustomerFootBarService; | 
				
			|||
import com.github.pagehelper.PageHelper; | 
				
			|||
import com.github.pagehelper.PageInfo; | 
				
			|||
import lombok.extern.slf4j.Slf4j; | 
				
			|||
import org.apache.commons.lang3.StringUtils; | 
				
			|||
import org.springframework.beans.factory.annotation.Autowired; | 
				
			|||
import org.springframework.stereotype.Service; | 
				
			|||
import org.springframework.util.CollectionUtils; | 
				
			|||
 | 
				
			|||
import java.util.*; | 
				
			|||
import java.util.function.Function; | 
				
			|||
import java.util.stream.Collectors; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Description TODO | 
				
			|||
 * @Author yinzuomei | 
				
			|||
 * @Date 2021/10/27 2:04 下午 | 
				
			|||
 */ | 
				
			|||
@Service | 
				
			|||
@DataSource(DataSourceConstant.EPMET_USER) | 
				
			|||
@Slf4j | 
				
			|||
public class IcResiUserServiceImpl implements IcResiUserService { | 
				
			|||
    @Autowired | 
				
			|||
    private IcResiUserDao icResiUserDao; | 
				
			|||
    @Autowired | 
				
			|||
    private CustomerFootBarService customerFootBarService; | 
				
			|||
    @Autowired | 
				
			|||
    private GovOrgService govOrgService; | 
				
			|||
 | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 分页查询居民信息列表 | 
				
			|||
     * | 
				
			|||
     * @param formDTO | 
				
			|||
     * @return com.epmet.commons.tools.page.PageData<com.epmet.dataaggre.dto.epmetuser.result.IcResiUserPageResultDTO> | 
				
			|||
     * @author yinzuomei | 
				
			|||
     * @date 2021/10/28 10:30 上午 | 
				
			|||
     */ | 
				
			|||
    @Override | 
				
			|||
    public PageData<IcResiUserPageResultDTO> pageResi(IcResiUserPageFormDTO formDTO) { | 
				
			|||
        // 查询列表展示项,如果没有,直接返回
 | 
				
			|||
        List<IcFormResColumnDTO> resultColumns = customerFootBarService.queryConditions(formDTO.getCustomerId(), formDTO.getFormCode()); | 
				
			|||
        if (CollectionUtils.isEmpty(resultColumns)) { | 
				
			|||
            log.warn("没有配置列表展示列"); | 
				
			|||
            return new PageData(new ArrayList(), NumConstant.ZERO); | 
				
			|||
        } | 
				
			|||
        log.warn("列表展示项:" + JSON.toJSONString(resultColumns)); | 
				
			|||
        // 查询列表展示项需要用到哪些子表
 | 
				
			|||
        // 拼接好的left join table_name on (ic_resi_user.ID=table_name.IC_RESI_USER AND table_name.del_flag='0')
 | 
				
			|||
        List<String> subTables = customerFootBarService.querySubTables(formDTO.getCustomerId(), formDTO.getFormCode()); | 
				
			|||
        log.warn("子表:" + JSON.toJSONString(subTables)); | 
				
			|||
       /* Set<String> subTableList=resultColumns.stream().filter(item->!item.getTableName().equals("ic_resi_user") | 
				
			|||
                                            && StringUtils.isNotBlank(item.getLink())) | 
				
			|||
                                        .map(IcFormResColumnDTO :: getTableName).collect(Collectors.toSet()); | 
				
			|||
        List<String> subTables=new ArrayList<>(); | 
				
			|||
        subTableList.forEach(tableName->{ | 
				
			|||
            //'left join ',temp.TABLE_NAME, ' on ( ic_resi_user.ID=',temp.TABLE_NAME,'.IC_RESI_USER  and ',temp.TABLE_NAME,'.del_flag="0" )'
 | 
				
			|||
            String joinSql=String.format("% join %s on ( ic_resi_user.ID=%s.IC_RESI_USER  and %s.del_flag=\"0\" "); | 
				
			|||
            subTables.add(joinSql); | 
				
			|||
        });*/ | 
				
			|||
        PageInfo<IcResiUserPageResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), | 
				
			|||
                formDTO.getPageSize()).doSelectPageInfo(() -> icResiUserDao.selectListResi(formDTO.getCustomerId(), | 
				
			|||
                formDTO.getFormCode(), | 
				
			|||
                formDTO.getConditions(), | 
				
			|||
                resultColumns, | 
				
			|||
                subTables)); | 
				
			|||
        List<IcResiUserPageResultDTO> list = pageInfo.getList(); | 
				
			|||
        //查询网格名称
 | 
				
			|||
        List<String> gridIds = list.stream().map(IcResiUserPageResultDTO::getGridId).collect(Collectors.toList()); | 
				
			|||
        log.warn("gridIds:" + JSON.toJSONString(gridIds)); | 
				
			|||
 | 
				
			|||
        List<GridsInfoListResultDTO> gridInfoList = govOrgService.gridListByIds(gridIds); | 
				
			|||
        log.warn(JSON.toJSONString(gridInfoList)); | 
				
			|||
 | 
				
			|||
        Map<String, GridsInfoListResultDTO> gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(GridsInfoListResultDTO::getGridId, Function.identity())); | 
				
			|||
 | 
				
			|||
        //查询房子名称
 | 
				
			|||
        Set<String> houseIds = list.stream().map(IcResiUserPageResultDTO::getHomeId).collect(Collectors.toSet()); | 
				
			|||
        List<HouseInfoDTO> houseInfoDTOList = govOrgService.queryHouseInfo(houseIds); | 
				
			|||
        Map<String, HouseInfoDTO> houseInfoMap = houseInfoDTOList.stream().collect(Collectors.toMap(HouseInfoDTO::getHomeId, Function.identity())); | 
				
			|||
        for (IcResiUserPageResultDTO resultDTO : list) { | 
				
			|||
            if (null != gridInfoMap && gridInfoMap.containsKey(resultDTO.getGridId())) { | 
				
			|||
                resultDTO.setGridName(gridInfoMap.get(resultDTO.getGridId()).getGridName()); | 
				
			|||
            } | 
				
			|||
            if (null != houseInfoMap && houseInfoMap.containsKey(resultDTO.getHomeId())) { | 
				
			|||
                resultDTO.setBuildName(houseInfoMap.get(resultDTO.getHomeId()).getBuildingName()); | 
				
			|||
                resultDTO.setVallageName(houseInfoMap.get(resultDTO.getHomeId()).getNeighborHoodName()); | 
				
			|||
                resultDTO.setUnitName(houseInfoMap.get(resultDTO.getHomeId()).getUnitName()); | 
				
			|||
                resultDTO.setHomeName(houseInfoMap.get(resultDTO.getHomeId()).getDoorName()); | 
				
			|||
                resultDTO.setHouseType(houseInfoMap.get(resultDTO.getHomeId()).getHouseType()); | 
				
			|||
            } | 
				
			|||
        } | 
				
			|||
        pageInfo.setList(list); | 
				
			|||
        return new PageData<>(pageInfo.getList(), pageInfo.getTotal()); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
 | 
				
			|||
    public PageData<Map<String, Object>> pageResiMap(IcResiUserPageFormDTO formDTO) { | 
				
			|||
        // 查询列表展示项,如果没有,直接返回
 | 
				
			|||
        List<IcFormResColumnDTO> resultColumns = customerFootBarService.queryConditions(formDTO.getCustomerId(), formDTO.getFormCode()); | 
				
			|||
        if (CollectionUtils.isEmpty(resultColumns)) { | 
				
			|||
            log.warn("没有配置列表展示列"); | 
				
			|||
            return new PageData(new ArrayList(), NumConstant.ZERO); | 
				
			|||
        } | 
				
			|||
        // 查询列表展示项需要用到哪些子表
 | 
				
			|||
        // 拼接好的left join table_name on (ic_resi_user.ID=table_name.IC_RESI_USER AND table_name.del_flag='0')
 | 
				
			|||
        List<String> subTables = customerFootBarService.querySubTables(formDTO.getCustomerId(), formDTO.getFormCode()); | 
				
			|||
        PageInfo<Map<String, Object>> pageInfo=new PageInfo<>(); | 
				
			|||
        if (null == formDTO.getPageFlag()||formDTO.getPageFlag()) { | 
				
			|||
            //分页
 | 
				
			|||
            pageInfo= PageHelper.startPage(formDTO.getPageNo(), | 
				
			|||
                    formDTO.getPageSize()).doSelectPageInfo(() -> icResiUserDao.selectListResiMap(formDTO.getCustomerId(), | 
				
			|||
                    formDTO.getFormCode(), | 
				
			|||
                    formDTO.getConditions(), | 
				
			|||
                    resultColumns, | 
				
			|||
                    subTables)); | 
				
			|||
        }else{ | 
				
			|||
            List<Map<String,Object>> list=icResiUserDao.selectListResiMap(formDTO.getCustomerId(), | 
				
			|||
                    formDTO.getFormCode(), | 
				
			|||
                    formDTO.getConditions(), | 
				
			|||
                    resultColumns, | 
				
			|||
                    subTables); | 
				
			|||
            pageInfo.setTotal(CollectionUtils.isEmpty(list)?NumConstant.ZERO:list.size()); | 
				
			|||
            pageInfo.setList(list); | 
				
			|||
        } | 
				
			|||
 | 
				
			|||
        List<Map<String, Object>> list = pageInfo.getList(); | 
				
			|||
        //查询网格名称
 | 
				
			|||
        List<String> gridIds = new ArrayList<>(); | 
				
			|||
        Set<String> houseIds = new HashSet<>(); | 
				
			|||
        for (Map<String, Object> map : list) { | 
				
			|||
            log.warn(JSON.toJSONString(map)); | 
				
			|||
            if (map.containsKey(OrgConstant.GRID_ID) && null != map.get(OrgConstant.GRID_ID) && StringUtils.isNotBlank(map.get(OrgConstant.GRID_ID).toString())) { | 
				
			|||
                gridIds.add(map.get(OrgConstant.GRID_ID).toString()); | 
				
			|||
            } | 
				
			|||
            if (map.containsKey("HOME_ID") && null != map.get("HOME_ID") && StringUtils.isNotBlank(map.get("HOME_ID").toString())) { | 
				
			|||
                houseIds.add(map.get("HOME_ID").toString()); | 
				
			|||
            } | 
				
			|||
        } | 
				
			|||
 | 
				
			|||
        List<GridsInfoListResultDTO> gridInfoList = govOrgService.gridListByIds(gridIds); | 
				
			|||
 | 
				
			|||
        Map<String, GridsInfoListResultDTO> gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(GridsInfoListResultDTO::getGridId, Function.identity())); | 
				
			|||
 | 
				
			|||
        //查询房子名称
 | 
				
			|||
        List<HouseInfoDTO> houseInfoDTOList = govOrgService.queryHouseInfo(houseIds); | 
				
			|||
        Map<String, HouseInfoDTO> houseInfoMap = houseInfoDTOList.stream().collect(Collectors.toMap(HouseInfoDTO::getHomeId, Function.identity())); | 
				
			|||
        for (Map<String, Object> resultMap : list) { | 
				
			|||
            String gridIdValue = null != resultMap.get(OrgConstant.GRID_ID) ? resultMap.get(OrgConstant.GRID_ID).toString() : StrConstant.EPMETY_STR; | 
				
			|||
            resultMap.put("GRID_ID_VALUE", gridIdValue); | 
				
			|||
            if (null != gridInfoMap && gridInfoMap.containsKey(gridIdValue) && null != gridInfoMap.get(gridIdValue)) { | 
				
			|||
                //GRID_NAME
 | 
				
			|||
                resultMap.put(OrgConstant.GRID_ID, gridInfoMap.get(gridIdValue).getGridName()); | 
				
			|||
            } | 
				
			|||
 | 
				
			|||
            String homeId = null != resultMap.get("HOME_ID") ? resultMap.get("HOME_ID").toString() : StrConstant.EPMETY_STR; | 
				
			|||
            resultMap.put("HOME_ID_VALUE", homeId); | 
				
			|||
            if (null != houseInfoMap && houseInfoMap.containsKey(homeId) && null != houseInfoMap.get(homeId)) { | 
				
			|||
                HouseInfoDTO houseInfoDTO = houseInfoMap.get(homeId); | 
				
			|||
                String buildName = StringUtils.isNotBlank(houseInfoDTO.getBuildingName()) ? houseInfoDTO.getBuildingName() : StrConstant.EPMETY_STR; | 
				
			|||
                resultMap.put("BUILD_NAME", buildName); | 
				
			|||
 | 
				
			|||
                String neighBorName = StringUtils.isNotBlank(houseInfoDTO.getNeighborHoodName()) ? houseInfoDTO.getNeighborHoodName() : StrConstant.EPMETY_STR; | 
				
			|||
                resultMap.put("VILLAGE_NAME", neighBorName); | 
				
			|||
 | 
				
			|||
                String unitName = StringUtils.isNotBlank(houseInfoDTO.getUnitName()) ? houseInfoDTO.getUnitName() : StrConstant.EPMETY_STR; | 
				
			|||
                resultMap.put("UNIT_NAME", unitName); | 
				
			|||
 | 
				
			|||
                String doorName = StringUtils.isNotBlank(houseInfoDTO.getDoorName()) ? houseInfoDTO.getDoorName() : StrConstant.EPMETY_STR; | 
				
			|||
                resultMap.put("DOOR_NAME", doorName); | 
				
			|||
 | 
				
			|||
                String houseType = StringUtils.isNotBlank(houseInfoDTO.getHouseType()) ? houseInfoDTO.getHouseType() : StrConstant.EPMETY_STR; | 
				
			|||
                //房屋类型,1楼房,2平房,3别墅
 | 
				
			|||
                resultMap.put(OrgConstant.HOUSE_TYPE_KEY, ""); | 
				
			|||
                if (HouseTypeEnum.LOUFANG.getCode().equals(houseType)) { | 
				
			|||
                    resultMap.put(OrgConstant.HOUSE_TYPE_KEY, HouseTypeEnum.LOUFANG.getName()); | 
				
			|||
                } else if (HouseTypeEnum.PINGFANG.getCode().equals(houseType)) { | 
				
			|||
                    resultMap.put(OrgConstant.HOUSE_TYPE_KEY, HouseTypeEnum.PINGFANG.getName()); | 
				
			|||
                } else if (HouseTypeEnum.BIESHU.getCode().equals(houseType)) { | 
				
			|||
                    resultMap.put(OrgConstant.HOUSE_TYPE_KEY, HouseTypeEnum.BIESHU.getName()); | 
				
			|||
                } | 
				
			|||
 | 
				
			|||
                resultMap.put("HOME_ID", neighBorName.concat(buildName).concat(unitName).concat(doorName)); | 
				
			|||
            } | 
				
			|||
 | 
				
			|||
            if (resultMap.containsKey(OrgConstant.GENDER)) { | 
				
			|||
                String genderValue = null != resultMap.get(OrgConstant.GENDER) ? resultMap.get(OrgConstant.GENDER).toString() : StrConstant.EPMETY_STR; | 
				
			|||
                if (GenderEnum.MAN.getCode().equals(genderValue)) { | 
				
			|||
                    resultMap.put(OrgConstant.GENDER, GenderEnum.MAN.getName()); | 
				
			|||
                } else if (GenderEnum.WOMAN.getCode().equals(genderValue)) { | 
				
			|||
                    resultMap.put(OrgConstant.GENDER, GenderEnum.WOMAN.getName()); | 
				
			|||
                } else if (GenderEnum.UN_KNOWN.getCode().equals(genderValue)) { | 
				
			|||
                    resultMap.put(OrgConstant.GENDER, GenderEnum.UN_KNOWN.getName()); | 
				
			|||
                } | 
				
			|||
            } | 
				
			|||
        } | 
				
			|||
        pageInfo.setList(list); | 
				
			|||
        return new PageData<>(pageInfo.getList(), pageInfo.getTotal()); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 编辑页面,显示居民信息详情 | 
				
			|||
     * | 
				
			|||
     * @param pageFormDTO | 
				
			|||
     * @return java.util.Map | 
				
			|||
     * @author yinzuomei | 
				
			|||
     * @date 2021/10/28 10:29 上午 | 
				
			|||
     */ | 
				
			|||
    @Override | 
				
			|||
    public Map queryIcResiDetail(IcResiDetailFormDTO pageFormDTO) { | 
				
			|||
        Map resultMap = new HashMap(); | 
				
			|||
        // 先查询主表,主表没有记录,直接返回空
 | 
				
			|||
        List<Map<String, Object>> icResiUserMapList = icResiUserDao.selectById(pageFormDTO.getIcResiUserId()); | 
				
			|||
        if (CollectionUtils.isEmpty(icResiUserMapList)) { | 
				
			|||
            return new HashMap(); | 
				
			|||
        } | 
				
			|||
        resultMap.put("ic_resi_user", icResiUserMapList); | 
				
			|||
 | 
				
			|||
        //循环查询每个子表的记录
 | 
				
			|||
        Set<String> subTableList = customerFootBarService.queryIcResiSubTables(pageFormDTO.getCustomerId(), pageFormDTO.getFormCode()); | 
				
			|||
        for (String subTalbeName : subTableList) { | 
				
			|||
            List<Map<String, Object>> list = icResiUserDao.selectSubTableRecords(pageFormDTO.getIcResiUserId(), subTalbeName); | 
				
			|||
            if (!CollectionUtils.isEmpty(list)) { | 
				
			|||
                resultMap.put(subTalbeName, list); | 
				
			|||
            } | 
				
			|||
            //else{
 | 
				
			|||
            //    resultMap.put(subTalbeName,new ArrayList<>());
 | 
				
			|||
            //}
 | 
				
			|||
        } | 
				
			|||
        return resultMap; | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
 | 
				
			|||
} | 
				
			|||
 | 
				
			|||
@ -1,129 +0,0 @@ | 
				
			|||
<?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="com.epmet.dataaggre.dao.epmetuser.IcResiUserDao"> | 
				
			|||
 | 
				
			|||
<!--    <insert id="add">--> | 
				
			|||
<!--        insert into ${tableName}--> | 
				
			|||
<!--        (--> | 
				
			|||
<!--            <foreach collection="map.entrySet()" index="key" item="value" separator=",">--> | 
				
			|||
<!--                ${key}--> | 
				
			|||
<!--            </foreach>--> | 
				
			|||
<!--            ,DEL_FLAG--> | 
				
			|||
<!--            ,REVISION--> | 
				
			|||
<!--            ,CREATED_TIME--> | 
				
			|||
<!--            ,UPDATED_TIME--> | 
				
			|||
<!--        ) values--> | 
				
			|||
<!--        (--> | 
				
			|||
<!--        <foreach collection="map.entrySet()" index="key" item="value" separator=",">--> | 
				
			|||
<!--            #{value}--> | 
				
			|||
<!--        </foreach>--> | 
				
			|||
<!--        ,'0'--> | 
				
			|||
<!--        ,'0'--> | 
				
			|||
<!--        ,NOW()--> | 
				
			|||
<!--        ,NOW()--> | 
				
			|||
<!--        )--> | 
				
			|||
<!--    </insert>--> | 
				
			|||
 | 
				
			|||
    <select id="selectListResi" parameterType="map" resultType="com.epmet.dataaggre.dto.epmetuser.result.IcResiUserPageResultDTO"> | 
				
			|||
        select | 
				
			|||
            ic_resi_user.id as icResiUserId, | 
				
			|||
        <foreach item="column" collection="resultColumns" open="" separator="," close=""> | 
				
			|||
            ${column.columnName} | 
				
			|||
        </foreach> | 
				
			|||
        , | 
				
			|||
        GROUP_CONCAT(ic_resi_demand.CATEGORY_CODE) as demandCategoryIds, | 
				
			|||
        GROUP_CONCAT(ic_resi_demand_dict.CATEGORY_NAME) as demandName | 
				
			|||
        FROM | 
				
			|||
             ic_resi_user | 
				
			|||
        <if test="null != subTables and subTables.size() > 0"> | 
				
			|||
            <foreach item="subTableName" collection="subTables" open="" separator="" close=""> | 
				
			|||
                ${subTableName} | 
				
			|||
            </foreach> | 
				
			|||
        </if> | 
				
			|||
 | 
				
			|||
        left join ic_resi_demand_dict | 
				
			|||
        on(ic_resi_user.customer_id=ic_resi_demand_dict.CUSTOMER_ID | 
				
			|||
        and ic_resi_demand.CATEGORY_CODE=ic_resi_demand_dict.CATEGORY_CODE ) | 
				
			|||
 | 
				
			|||
        WHERE | 
				
			|||
            ic_resi_user.DEL_FLAG = '0' | 
				
			|||
            and ic_resi_user.customer_id=#{customerId} | 
				
			|||
        <if test="null != conditions and conditions.size() > 0"> | 
				
			|||
            <foreach item="subCondition" collection="conditions" open="" separator="" close=""> | 
				
			|||
                <if test="null != subCondition.columnValue and subCondition.columnValue.size() > 0"> | 
				
			|||
 | 
				
			|||
                    <if test="subCondition.queryType!= null and subCondition.queryType == 'equal' "> | 
				
			|||
                        and ${subCondition.tableName}.${subCondition.columnName} = #{subCondition.columnValue[0]} | 
				
			|||
                    </if> | 
				
			|||
 | 
				
			|||
                    <if test="subCondition.queryType!= null and subCondition.queryType == 'like' "> | 
				
			|||
                        and ${subCondition.tableName}.${subCondition.columnName} like concat('%',#{subCondition.columnValue[0]},'%') | 
				
			|||
                    </if> | 
				
			|||
 | 
				
			|||
                    <if test="subCondition.queryType!= null and subCondition.queryType == 'daterange' "> | 
				
			|||
                        and ${subCondition.tableName}.${subCondition.columnName} between #{subCondition.columnValue[0]} and #{subCondition.columnValue[1]} | 
				
			|||
                    </if> | 
				
			|||
                </if> | 
				
			|||
            </foreach> | 
				
			|||
        </if> | 
				
			|||
        group by IC_RESI_USER.id | 
				
			|||
         order by ic_resi_user.CREATED_TIME desc | 
				
			|||
    </select> | 
				
			|||
 | 
				
			|||
 | 
				
			|||
    <select id="selectById" parameterType="java.lang.String" resultType="map"> | 
				
			|||
        select * from ic_resi_user where del_flag='0' and id=#{icResiUserId} | 
				
			|||
    </select> | 
				
			|||
 | 
				
			|||
    <select id="selectSubTableRecords" parameterType="map" resultType="map"> | 
				
			|||
        select * from ${tableName} where del_flag='0' and IC_RESI_USER=#{icResiUserId} | 
				
			|||
    </select> | 
				
			|||
 | 
				
			|||
 | 
				
			|||
    <select id="selectListResiMap" parameterType="map" resultType="map"> | 
				
			|||
        select | 
				
			|||
        ic_resi_user.id as icResiUserId, | 
				
			|||
        <foreach item="column" collection="resultColumns" open="" separator="," close=""> | 
				
			|||
            ${column.columnName} | 
				
			|||
        </foreach> | 
				
			|||
        , | 
				
			|||
        GROUP_CONCAT(ic_resi_demand.CATEGORY_CODE) as DEMAND_CATEGORY_IDS, | 
				
			|||
        GROUP_CONCAT(ic_resi_demand_dict.CATEGORY_NAME) as DEMAND_NAME | 
				
			|||
        FROM | 
				
			|||
        ic_resi_user | 
				
			|||
        <if test="null != subTables and subTables.size() > 0"> | 
				
			|||
            <foreach item="subTableName" collection="subTables" open="" separator="" close=""> | 
				
			|||
                ${subTableName} | 
				
			|||
            </foreach> | 
				
			|||
        </if> | 
				
			|||
 | 
				
			|||
        left join ic_resi_demand_dict | 
				
			|||
        on(ic_resi_user.customer_id=ic_resi_demand_dict.CUSTOMER_ID | 
				
			|||
        and ic_resi_demand.CATEGORY_CODE=ic_resi_demand_dict.CATEGORY_CODE ) | 
				
			|||
 | 
				
			|||
        WHERE | 
				
			|||
        ic_resi_user.DEL_FLAG = '0' | 
				
			|||
        and ic_resi_user.customer_id=#{customerId} | 
				
			|||
        <if test="null != conditions and conditions.size() > 0"> | 
				
			|||
            <foreach item="subCondition" collection="conditions" open="" separator="" close=""> | 
				
			|||
                <if test="null != subCondition.columnValue and subCondition.columnValue.size() > 0"> | 
				
			|||
 | 
				
			|||
                    <if test="subCondition.queryType!= null and subCondition.queryType == 'equal' "> | 
				
			|||
                        and ${subCondition.tableName}.${subCondition.columnName} = #{subCondition.columnValue[0]} | 
				
			|||
                    </if> | 
				
			|||
 | 
				
			|||
                    <if test="subCondition.queryType!= null and subCondition.queryType == 'like' "> | 
				
			|||
                        and ${subCondition.tableName}.${subCondition.columnName} like concat('%',#{subCondition.columnValue[0]},'%') | 
				
			|||
                    </if> | 
				
			|||
 | 
				
			|||
                    <if test="subCondition.queryType!= null and subCondition.queryType == 'daterange' "> | 
				
			|||
                        and ${subCondition.tableName}.${subCondition.columnName} between #{subCondition.columnValue[0]} and #{subCondition.columnValue[1]} | 
				
			|||
                    </if> | 
				
			|||
                </if> | 
				
			|||
            </foreach> | 
				
			|||
        </if> | 
				
			|||
        group by IC_RESI_USER.id | 
				
			|||
        order by ic_resi_user.CREATED_TIME desc | 
				
			|||
    </select> | 
				
			|||
</mapper> | 
				
			|||
					Loading…
					
					
				
		Reference in new issue