huanghongfa
2021-09-27 560ef23f671e0f2af71b0f50f60e4f26e3a41937
bug修复
2个文件已修改
62 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/ComMngPopulationDTO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComMngPopulationDOMapper.xml 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/ComMngPopulationDTO.java
@@ -212,4 +212,6 @@
    @ApiModelProperty("居住地址")
    private String address;
    @ApiModelProperty("关键词")
    private String keyWord;
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComMngPopulationDOMapper.xml
@@ -277,4 +277,64 @@
        </foreach>
    </delete>
    <select id="pagePopulation">
        SELECT   cmp.`name`,   cmp.id,   cmp.street_id,   cmp.act_id,
        cmp.village_id,   cmp.sex,   cmp.card_no,   cmp.road,   cmp.door_no,   cmp.floor,
        cmp.unit_no,   cmp.house_no,   cmp.political_outlook,   cmp.work_company,
        cmp.special_situation,   cmp.phone,   cmp.remark,   cmp.native_place,   cmp.nation,
        cmpct.label,    cmp.marriage,    cmp.culture_level,    cmp.profession,    cmp.out_or_local,
        cmp.census_register,    cmp.healthy,    cmp.birthday,    cmp.update_at,    cmp.address,
        cmp.is_rent    FROM    com_mng_population AS cmp
        LEFT JOIN com_mng_population_community_tags AS cmpct ON cmp.id = cmpct.population_id
        <where>
            <if test='comMngPopulationVO.name != null and comMngPopulationVO.name != &quot;&quot;'>
                AND cmp.`name` LIKE concat(#{comMngPopulationVO.name},'%')    </if>
            <if test='comMngPopulationVO.label != null and comMngPopulationVO.label != &quot;&quot;'>
                AND cmpct.label LIKE concat('%',#{comMngPopulationVO.label},'%')    </if>
            <if test='comMngPopulationVO.actId != null'>   and cmpct.community_id = #{comMngPopulationVO.actId}
            </if>   <if test='comMngPopulationVO.outOrLocal != null'>
            and cmp.out_or_local = #{comMngPopulationVO.outOrLocal}    </if>
            <if test='comMngPopulationVO.villageId != null and comMngPopulationVO.villageId != &quot;&quot;'>
                and cmp.village_id = #{comMngPopulationVO.villageId}    </if>
            <if test='comMngPopulationVO.road != null and comMngPopulationVO.road != &quot;&quot;'>
                AND cmp.road = #{comMngPopulationVO.road}    </if>
            <if test='comMngPopulationVO.doorNo != null and comMngPopulationVO.doorNo != &quot;&quot;'>
                AND cmp.door_no = #{comMngPopulationVO.doorNo}    </if>
            <if test='comMngPopulationVO.floor != null and comMngPopulationVO.floor != &quot;&quot;'>
                AND cmp.floor = #{comMngPopulationVO.floor}    </if>
            <if test='comMngPopulationVO.unitNo != null and comMngPopulationVO.unitNo != &quot;&quot;'>
                AND cmp.unit_no = #{comMngPopulationVO.unitNo}    </if>
            <if test='comMngPopulationVO.houseNo != null and comMngPopulationVO.houseNo != &quot;&quot;'>
                AND cmp.house_no = #{comMngPopulationVO.houseNo}    </if>
            <if test='comMngPopulationVO.sex != null and comMngPopulationVO.sex != &quot;&quot;'>
                AND cmp.sex = #{comMngPopulationVO.sex}    </if>
            <if test='comMngPopulationVO.ageStartTime != null and comMngPopulationVO.ageStartTime != &quot;&quot; and comMngPopulationVO.ageEndTime == null'>
                AND date_format(cmp.birthday,'%Y-%m-%d') <![CDATA[ <= ]]> #{comMngPopulationVO.ageStartTime}    </if>
            <if test='comMngPopulationVO.ageEndTime != null and comMngPopulationVO.ageEndTime != &quot;&quot; and comMngPopulationVO.ageStartTime == null'>
                AND date_format(cmp.birthday,'%Y-%m-%d') <![CDATA[ >= ]]> #{comMngPopulationVO.ageEndTime}    </if>
            <if test='comMngPopulationVO.ageStartTime != null and comMngPopulationVO.ageEndTime != null and comMngPopulationVO.ageStartTime == comMngPopulationVO.ageEndTime'>
                AND cmp.birthday BETWEEN #{comMngPopulationVO.ageStartTimeEnd} and #{comMngPopulationVO.ageEndTime}
            </if>
            <if test='comMngPopulationVO.ageStartTime != null and comMngPopulationVO.ageEndTime != null and comMngPopulationVO.ageStartTime != comMngPopulationVO.ageEndTime'>
                AND cmp.birthday BETWEEN #{comMngPopulationVO.ageEndTimeEnd} and #{comMngPopulationVO.ageStartTime}
            </if>
            <if test='comMngPopulationVO.nativePlace != null and comMngPopulationVO.nativePlace != &quot;&quot;'>
                AND cmp.native_place LIKE concat(#{comMngPopulationVO.nativePlace},'%')    </if>
            <if test='comMngPopulationVO.nation != null and comMngPopulationVO.nation != &quot;&quot;'>
                AND cmp.nation = #{comMngPopulationVO.nation}    </if>
            <if test='comMngPopulationVO.politicalOutlook != null and comMngPopulationVO.politicalOutlook != &quot;&quot;'>
                AND cmp.political_outlook = #{comMngPopulationVO.politicalOutlook}    </if>
            <if test='comMngPopulationVO.cardNo != null and comMngPopulationVO.cardNo != &quot;&quot;'>
                AND cmp.card_no = #{comMngPopulationVO.cardNo}    </if>
            <if test='comMngPopulationVO.remark != null and comMngPopulationVO.remark != &quot;&quot;'>
                AND cmp.remark = #{comMngPopulationVO.remark}    </if>
            <if test='comMngPopulationVO.keyWord != null and comMngPopulationVO.keyWord != &quot;&quot;'>
                AND (cmp.`name` like concat (#{comMngPopulationVO.keyWord},'%') or
                cmp.card_no_str = #{comMngPopulationVO.keyWord} or cmpct.label like concat ('%',#{comMngPopulationVO.keyWord},'%')
                )
            </if>
        </where>
        order by cmp.create_at desc
    </select>
</mapper>