zhongrj
2024-03-16 d65293482a2f06c23b8d1d5cd1d440d1302d915d
从业人员查询统计修改,去除多余字段
7 files modified
109 ■■■■■ changed files
src/main/java/org/springblade/modules/place/controller/PlacePractitionerController.java 25 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/place/entity/PlacePractitionerEntity.java 15 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/place/mapper/PlacePractitionerMapper.java 4 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/place/mapper/PlacePractitionerMapper.xml 49 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/place/service/IPlacePractitionerService.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/place/service/impl/PlaceExtServiceImpl.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/place/service/impl/PlacePractitionerServiceImpl.java 8 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/place/controller/PlacePractitionerController.java
@@ -95,13 +95,6 @@
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入placePractitioner")
    public R save(@Valid @RequestBody PlacePractitionerEntity placePractitioner) {
        if (StringUtils.isNotBlank(placePractitioner.getIdCard())) {
            // 从身份证号获取出生日期
            String birthDateStr = placePractitioner.getIdCard().substring(6, 14);
            // 解析出生日期字符串为日期对象
            Date birthDate = DateUtil.parse(birthDateStr, "yyyyMMdd");
            placePractitioner.setBirthday(birthDate);
        }
        return R.status(placePractitionerService.save(placePractitioner));
    }
@@ -112,13 +105,6 @@
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入placePractitioner")
    public R update(@Valid @RequestBody PlacePractitionerEntity placePractitioner) {
        if (StringUtils.isNotBlank(placePractitioner.getIdCard())) {
            // 从身份证号获取出生日期
            String birthDateStr = placePractitioner.getIdCard().substring(6, 14);
            // 解析出生日期字符串为日期对象
            Date birthDate = DateUtil.parse(birthDateStr, "yyyyMMdd");
            placePractitioner.setBirthday(birthDate);
        }
        return R.status(placePractitionerService.updateById(placePractitioner));
    }
@@ -129,13 +115,6 @@
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入placePractitioner")
    public R submit(@Valid @RequestBody PlacePractitionerEntity placePractitioner) {
        if (StringUtils.isNotBlank(placePractitioner.getIdCard())) {
            // 从身份证号获取出生日期
            String birthDateStr = placePractitioner.getIdCard().substring(6, 14);
            // 解析出生日期字符串为日期对象
            Date birthDate = DateUtil.parse(birthDateStr, "yyyyMMdd");
            placePractitioner.setBirthday(birthDate);
        }
        return R.status(placePractitionerService.saveOrUpdate(placePractitioner));
    }
@@ -155,8 +134,8 @@
    @GetMapping("/countByType")
    @ApiOperationSupport(order = 8)
    @ApiOperation(value = "统计少数民族和未成年数量", notes = "")
    public R countByType() {
        return R.data(placePractitionerService.countByType());
    public R countByType(PlacePractitionerVO placePractitioner) {
        return R.data(placePractitionerService.countByType(placePractitioner));
    }
src/main/java/org/springblade/modules/place/entity/PlacePractitionerEntity.java
@@ -80,13 +80,8 @@
    @TableField("id_card")
    private String idCard;
    /** 证件类型,业务字典  cardType */
    @ApiModelProperty(value = "证件类型,业务字典  cardType", example = "")
    @TableField("card_type")
    private String cardType;
    /** 岗位性质 */
    @ApiModelProperty(value = "岗位性质", example = "")
    /** 岗位 */
    @ApiModelProperty(value = "岗位", example = "")
    @TableField("job_nature")
    private String jobNature;
@@ -100,12 +95,6 @@
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    private Date createTime;
    /** 生日 */
    @ApiModelProperty(value = "生日", example = "")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField("birthday")
    private Date birthday;
    /** 民族 */
    @ApiModelProperty(value = "民族", example = "")
src/main/java/org/springblade/modules/place/mapper/PlacePractitionerMapper.java
@@ -43,10 +43,10 @@
    /**
     * 统计数据
     * @param type
     * @param placePractitioner
     * @return
     */
    Integer selectPlaceCountByType(@Param("type") Integer type);
    Integer selectPlaceCountByType(@Param("placePractitioner") PlacePractitionerVO placePractitioner);
}
src/main/java/org/springblade/modules/place/mapper/PlacePractitionerMapper.xml
@@ -10,20 +10,19 @@
        jpp.name,
        jpp.telephone,
        jpp.temp_address,
        TRUNCATE( DATEDIFF( CURDATE(), jpp.birthday )/ 365.2422,0 ) age,
        TIMESTAMPDIFF(YEAR, DATE_FORMAT(jpp.id_card, '%Y%m%d%'), CURDATE()) as age,
        jpp.gender,
        jpp.id_card,
        jpp.card_type,
        jp.place_name employer,
        jpp.employer_img,
        jpp.create_time,
        jpp.birthday,
        jpp.ethnicity,
        jpp.is_deleted,
        jpp.criminal_record_flag,
        jpp.fake_id_card,
        jpp.employment_time,
        jpp.resignation_time,
        jpp.resignation_flag,
        jc.category_name
        FROM
        jczz_place_practitioner jpp
@@ -50,13 +49,6 @@
            <if test="placePractitioner.idCard != null  and placePractitioner.idCard != ''">and jpp.id_card =
                #{placePractitioner.idCard}
            </if>
            <if test="placePractitioner.cardType != null  and placePractitioner.cardType != ''">and jpp.card_type =
                #{placePractitioner.cardType}
            </if>
            <if test="placePractitioner.employer != null  and placePractitioner.employer != ''">and jpp.employer =
                #{placePractitioner.employer}
            </if>
            <if test="placePractitioner.resignationFlag != null  and placePractitioner.resignationFlag !='' ">
                and jpp.resignation_flag = #{placePractitioner.resignationFlag}
            </if>
@@ -67,11 +59,10 @@
            </if>
            <if test="placePractitioner.createTime != null ">and jpp.create_time = #{placePractitioner.createTime}</if>
            <if test="placePractitioner.birthday != null ">and jpp.birthday = #{placePractitioner.birthday}</if>
            <if test="placePractitioner.ethnicity != null ">and jpp.ethnicity = #{placePractitioner.ethnicity}</if>
            <if test="placePractitioner.type == 1">
                and (CURDATE() &lt; DATE_ADD( jpp.birthday, INTERVAL 18 YEAR )
                and TIMESTAMPDIFF(YEAR, DATE_FORMAT(jpp.id_card, '%Y%m%d%'), CURDATE()) &lt; 18
                and jc.category_no in (180202,180201)
            </if>
            <if test="placePractitioner.type == 2">
@@ -79,7 +70,7 @@
                and jc.category_no in (180202,180201)
            </if>
            <if test="placePractitioner.type == 3">
                and (CURDATE() &lt; DATE_ADD( jpp.birthday, INTERVAL 18 YEAR ) or ( jpp.ethnicity != 1))
                and (TIMESTAMPDIFF(YEAR, DATE_FORMAT(jpp.id_card, '%Y%m%d%'), CURDATE()) &lt; 18  or jpp.ethnicity != 1)
                and jc.category_no in (180202,180201)
            </if>
            and jpp.is_deleted = 0
@@ -97,11 +88,9 @@
        <result property="age" column="age"/>
        <result property="gender" column="gender"/>
        <result property="idCard" column="id_card"/>
        <result property="cardType" column="card_type"/>
        <result property="jobNature" column="job_nature"/>
        <result property="employerImg" column="employer_img"/>
        <result property="createTime" column="create_time"/>
        <result property="birthday" column="birthday"/>
        <result property="ethnicity" column="ethnicity"/>
        <result property="isDeleted" column="is_deleted"/>
        <result property="criminalRecordFlag" column="criminal_record_flag"/>
@@ -120,11 +109,9 @@
               age,
               gender,
               id_card,
               card_type,
               job_nature,
               employer_img,
               create_time,
               birthday,
               ethnicity,
               is_deleted,
               criminal_record_flag,
@@ -144,16 +131,36 @@
        LEFT JOIN jczz_place_poi_label jppl on jppl.place_id = jp.id and type = 3
        LEFT JOIN jczz_category jc on jc.category_no = jppl.poi_code
        <where>
            <if test="type == 1">
                and (CURDATE() &lt; DATE_ADD( jpp.birthday, INTERVAL 18 YEAR ) or ( jpp.ethnicity != 1))
            <if test="placePractitioner.type == 1">
                and (TIMESTAMPDIFF(YEAR, DATE_FORMAT(jpp.id_card, '%Y%m%d%'), CURDATE()) &lt; 18 or jpp.ethnicity != 1)
                and jc.category_no in (180202,180201)
            </if>
            <if test="type == 2">
            <if test="placePractitioner.type == 2">
                and jpp.ethnicity != 1
                and jc.category_no in (180202,180201)
            </if>
            <if test="placePractitioner.id != null ">and jpp.id = #{placePractitioner.id}</if>
            <if test="placePractitioner.placeId != null ">and jpp.place_id = #{placePractitioner.placeId}</if>
            <if test="placePractitioner.name != null  and placePractitioner.name != ''">and jpp.name like concat('%',
                #{placePractitioner.name},'%')
            </if>
            <if test="placePractitioner.telephone != null  and placePractitioner.telephone != ''">and jpp.telephone like
                concat('%', #{placePractitioner.telephone},'%')
            </if>
            <if test="placePractitioner.tempAddress != null  and placePractitioner.tempAddress != ''">and
                jpp.temp_address =
                #{placePractitioner.tempAddress}
            </if>
            <if test="placePractitioner.age != null ">and jpp.age = #{placePractitioner.age}</if>
            <if test="placePractitioner.gender != null ">and jpp.gender = #{placePractitioner.gender}</if>
            <if test="placePractitioner.idCard != null  and placePractitioner.idCard != ''">and jpp.id_card =
                #{placePractitioner.idCard}
            </if>
            <if test="placePractitioner.resignationFlag != null  and placePractitioner.resignationFlag !='' ">
                and jpp.resignation_flag = #{placePractitioner.resignationFlag}
            </if>
            and jpp.is_deleted = 0
            and jpp.resignation_flag = 1
        </where>
    </select>
src/main/java/org/springblade/modules/place/service/IPlacePractitionerService.java
@@ -40,5 +40,5 @@
    IPage<PlacePractitionerVO> selectPlacePractitionerPage(IPage<PlacePractitionerVO> page, PlacePractitionerVO placePractitioner);
    Object countByType();
    Object countByType(PlacePractitionerVO placePractitioner);
}
src/main/java/org/springblade/modules/place/service/impl/PlaceExtServiceImpl.java
@@ -140,12 +140,6 @@
        // 找出需要新增的,否则组成新集合进行比对
        for (PlacePractitionerEntity practitionerEntity : list) {
            practitionerEntity.setPlaceId(placeExt.getPlaceId());
            if (StringUtils.isNotBlank(practitionerEntity.getIdCard())) {
                // 从身份证号获取出生日期
                String birthDateStr = practitionerEntity.getIdCard().substring(6, 14);
                // 解析出生日期字符串为日期对象
                practitionerEntity.setBirthday(DateUtil.parse(birthDateStr, "yyyyMMdd"));
            }
            if (null == practitionerEntity.getId()) {
                // 新增
                practitionerEntity.setPlaceId(placeExt.getPlaceId());
src/main/java/org/springblade/modules/place/service/impl/PlacePractitionerServiceImpl.java
@@ -49,11 +49,13 @@
     * @return
     */
    @Override
    public Object countByType() {
    public Object countByType(PlacePractitionerVO placePractitioner) {
        // 未成年数量
        Integer minors = baseMapper.selectPlaceCountByType(CommonConstant.NUMBER_ONE);
        placePractitioner.setType(CommonConstant.NUMBER_ONE);
        Integer minors = baseMapper.selectPlaceCountByType(placePractitioner);
        // 少数民族
        Integer nationalMinority = baseMapper.selectPlaceCountByType(CommonConstant.NUMBER_TWO);
        placePractitioner.setType(CommonConstant.NUMBER_TWO);
        Integer nationalMinority = baseMapper.selectPlaceCountByType(placePractitioner);
        Map<String, Integer> resultMap = new HashMap<>();
        resultMap.put("minors",minors);
        resultMap.put("nationalMinority",nationalMinority);