<?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.hssx.pcbms.mapper.MaintainRecordMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.hssx.pcbms.entity.MaintainRecord">
        <id column="id" property="id" />
        <result column="goods_id" property="goodsId" />
        <result column="goods_no_id" property="goodsNoId" />
        <result column="model_no" property="modelNo" />
        <result column="operator" property="operator" />
        <result column="operator_phone" property="operatorPhone" />
        <result column="company" property="company" />
        <result column="company_phone" property="companyPhone" />
        <result column="indate" property="indate" />
    </resultMap>

    <resultMap id="BaseResultMapVO" type="com.hssx.pcbms.entity.vo.MaintainRecordVO">
        <id column="id" property="id"/>
        <result column="goods_id" property="goodsId"/>
        <result column="model_no" property="modelNo"/>
        <result column="goods_no_id" property="goodsNoId"/>
        <result column="operator" property="operator"/>
        <result column="operator_phone" property="operatorPhone"/>
        <result column="company" property="company"/>
        <result column="company_phone" property="companyPhone"/>
        <result column="indate" property="indate"/>
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, goods_id, goods_no_id, model_no, operator, operator_phone, company, company_phone, indate
    </sql>

    <select id="getRecordList" resultMap="BaseResultMapVO">
    select
        mr.id, mr.goods_id, mr.goods_no_id, mr.operator, mr.operator_phone, mr.company, mr.company_phone, mr.indate,mr.model_no
    from
        maintain_record mr
    where mr.goods_id = #{goods.id,jdbcType=INTEGER}
    order by mr.indate desc
</select>

</mapper>
