提交 | 用户 | 时间
|
71e81e
|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
懒 |
2 |
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
3 |
<mapper namespace="cn.stylefeng.guns.modular.bs.bomInfo.mapper.BomInfoMapper"> |
|
4 |
|
|
5 |
<!-- 通用查询映射结果 --> |
|
6 |
<resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.bs.bomInfo.entity.BomInfo"> |
|
7 |
<id column="id" property="id" /> |
|
8 |
<result column="material_code" property="materialCode" /> |
|
9 |
<result column="material_name" property="materialName" /> |
|
10 |
<result column="product_code" property="productCode" /> |
|
11 |
<result column="product_name" property="productName" /> |
|
12 |
<result column="location_code" property="locationCode" /> |
|
13 |
<result column="location_name" property="locationName" /> |
|
14 |
<result column="loading_code" property="loadingCode" /> |
|
15 |
<result column="loading_name" property="loadingName" /> |
|
16 |
<result column="traceability_type" property="traceabilityType" /> |
|
17 |
<result column="quantity" property="quantity" /> |
|
18 |
<result column="remarks" property="remarks" /> |
a55627
|
19 |
<result column="line_code" property="lineCode" /> |
懒 |
20 |
|
71e81e
|
21 |
</resultMap> |
懒 |
22 |
|
|
23 |
<!-- 通用查询结果列 --> |
|
24 |
<sql id="Base_Column_List"> |
|
25 |
id AS "id", material_code AS "materialCode", material_name AS "materialName", product_code AS "productCode", product_name AS "productName", |
|
26 |
location_code AS "locationCode", location_name AS "locationName", |
|
27 |
loading_code AS "loadingCode", loading_name AS "loadingName", |
a55627
|
28 |
traceability_type AS "traceabilityType", quantity AS "quantity", remarks AS "remarks", line_code AS "lineCode" |
71e81e
|
29 |
</sql> |
懒 |
30 |
|
|
31 |
|
|
32 |
<select id="customList" resultType="cn.stylefeng.guns.modular.bs.bomInfo.model.result.BomInfoResult" parameterType="cn.stylefeng.guns.modular.bs.bomInfo.model.params.BomInfoParam"> |
|
33 |
select |
|
34 |
<include refid="Base_Column_List"/> |
|
35 |
from bs_bom_info where 1 = 1 |
|
36 |
<!-- <if test="paramCondition.materialCode != null and paramCondition.materialCode != ''">--> |
|
37 |
<!-- and material_code like CONCAT('%',#{paramCondition.materialCode},'%')--> |
|
38 |
<!-- </if>--> |
|
39 |
<if test="paramCondition.materialCode != null and paramCondition.materialCode != ''"> |
|
40 |
and material_code = #{paramCondition.materialCode} |
|
41 |
</if> |
|
42 |
<if test="paramCondition.productCode != null and paramCondition.productCode != ''"> |
|
43 |
and product_code like CONCAT('%',#{paramCondition.productCode},'%') |
|
44 |
</if> |
|
45 |
<if test="paramCondition.locationCode != null and paramCondition.locationCode != ''"> |
|
46 |
and location_code = #{paramCondition.locationCode} |
|
47 |
</if> |
|
48 |
<if test="paramCondition.loadingCode != null and paramCondition.loadingCode != ''"> |
|
49 |
and loading_code = #{paramCondition.loadingCode} |
|
50 |
</if> |
|
51 |
order by id desc |
|
52 |
</select> |
|
53 |
|
|
54 |
<select id="customMapList" resultType="map" parameterType="cn.stylefeng.guns.modular.bs.bomInfo.model.params.BomInfoParam"> |
|
55 |
select |
|
56 |
<include refid="Base_Column_List"/> |
|
57 |
from bs_bom_info where 1 = 1 |
|
58 |
</select> |
|
59 |
|
|
60 |
<select id="customPageList" resultType="cn.stylefeng.guns.modular.bs.bomInfo.model.result.BomInfoResult" parameterType="cn.stylefeng.guns.modular.bs.bomInfo.model.params.BomInfoParam"> |
|
61 |
select |
|
62 |
<include refid="Base_Column_List"/> |
|
63 |
from bs_bom_info where 1 = 1 |
|
64 |
<if test="paramCondition.materialCode != null and paramCondition.materialCode != ''"> |
|
65 |
and material_code like CONCAT('%',#{paramCondition.materialCode},'%') |
|
66 |
</if> |
|
67 |
<if test="paramCondition.materialName != null and paramCondition.materialName != ''"> |
|
68 |
and material_name like CONCAT('%',#{paramCondition.materialName},'%') |
|
69 |
</if> |
|
70 |
<if test="paramCondition.productCode != null and paramCondition.productCode != ''"> |
|
71 |
and product_code like CONCAT('%',#{paramCondition.productCode},'%') |
|
72 |
</if> |
|
73 |
<if test="paramCondition.locationCode != null and paramCondition.locationCode != ''"> |
|
74 |
and location_code = #{paramCondition.locationCode} |
|
75 |
</if> |
|
76 |
<if test="paramCondition.loadingCode != null and paramCondition.loadingCode != ''"> |
|
77 |
and loading_code = #{paramCondition.loadingCode} |
|
78 |
</if> |
|
79 |
order by id desc |
|
80 |
</select> |
|
81 |
|
|
82 |
<select id="customPageMapList" resultType="map" parameterType="cn.stylefeng.guns.modular.bs.bomInfo.model.params.BomInfoParam"> |
|
83 |
select |
|
84 |
<include refid="Base_Column_List"/> |
|
85 |
from bs_bom_info where 1 = 1 |
|
86 |
</select> |
|
87 |
|
|
88 |
<select id="kbListTable" resultType="cn.stylefeng.guns.modular.bs.bomInfo.model.result.BomInfoResult" parameterType="cn.stylefeng.guns.modular.bs.bomInfo.model.params.BomInfoParam"> |
|
89 |
SELECT |
|
90 |
b.material_code, |
|
91 |
b.material_name, |
|
92 |
b.location_code, |
|
93 |
b.loading_code, |
|
94 |
isnull( o.state, '否' ) AS state |
|
95 |
FROM |
|
96 |
bs_bom_info b |
|
97 |
LEFT JOIN om_production_order_batch_info o ON b.location_code = o.location_code |
|
98 |
AND b.material_code = o.material_code |
|
99 |
WHERE |
|
100 |
b.loading_code = #{paramCondition.loadingCode} |
|
101 |
</select> |
|
102 |
|
|
103 |
</mapper> |