<?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.malk.kuaikeli.mapper.SupplierMaterialMapper">
    <update id="updateUnitPrice">
        UPDATE t_supplier_material
        SET unit_price = unit_price_next,
        is_need_sync_yd = '是'
        WHERE
        unit_price &lt;&gt; unit_price_next
    </update>

    <select id="selectListForCopy" resultType="com.malk.kuaikeli.entity.SupplierMaterial" parameterType="java.lang.String">
          SELECT
            supplier,
            supplier_id,
            supplier_name,
            material_name,
            material_id,
            unit,
            specs,
            classify_one,
            classify_two,
            unit_price,
            unit_price_next,
            other_info,
            img,
            brand,
            state,
            term,
            packing_number,
            packing_unit,
            need_qualification,
            provide_qualification,
            qualification,
            qualification_expire_date
        FROM
            t_supplier_material
        WHERE
            material_id IN (
                SELECT
                    material_id
                FROM
                    t_material_detail
                WHERE
                    project_id = #{project_id}
                AND supplier_id = #{supplier_id}
            )
    </select>
</mapper>