lin
2024-04-16 2b1a74f4faa5a00a294bdc6a6d956c2e009cf467
src/main/java/org/springblade/modules/place/mapper/PlacePractitionerMapper.xml
@@ -10,7 +10,7 @@
        jpp.name,
        jpp.telephone,
        jpp.temp_address,
        TIMESTAMPDIFF(YEAR, DATE_FORMAT(jpp.id_card, '%Y%m%d%'), CURDATE()) as age,
        TIMESTAMPDIFF(year, substring(jpp.id_card, 7, 8), now()) as age,
        jpp.gender,
        jpp.id_card,
        jp.place_name employer,
@@ -23,6 +23,10 @@
        jpp.employment_time,
        jpp.resignation_time,
        jpp.resignation_flag,
        jpp.confirm_user_id,
        jpp.confirm_flag,
        jpp.confirm_time,
        jpp.confirm_notion,
        jc.category_name
        FROM
        jczz_place_practitioner jpp
@@ -61,17 +65,22 @@
            <if test="placePractitioner.createTime != null ">and jpp.create_time = #{placePractitioner.createTime}</if>
            <if test="placePractitioner.ethnicity != null ">and jpp.ethnicity = #{placePractitioner.ethnicity}</if>
            <if test="placePractitioner.confirmUserId != null "> and confirm_user_id = #{placePractitioner.confirmUserId}</if>
            <if test="placePractitioner.confirmFlag != null "> and confirm_flag = #{placePractitioner.confirmFlag}</if>
            <if test="placePractitioner.confirmTime != null "> and confirm_time = #{placePractitioner.confirmTime}</if>
            <if test="placePractitioner.confirmNotion != null  and placePractitioner.confirmNotion != ''"> and confirm_notion = #{placePractitioner.confirmNotion}</if>
            <if test="placePractitioner.type == 1">
                and TIMESTAMPDIFF(YEAR, DATE_FORMAT(jpp.id_card, '%Y%m%d%'), CURDATE()) &lt; 18
                and jc.category_no in (180202,180201)
                and TIMESTAMPDIFF(year, substring(jpp.id_card, 7, 8), now()) &lt; 18
                and jc.category_no in (180202,180201,180200)
            </if>
            <if test="placePractitioner.type == 2">
                and jpp.ethnicity != 1
                and jc.category_no in (180202,180201)
                and jc.category_no in (180202,180201,180200)
            </if>
            <if test="placePractitioner.type == 3">
                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)
                and (TIMESTAMPDIFF(year, substring(jpp.id_card, 7, 8), now()) &lt; 18  or jpp.ethnicity != 1)
                and jc.category_no in (180202,180201,180200)
            </if>
            and jpp.is_deleted = 0
            order by jpp.id desc
@@ -132,12 +141,12 @@
        LEFT JOIN jczz_category jc on jc.category_no = jppl.poi_code
        <where>
            <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)
                and TIMESTAMPDIFF(year, substring(jpp.id_card, 7, 8), now()) &lt; 18
                and jc.category_no in (180202,180201,180200)
            </if>
            <if test="placePractitioner.type == 2">
                and jpp.ethnicity != 1
                and jc.category_no in (180202,180201)
                and jc.category_no in (180202,180201,180200)
            </if>
            <if test="placePractitioner.id != null ">and jpp.id = #{placePractitioner.id}</if>
            <if test="placePractitioner.placeId != null ">and jpp.place_id = #{placePractitioner.placeId}</if>