<?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.MaHotSearchMapper">
    
    <resultMap type="com.bonus.zlpt.common.core.domain.equip.vo.DevInfoVo" 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="getHotEquipList"  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_hot_search h join ma_dev_info d  on h.ma_id = d.ma_id
            join ma_type_info t on d.type_id = t.type_id


    </select>

    <select id="getHotEquipFourList"  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, h.search_num
        from ma_hot_search h join ma_dev_info d  on h.ma_id = d.ma_id
                             join ma_type_info t on d.type_id = t.type_id ORDER BY h.search_num desc LIMIT 4


    </select>
    
</mapper>