<?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.zzsmart.qomo.kn.cost.manage.mapper.CostStandardDetailMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="CostStandardDetailVOResultMap" type="com.zzsmart.qomo.kn.cost.manage.vo.CostStandardDetailVO">
        <id column="id" property="id" />
        <result column="material_number" property="materialNumber" />
        <result column="material_name" property="materialName" />
        <result column="parent_material_number" property="parentMaterialNumber" />
        <result column="version_number_id" property="versionNumberId" />
        <result column="version_number" property="versionNumber" />
        <result column="level" property="level" />
        <result column="figure_number" property="figureNumber" />
        <result column="dosage" property="dosage" />
        <result column="unit" property="unit" />
        <result column="specification" property="specification" />
        <result column="bom_cost" property="bomCost" />
        <result column="packing_cost" property="packingCost" />
        <result column="auxiliary_cost" property="auxiliaryCost" />
        <result column="labor_cost" property="laborCost" />
        <result column="euip_depreciation_cost" property="euipDepreciationCost" />
        <result column="equip_consume_cost" property="equipConsumeCost" />
        <result column="hydroelectricity_cost" property="hydroelectricityCost" />
        <result column="other_cost" property="otherCost" />
        <result column="trail_cost" property="trailCost" />
        <result column="manufacture_cost" property="manufactureCost" />
        <result column="total_labor_cost" property="totalLaborCost" />
        <result column="total_equip_consume_cost" property="totalEquipConsumeCost" />
        <result column="total_euip_depreciation_cost" property="totalEuipDepreciationCost" />
        <result column="total_hydroelectricity_cost" property="totalHydroelectricityCost" />
        <result column="total_other_cost" property="totalOtherCost" />
        <result column="create_by" property="createBy" />
        <result column="create_time" property="createTime" />
        <result column="update_by" property="updateBy" />
        <result column="update_time" property="updateTime" />
        <result column="remark" property="remark" />
        <result column="sort" property="sort" />
    </resultMap>
    <select id="pageList" resultMap="CostStandardDetailVOResultMap">
        select c1.*, c2.version_number, c2.version_status, c2.stage,c2.version_year
        from
            app_scene_cost_standard_detail  c1
                left join app_scene_cost_standard_version  c2 on c1.version_number_id = c2.id
            ${ew.customSqlSegment}
        ORDER BY c1.create_time desc

    </select>
    <select id="queryListResult" resultMap="CostStandardDetailVOResultMap">
        select c1.*, c2.version_number, c2.version_status, c2.stage,c2.version_year
        from
            app_scene_cost_standard_detail  c1
                left join app_scene_cost_standard_version  c2 on c1.version_number_id = c2.id
            ${ew.customSqlSegment}
        ORDER BY c1.create_time desc

    </select>

</mapper>
