chengf
2025-12-11 f29e6f31e4f2d533124fc68346b7cc072f427c9b
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<?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="resourceStoreServiceDaoImpl">
 
    <!-- 查询资源物品信息 -->
    <select id="getResourceStoresInfo" parameterType="Map" resultType="Map">
        select t.res_id resId,t.rst_id rstId,t.store_id storeId,t.res_name resName,t.res_code resCode,rst.name rstName,
        t.unit_code unitCode,t.remark,t.out_low_price outLowPrice,t.out_high_price outHighPrice,
        t.show_mobile showMobile,t.description,t.price,t.stock,t.create_time createTime,t.sh_id shId,
        t.rss_id rssId,rss.spec_name rssName,t.mini_unit_code,t.mini_unit_code miniUnitCode,
        t.mini_unit_stock,t.mini_unit_stock miniUnitStock,t.mini_stock,t.mini_stock miniStock
        from resource_store t
        left join resource_store_type rst on rst.rst_id = t.rst_id and rst.status_cd = '0'
        left join resource_store_specification rss on rss.rss_id = t.rss_id and rss.status_cd = '0'
        where 1 = 1 and t.status_cd = '0'
        <if test="resId !=null and resId != ''">
            and t.res_id= #{resId}
        </if>
        <if test="storeId !=null and storeId != ''">
            and t.store_id= #{storeId}
        </if>
        <if test="resName !=null and resName != ''">
            and t.res_name= #{resName}
        </if>
        <if test="resCode !=null and resCode != ''">
            and t.res_code= #{resCode}
        </if>
        <if test="rstId !=null and rstId != ''">
            and t.rst_id= #{rstId}
        </if>
        <if test="rssId !=null and rssId != ''">
            and t.rss_id= #{rssId}
        </if>
        <if test="unitCode !=null and unitCode != ''">
            and t.unit_code= #{unitCode}
        </if>
        <if test="remark !=null and remark != ''">
            and t.remark= #{remark}
        </if>
        <if test="outLowPrice !=null and outLowPrice != ''">
            and t.out_low_price= #{outLowPrice}
        </if>
        <if test="outHighPrice !=null and outHighPrice != ''">
            and t.out_high_price= #{outHighPrice}
        </if>
        <if test="showMobile !=null and showMobile != ''">
            and t.show_mobile= #{showMobile}
        </if>
        <if test="description !=null and description != ''">
            and t.description= #{description}
        </if>
        <if test="price !=null and price != ''">
            and t.price= #{price}
        </if>
        <if test="stock !=null and stock != ''">
            and t.stock= #{stock}
        </if>
        <if test="shId !=null and shId != ''">
            and t.sh_id= #{shId}
        </if>
        <if test="miniUnitCode !=null and miniUnitCode != ''">
            and t.mini_unit_code= #{miniUnitCode}
        </if>
        <if test="miniUnitStock !=null and miniUnitStock != ''">
            and t.mini_unit_stock= #{miniUnitStock}
        </if>
        <if test="miniStock !=null and miniStock != ''">
            and t.mini_stock= #{miniStock}
        </if>
        <if test="createTime !=null and createTime != ''">
            and t.create_time= #{createTime}
        </if>
    </select>
 
    <!-- 查询资源物品数量 -->
    <select id="getResourceStoresCount" parameterType="Map" resultType="Map">
        select count(1) count
        from resource_store t
        where 1 =1 and t.status_cd = '0'
        <if test="resId !=null and resId != ''">
            and t.res_id= #{resId}
        </if>
        <if test="storeId !=null and storeId != ''">
            and t.store_id= #{storeId}
        </if>
        <if test="rstId !=null and rstId != ''">
            and t.rst_id= #{rstId}
        </if>
        <if test="rssId !=null and rssId != ''">
            and t.rss_id= #{rssId}
        </if>
        <if test="resName !=null and resName != ''">
            and t.res_name= #{resName}
        </if>
        <if test="resCode !=null and resCode != ''">
            and t.res_code= #{resCode}
        </if>
        <if test="unitCode !=null and unitCode != ''">
            and t.unit_code= #{unitCode}
        </if>
        <if test="remark !=null and remark != ''">
            and t.remark= #{remark}
        </if>
        <if test="outLowPrice !=null and outLowPrice != ''">
            and t.out_low_price= #{outLowPrice}
        </if>
        <if test="outHighPrice !=null and outHighPrice != ''">
            and t.out_high_price= #{outHighPrice}
        </if>
        <if test="showMobile !=null and showMobile != ''">
            and t.show_mobile= #{showMobile}
        </if>
        <if test="description !=null and description != ''">
            and t.description= #{description}
        </if>
        <if test="price !=null and price != ''">
            and t.price= #{price}
        </if>
        <if test="stock !=null and stock != ''">
            and t.stock= #{stock}
        </if>
        <if test="shId !=null and shId != ''">
            and t.sh_id= #{shId}
        </if>
        <if test="miniUnitCode !=null and miniUnitCode != ''">
            and t.mini_unit_code= #{miniUnitCode}
        </if>
        <if test="miniUnitStock !=null and miniUnitStock != ''">
            and t.mini_unit_stock= #{miniUnitStock}
        </if>
        <if test="miniStock !=null and miniStock != ''">
            and t.mini_stock= #{miniStock}
        </if>
        <if test="createTime !=null and createTime != ''">
            and t.create_time= #{createTime}
        </if>
    </select>
</mapper>