<?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="cn.com.ty.lift.batch.applet.dao.mapper.AnnualInspectionDataMapper" >

    <!-- 获取时间段内的年检数据 -->
    <select id="getAnnualInspectionDataList" parameterType="cn.com.ty.lift.batch.applet.dao.model.request.CommonRequest"
            resultType="cn.com.ty.lift.batch.applet.dao.model.AnnualInspectionDataModel">
        select
            ai.plan_date as planDate,
            ai.mt_company_id as mtCompanyId,
            ai.status as status,
            ai.step_status as stepStatus,
            p.project_name as projectName
        from
            annual_inspection ai
        left join
            project_lift_relevance plr
        on
            ai.lift_id = plr.lift_id
        left join
            project p
        on
            plr.project_id = p.id
        where
            ai.plan_date <![CDATA[ >= ]]> #{startTimeDateStr}
        and
            ai.plan_date <![CDATA[ <= ]]> #{endTimeDateStr}
    </select>

</mapper>