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
| <?xml version="1.0"?>
| <!DOCTYPE hibernate-mapping PUBLIC
| "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
| "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
|
| <hibernate-mapping>
| <sql-query name="BbProductQuery">
| <![CDATA[
|
| select
| bbpr_id,
| bbpr_bbbr_id,
| bbpr_name,
| bbbr_name,
| bbpr_brief_name,
| bbpr_style,
| bbpr_unit,
| bbpr_grammage,
| bbpr_size,
| bbpr_reject_size,
| bbpr_occuption,
| bbpr_max,
| bbpr_min,
| bbpr_second_unit,
| bbpr_second_size,
| bbpr_remark,
| IFNULL(bbiv.bbiv_size,0) as bbiv_szie,
| IFNULL(bbiv.bbiv_reject_size,0) as bbiv_reject_szie
|
| from bb_product
| left join bb_branch on bbbr_id=bbpr_bbbr_id
| left join bb_product_invertory bbiv on (p.bbpr_id=bbiv.bbiv_bbpr_id and bbiv_factory_id in (:factoryIds) )
| where 1=1
| and if(bbiv.bbiv_id is null or bbiv_factory_id not in (:factoryIds),'1=1', bbiv_factory_id in (:factoryIds))
| <<and bbpr_bbbr_id in (:bbprBbbrId)>>
| <<and (bbpr_name like concat("%", :bbprName, "%") or bbpr_brief_name like concat("%", :bbprName, "%") )>>
| <<and bbpr_style like concat("%", :bbprStyle, "%") >>
| <<and bbpr_unit = (:bbprUnit)>>
| <<and bbpr_grammage = (:bbprGrammage)>>
| <<and bbpr_bbbr_id_list like concat('%-',:bbprBbbrIdList,'-%')>>
| and ##CONDITIONS##
|
| ]]>
| </sql-query>
| </hibernate-mapping>
|
|