<?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.sckw.product.dao.KwpGoodsUnitMapper">

    <select id="findGoodsUnit" resultType="com.sckw.product.model.KwpGoodsUnit" parameterType="java.util.Map" >
        SELECT
            id, goods_id goodsId, from_unit fromUnit, to_unit toUnit,
            conversion_value conversionValue, remark, status, create_by createBy,
            create_time createTime, update_by updateBy, update_time updateTime
        from kwp_goods_unit
        where del_flag = 0
        <if test="goodsId != null and goodsId != ''">
            and goods_id = #{goodsId, jdbcType=BIGINT}
        </if>
        ORDER BY create_time desc
    </select>

</mapper>