<?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.yhy.module.core.dal.mysql.quota.QuotaItemMapper">

    <!-- 更新定额基价的四个价格字段 -->
    <update id="updatePrices">
        UPDATE yhy_quota_item
        SET tax_excl_base_price = #{taxExclBasePrice},
            tax_incl_base_price = #{taxInclBasePrice},
            tax_excl_compile_price = #{taxExclCompilePrice},
            tax_incl_compile_price = #{taxInclCompilePrice},
            update_time = NOW()
        WHERE id = #{quotaItemId}
          AND deleted = 0
    </update>

    <!-- 根据编码查询定额基价 -->
    <select id="selectByCode" resultType="com.yhy.module.core.dal.dataobject.quota.QuotaItemDO">
        SELECT *
        FROM yhy_quota_item
        WHERE deleted = 0
          AND code = #{code}
        ORDER BY create_time ASC
    </select>

</mapper>
