InMatDetailMapper.xml 2.3 KB
<?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.eport.rest.dao.report.InMatDetailDao">

    <select id="listAll" parameterType="HashMap"
            resultType="com.eport.rest.entity.report.InMatDetailEntity">
        SELECT
        d.BOOK_NO AS "bookNo",
        d.TRADE_MODE AS "tradeMode",
        c.c_entryId AS "entryId",
        c.c_preEntryId AS "preEntryId",
        c.c_iEFlag AS "iEFlag",
        c.c_dDate AS "dDate",
        c.c_copGNo AS "copGNo",
        c.c_gNo2 AS "gNo2",
        c.c_gName AS "gName",
        c.c_gQty AS "gQty",
        c.c_unit1 AS "unit1",
        c.c_declPrice AS "declPrice"
        FROM
        (SELECT
        b.BOOK_ID AS "c_bookId",
        a.ENTRY_ID AS "c_entryId",
        b.PRE_ENTRY_ID AS "c_preEntryId",
        b.I_E_FLAG AS "c_iEFlag",
        b.D_DATE AS "c_dDate",
        a.COP_G_NO AS "c_copGNo",
        a.G_NO2 AS "c_gNo2",
        a.G_NAME AS "c_gName",
        a.G_QTY AS "c_gQty",
        a.UNIT_1 AS "c_unit1",
        a.DECL_PRICE AS "c_declPrice"
        FROM ept_entry_body a INNER JOIN ept_entry_head b ON b.ENTRY_ID = a.ENTRY_ID
        WHERE 1=1
        <if test="gName != null and gName !=''">
            AND a.G_NAME LIKE CONCAT(CONCAT('%',#{gName}),'%')
        </if>
        <if test="entryId !=null and entryId !=''">
            AND a.ENTRY_ID LIKE CONCAT(CONCAT('%',#{entryId}),'%')
        </if>
        <if test="copGNo != null and copGNo !=''">
            AND a.COP_G_NO LIKE CONCAT(CONCAT('%',#{copGNo}),'%')
        </if>
        <if test="gNo2 != null and gNo2 !=''">
            AND a.G_NO2 = #{gNo2}
        </if>
        <if test="startTime !=null and startTime!=''">
            AND b.D_DATE &gt;=#{startTime}
        </if>
        <if test="endTime !=null and endTime!=''">
            AND b.D_DATE &lt;=#{endTime}
        </if>
        ) c
        INNER JOIN ept_book d ON c.c_bookId = d.ID
        WHERE 1=1
        <if test="bookId != null">
            AND d.ID = #{bookId}
        </if>
        <if test="tradeMode!=null and tradeMode != ''">
            AND d.TRADE_MODE = #{tradeMode}
        </if>
    </select>

    <!--<select id="pageAll" parameterType="HashMap"-->
    <!--resultType="com.eport.rest.entity.report.InMatDetailEntity">-->

    <!--</select>-->

</mapper>