<?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.gridinspection.mapper.GridInspectionMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="gridInspectionResultMap" type="org.springblade.jobs.gridinspection.entity.GridInspection">
        <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_type" property="jobType"/>
        <result column="reportor" property="reportor"/>
        <result column="region" property="region"/>
        <result column="grid" property="grid"/>
        <result column="handler_department" property="handlerDepartment"/>
        <result column="inspection_date" property="inspectionDate"/>
        <result column="inspection_position" property="inspectionPosition"/>
        <result column="event_type" property="eventType"/>
        <result column="is_major_event" property="isMajorEvent"/>
        <result column="job_status" property="jobStatus"/>
    </resultMap>


    <select id="selectGridInspectionPage" resultMap="gridInspectionResultMap">
        select * from yc_grid_inspection where is_deleted = 0
    </select>

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

</mapper>
