罗元桥
2021-10-09 4082af9f2275d501cd47a8a63e34cb266a2fbfd4
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComPensionAuthRecordMapper.xml
@@ -37,7 +37,7 @@
        cpap.sex,
        cpap.birthday,
        cpap.personnel_category,
        cpap.address,
        cpar.address,
        cpap.is_alive,
        cpar.auth_period,
        cpar.auth_date,
@@ -93,7 +93,7 @@
            cpap.sex,
            cpap.birthday,
            cpap.personnel_category,
            cpap.address,
            cpar.address,
            cpap.is_alive,
            cpar.auth_period,
            cpar.auth_date,
@@ -139,7 +139,7 @@
        WHEN 3 THEN
        '100周岁(含)以上'
        END personnelCategory,
        cpap.address,
        cpar.address,
        CASE
        cpap.is_alive
        WHEN 1 THEN
@@ -258,42 +258,45 @@
        WHEN 3 THEN
        '100周岁(含)以上'
        END personnelCategory,
        cpap.address,
        cpar.address,
        CASE
        cpap.isAlive
        cpap.is_alive
        WHEN 1 THEN
        '是'
        WHEN 0 THEN
        '否'
        END is_alive,
        cpar.auth_period,
        cpar.auth_date,
        END isAlive,
        cpahr.auth_period,
        cpahr.auth_date,
        CASE
        cpar.auth_method
        cpahr.auth_method
        WHEN 1 THEN
        '视频认证'
        WHEN 2 THEN
        '人脸认证'
        WHEN 3 THEN
        '线下认证'
        END authMethod,
        cpar.mark,
        cpahr.mark,
        CASE
        cpar.auth_status
        cpahr.is_auth
        WHEN 1 THEN
        '已认证'
        WHEN 0 THEN
        WHEN 2 THEN
        '未认证'
        END authStatus
        FROM
        com_pension_auth_records cpar
        LEFT JOIN com_pension_auth_pensioners cpap ON cpar.pensioner_id = cpap.id
        com_pension_auth_history_record as cpahr
        LEFT JOIN com_pension_auth_records cpar on cpar.id = cpahr.auth_id
        LEFT JOIN com_pension_auth_pensioners cpap ON cpahr.elderlies_id = cpap.id
        LEFT JOIN sys_user su ON cpar.submit_user_id = su.user_id
        WHERE
        cpap.community_id = #{pageElderAuthRecordsDTO.communityId}
        cpahr.community_id = #{pageElderAuthRecordsDTO.communityId}
        <if test="pageElderAuthRecordsDTO.authPeriod != null and pageElderAuthRecordsDTO.authPeriod !=''">
            and cpar.auth_period = #{pageElderAuthRecordsDTO.authPeriod}
            and cpahr.auth_period = #{pageElderAuthRecordsDTO.authPeriod}
        </if>
        <if test="pageElderAuthRecordsDTO.authStatus != null and pageElderAuthRecordsDTO.authStatus != 0">
            and cpar.auth_status = #{pageElderAuthRecordsDTO.authStatus}
        <if test="pageElderAuthRecordsDTO.authStatus != null">
            and cpahr.ia_auth = #{pageElderAuthRecordsDTO.authStatus}
        </if>
        <if test="pageElderAuthRecordsDTO.personnelCategory != null and pageElderAuthRecordsDTO.personnelCategory != 0">
            and cpap.personnel_category = #{pageElderAuthRecordsDTO.personnelCategory}
@@ -303,9 +306,9 @@
        </if>
        <if test="pageElderAuthRecordsDTO.searchKey != null and pageElderAuthRecordsDTO.searchKey != ''">
            and (cpap.`name` like concat ('%', #{pageElderAuthRecordsDTO.searchKey}, '%')
            or  cpar.mark like concat ('%', #{pageElderAuthRecordsDTO.searchKey}, '%'))
            or  cpahr.mark like concat ('%', #{pageElderAuthRecordsDTO.searchKey}, '%'))
        </if>
        order by cpar.create_at desc
        order by cpahr.create_at desc
    </select>
    <select id="queryRecordWithPage" resultType="com.panzhihua.common.model.vos.community.IdentityAuthRecordDetailVO">
@@ -340,6 +343,6 @@
    </select>
    <select id="getNextIds" resultType="String">
        select id from com_pension_auth_records where approval_status = 1 and community_id = #{communityId} and id != #{authRecordId}
        select id from com_pension_auth_records where approval_status = 1 and community_id = #{communityId}
    </select>
</mapper>