gNamegNoMapper.xml 850 字节
<?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.GNameGNoDao">

    <sql id="Columns">
        a.G_NAME AS "gName"
        ,a.G_NO AS "gNo"
        ,a.COP_G_NO AS "copGNo"
    </sql>

    <select id="listAll" parameterType="HashMap" resultType="com.eport.rest.entity.report.GNameGNoEntity">
        select
        <include refid="Columns"/>
        from
        (
        select im.G_NAME,im.G_NO,im.COP_G_NO from ept_item_mat im WHERE im.IS_DELETE = 0
        UNION ALL
        select m.G_NAME,m.G_NO,m.COP_G_NO from ept_mat m WHERE m.IS_DELETE = 0
        ) a WHERE 1=1
        <if test="gName != null">
            AND a.G_NAME LIKE CONCAT(CONCAT('%',#{gName}),'%')
        </if>
    </select>

</mapper>