receive_detail_reportMapper.xml
1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?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" >=#{iEDate_start}
</if>
<if test="iEDate_end != null and iEDate_end!=''">
and A."iEDate" <=#{iEDate_end}
</if>
<if test="contCustom != null and contCustom !=''">
and A.contCustom like CONCAT(CONCAT('%',#{contCustom}),'%')
</if>
</select>
</mapper>