<?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="org.springblade.jobs.reportjob.mapper.ReportJobMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="reportJobResultMap" type="org.springblade.jobs.reportjob.entity.ReportJob">
        <result column="id" property="id"/>
        <result column="create_user" property="createUser"/>
        <result column="create_dept" property="createDept"/>
        <result column="create_time" property="createTime"/>
        <result column="update_user" property="updateUser"/>
        <result column="update_time" property="updateTime"/>
        <result column="status" property="status"/>
        <result column="is_deleted" property="isDeleted"/>
        <result column="job_no" property="jobNo"/>
        <result column="reportor" property="reportor"/>
        <result column="report_phone" property="reportPhone"/>
        <result column="report_time" property="reportTime"/>
        <result column="handler" property="handler"/>
        <result column="handler_phone" property="handlerPhone"/>
        <result column="job_status" property="jobStatus"/>

        <result column="residential_id" property="residentialId"/>
        <result column="residential_name" property="residentialName"/>
        <result column="org_position" property="orgPosition"/>
        <result column="report_position" property="reportPosition"/>
        <result column="begin_time" property="beginTime"/>
        <result column="end_time" property="endTime"/>
        <result column="estimate_status" property="estimateStatus"/>
        <result column="comment" property="comment"/>
        <result column="handle_time" property="handleTime"/>
        <result column="old_id" property="oldId"/>
        <result column="pic" property="pic"/>
        <result column="tenant_id" property="tenantId"/>
        <result column="report_detail" property="reportDetail"/>


    </resultMap>


    <select id="selectReportJobPage" resultMap="reportJobResultMap">
        select * from yc_report_job where is_deleted = 0
    </select>

    <select id="getUntreatedCount" resultType="java.lang.Integer">
        select COUNT(*) from yc_report_job where is_deleted = 0 AND job_status = 1
    </select>

</mapper>
