<?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="com.bonus.zlpt.home.mapper.MaDevInfoMapper">
    
    <resultMap type="com.bonus.zlpt.common.core.domain.equip.DevInfo" id="MaDevInfoResult">
        <id     property="maId"      column="ma_id"      />
        <result property="code"    column="code"    />
        <result property="typeId"     column="type_id"     />
        <result property="maStatus"   column="ma_status"   />
        <result property="leaseScope"    column="lease_scope"    />
        <result property="location"      column="location"      />
        <result property="brand"      column="brand"      />
        <result property="modelName"      column="model_name"      />
        <result property="productionDate"      column="production_date"      />
        <result property="workingHours"      column="working_hours"      />
        <result property="serialNumber"      column="serial_number"      />
        <result property="monthLeasePrice"      column="month_lease_price"      />
        <result property="dayLeasePrice"      column="day_lease_price"      />
        <result property="picUrl"      column="pic_url"      />
        <result property="jsMonthPrice"      column="js_month_price"      />
        <result property="jsDayPrice"      column="js_day_price"      />
        <result property="description"      column="description"      />
        <result property="gpsCode"      column="gps_code"      />
        <result property="ownCo"      column="own_co"      />
        <result property="createTime"      column="create_time"      />
        <result property="creator"      column="creator"      />
        <result property="deposit"      column="deposit"      />
        <result property="isActive"      column="is_active"      />
    </resultMap>


    <select id="getEquipmentList"  resultType="com.bonus.zlpt.common.core.domain.equip.vo.DevInfoVo">
        select d.ma_id, d.code, d.type_id, d.ma_status, d.lease_scope, d.location, d.brand, d.model_name,
               d.production_date, d.working_hours, d.serial_number, d.month_lease_price, d.day_lease_price,
               d.pic_url, d.js_month_price, d.js_day_price, d.description, d.gps_code, d.own_co, d.create_time,
               d.creator, d.deposit, d.is_active, t.parent_id
        from ma_dev_info d  left join ma_type_info t on d.type_id = t.type_id
        <where>
            <if test="maId != null and maId != ''">
                AND ma_id = #{maId}
            </if>
            <if test="code != null and code != ''">
                AND code = #{code}
            </if>
            <if test="typeId != null and typeId != ''">
                AND type_id = #{typeId}
            </if>
            <if test="maStatus != null and maStatus != ''">
                AND ma_status = #{maStatus}
            </if>
            <if test="leaseScope != null and leaseScope != ''">
                AND lease_scope = #{leaseScope}
            </if>
            <if test="location != null and location != ''">
                AND location = #{location}
            </if>
            <if test="brand != null and brand != ''">
                AND brand = #{brand}
            </if>
            <if test="modelName != null and modelName != ''">
                AND model_name = #{modelName}
            </if>
            <if test="productionDate != null and productionDate != ''">
                AND production_date = #{productionDate}
            </if>
            <if test="workingHours != null and workingHours != ''">
                AND working_hours = #{workingHours}
            </if>
            <if test="serialNumber != null and serialNumber != ''">
                AND serial_number = #{serialNumber}
            </if>
            <if test="monthLeasePrice != null and monthLeasePrice != ''">
                AND month_lease_price = #{monthLeasePrice}
            </if>
            <if test="dayLeasePrice != null and dayLeasePrice != ''">
                AND day_lease_price = #{dayLeasePrice}
            </if>
            <if test="picUrl != null and picUrl != ''">
                AND pic_url = #{picUrl}
            </if>
            <if test="jsMonthPrice != null and jsMonthPrice != ''">
                AND js_month_price = #{jsMonthPrice}
            </if>
            <if test="jsDayPrice != null and jsDayPrice != ''">
                AND js_day_price = #{jsDayPrice}
            </if>
            <if test="description != null and description != ''">
                AND description = #{description}
            </if>
            <if test="gpsCode != null and gpsCode != ''">
                AND gps_code = #{gpsCode}
            </if>
            <if test="ownCo != null and ownCo != ''">
                AND own_co = #{ownCo}
            </if>
            <if test="createTime != null and createTime != ''">
                AND create_time = #{createTime}
            </if>
            <if test="creator != null and creator != ''">
                AND creator = #{creator}
            </if>
            <if test="deposit != null and deposit != ''">
                AND deposit = #{deposit}
            </if>
            <if test="isActive != null and isActive != ''">
                AND is_active = #{isActive}
            </if>
        </where>
    </select>
    
</mapper>