<?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="cn.wise.sc.acquisition.business.mapper.TProcessesBlastMapper">


    <!-- 表和实体字段对照关系, 类似RestultMap -->
    <sql id="TProcessesBlastColumns">
        a.Uid,
        a.StopeName,
        a.StepName,
        a.BlastAreaName,
        a.HoleID,
        a.BlastDate,
        a.BlastPeople,
        a.CheckHoleDate,
        a.CheckHolePeople,
        a.Manager,
        a.Supervisor,
        a.TechDepart,
        a.Tabulator,
        a.Bz,
        a.Tag
	</sql>

    <sql id="TProcessesDiggingHoleColumns">
        b.HoleBlastVolume,
        b.depth ,<!-- 设计孔深,将爆破工序里的depth去掉,用设计炮孔里的替代 -->
    </sql>

    <sql id="TProcessesDrillingColumns">
        c.Depth AS  DesignDepth,
	</sql>


    <sql id="TProcessesBlastdesignHoleJoins">
        left join T_Processes_BlastDesign_Hole b on a.HoleID = b.BlastHoleID
        left join T_Processes_Drilling c on a.HoleID = c.HoleID
    </sql>

    <!-- 获取所有getPage列表 -->
    <select id="getPage" resultType="cn.wise.sc.acquisition.business.model.vo.TProcessesBlastVo">
        SELECT
        <include refid="TProcessesDiggingHoleColumns"/>
        <include refid="TProcessesDrillingColumns"/>
        <include refid="TProcessesBlastColumns"/>
        FROM T_Processes_Blast a
        <include refid="TProcessesBlastdesignHoleJoins"/>
        <where>
            ${ew.sqlSegment}
        </where>
    </select>

</mapper>