<?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.tofly.gpsboot.mapper.maintain.RepairgoodsMapper">

    <resultMap id="repairgoodsMap" type="com.tofly.pojo.maintain.Repairgoods">
        <id property="id" column="ID"/>
        <result property="recordId" column="RECORD_ID"/>
        <result property="repairUserid" column="REPAIR_USERID"/>
        <result property="materialType" column="MATERIAL_TYPE"/>
        <result property="material" column="MATERIAL"/>
        <result property="bore" column="BORE"/>
        <result property="num" column="NUM"/>
        <result property="createTime" column="CREATE_TIME"/>
        <result property="createUser" column="CREATE_USER"/>

    </resultMap>

    <select id="getOrderIds" resultType="string">
        select wm_concat(o.id)
        from TF_YWPN_REPAIRORDER_W o
        left join TF_YWPN_REPAIRUSER_W u on o.id = u.REPAIR_ID
        left join TF_YWPN_REPAIRGOODS_W g on u.ID = g.REPAIR_USERID
        left join TF_YWPN_REPAIRMATERIAL_D m on m.ID = g.MATERIAL_TYPE
        where g.CREATE_USER in
        <foreach collection="userList" item="u" open="(" separator="," close=")">
            #{u}
        </foreach>
        and g.create_time between #{start} and #{end}
        and g.MATERIAL_TYPE = #{typeId}
    </select>

</mapper>
