<?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.community.car.mapper.CarMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="carResultMap" type="org.springblade.community.car.entity.Car">
        <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="number" property="number"/>
        <result column="type" property="type"/>
        <result column="properties" property="properties"/>
        <result column="model" property="model"/>
        <result column="fuel_category" property="fuelCategory"/>
        <result column="color" property="color"/>
        <result column="user" property="user"/>
<!--        <result column="residential" property="residential"/>-->
        <result column="person_name" property="personName"/>
        <result column="person_phone" property="personPhone"/>
        <result column="agency_id" property="agencyId"/>
        <result column="residential_id" property="residentialId"/>
        <result column="enterprise_id" property="enterpriseId"/>
        <result column="car_img" property="carImg"/>
        <result column="org_position" property="orgPosition"/>
        <result column="tenant_id" property="tenantId"/>
        <result column="parking_lot_id" property="parkingLotId"/>
        <result column="vehicle_driving_license1" property="vehicleDrivingLicense1"/>
        <result column="vehicle_driving_license2" property="vehicleDrivingLicense2"/>
        <result column="audit_status" property="auditStatus"/>
        <result column="audit_opinion" property="auditOpinion"/>
        <result column="inhabitant_id" property="inhabitantId"/>
    </resultMap>


    <select id="selectCarPage" resultMap="carResultMap">
        select * from yc_car where is_deleted = 0
    </select>

    <select id="getCarByPersonId" resultMap="carResultMap">
        select * from yc_car where is_deleted = 0 and person_id = #{personId}
    </select>

</mapper>
