receive_detail_reportMapper.xml 1.6 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.dao.report.ReceiveDetailDao">
		<!--分页查询资料(仅列表显示字段) -->
		<select id="page"  
		parameterType="HashMap" 
		resultType="com.eport.entity.report.ReceiveDetailEntity"
		>
		select A.* from (
		select 
		 b.G_Name as "gName",
		 b.G_QTY  as "gQty",
		 CONCAT(
				CONCAT(
					CONCAT(
						(
							SELECT
								UNIT_NAME
							FROM
								unit
							WHERE
								UNIT_CODE = b.G_UNIT
						),
						'('
					),
					b.G_UNIT
				),
				')'
			) AS "gUnitStr",
		 b.QTY_1 as  "qty1",
		   CONCAT(
				CONCAT(
					CONCAT(
						(
							SELECT
								UNIT_NAME
							FROM
								unit
							WHERE
								UNIT_CODE = b.UNIT_1
						),
						'('
					),
					b.UNIT_1
				),
				')'
			) AS "unit1Str",
		 h.I_E_DATE as "iEDate",
		 (select CONT_CUSTOM from ept_book eb 
		 where eb.ID = h.BOOK_ID and eb.IS_DELETE = 0) as "contCustom"
		FROM 
		ept_entry_head h left join ept_entry_body b on  h.ID = b.HEAD_ID
		 WHERE h.I_E_FLAG ='I'
            and h.IS_DELETE = 0
            and h.BOOK_ID = #{bookId}
		 ) A
		where 1=1
		<if test="gName != null and gName !=''">
		and A.gName like CONCAT(CONCAT('%',#{gName}),'%')
		</if>
		<if test="iEDate_start != null and iEDate_start!=''">
		and A."iEDate" &gt;=#{iEDate_start}
		</if>
		<if test="iEDate_end != null and iEDate_end!=''">
		and A."iEDate" &lt;=#{iEDate_end}
		</if>
		<if test="contCustom != null and contCustom !=''">
		and A.contCustom like CONCAT(CONCAT('%',#{contCustom}),'%')
		</if>
		</select>
</mapper>