<?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.ruoyi.zdsz.mapper.ZEngineeringMaterialsResetsMapper">

    <resultMap type="com.ruoyi.zdsz.domain.ZEngineeringMaterialsResets" id="ZEngineeringMaterialsResetsResult">
        <result property="id" column="id"/>
        <result property="areaId" column="area_id"/>
        <result property="materialQuality" column="material_quality"/>
        <result property="estimatedSpecifications" column="estimated_specifications"/>
        <result property="estimatedSize" column="estimated_size"/>
        <result property="enginCycle" column="engin_cycle"/>
        <result property="remark" column="remark"/>
        <result property="delFlag" column="del_flag"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
    </resultMap>

    <select id="getPageList" resultType="com.ruoyi.zdsz.domain.vo.ZEngineeringMaterialsResetsVo">
        SELECT
            ze.*,
            zs.name as materialQualityName,
            zm.name as estimatedSpecificationsName
        FROM
            z_engineering_materials_resets AS ze
                LEFT JOIN z_engin_specifications AS zs ON zs.id = ze.estimated_specifications
                AND zs.del_flag = '0'
                LEFT JOIN z_engin_material_quality AS zm ON zm.id = ze.material_quality
                AND zm.del_flag = '0'
                LEFT JOIN z_area AS za ON za.id = ze.area_id
                AND za.del_flag = '0'
        WHERE
            ze.del_flag = '0'
        <if test="p.areaId != null  and p.areaId != ''">
            and ze.area_id LIKE CONCAT('%',#{p.areaId},'%')
        </if>
    </select>

</mapper>
