wuxw7
2018-07-09 8d34f3589a179e0b3610a9abc1acc408745f45bd
商品服务开发测试完成
16个文件已修改
1个文件已添加
197 ■■■■ 已修改文件
ShopService/doc/start_shopService.sh 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ShopService/pom.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ShopService/src/main/java/com/java110/shop/ShopServiceApplicationStart.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ShopService/src/main/java/com/java110/shop/api/ShopApi.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ShopService/src/main/java/com/java110/shop/dao/impl/ShopServiceDaoImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ShopService/src/main/java/com/java110/shop/listener/DeleteShopAttrAndAttrParamListener.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ShopService/src/main/java/com/java110/shop/listener/FlushAboutBuyIdListener.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ShopService/src/main/java/com/java110/shop/listener/FlushAboutShopIdListener.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ShopService/src/main/java/com/java110/shop/listener/SaveShopCatalogListener.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ShopService/src/main/java/com/java110/shop/listener/SaveShopInfoListener.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ShopService/src/main/java/com/java110/shop/listener/SaveShopPreferentialListener.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ShopService/src/main/resources/application-dev.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ShopService/src/main/resources/application-prod.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ShopService/src/main/resources/application-test.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-config/db/CenterService/create_table.db 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-config/db/ShopService/create_table.sql 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-config/src/main/resources/mapper/shop/ShopServiceDaoImplMapper.xml 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ShopService/doc/start_shopService.sh
New file
@@ -0,0 +1,14 @@
#!/bin/bash
#### debug model prod
#nohup java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n -jar -Dspring.profiles.active=dev ShopService.jar > shop.log 2>&1 &
#### normal prod model
#nohup java -jar -Dspring.profiles.active=prod ShopService.jar > shop.log 2>&1 &
#### normal test model
#nohup java -jar -Dspring.profiles.active=test ShopService.jar > shop.log 2>&1 &
#### normal dev model
nohup java -jar -Dspring.profiles.active=dev ShopService.jar > shop.log 2>&1 &
tail -100f shop.log
ShopService/pom.xml
@@ -10,15 +10,13 @@
    <modelVersion>4.0.0</modelVersion>
    <artifactId>ShopService</artifactId>
    <packaging>jar</packaging>
    <name>ShopService</name>
    <!-- FIXME change it to the project's website -->
    <url>http://www.example.com</url>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
    </properties>
    <dependencies>
@@ -34,7 +32,6 @@
    <build>
        <finalName>ShopService</finalName>
        <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
@@ -66,10 +63,9 @@
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <configuration>
                        <mainClass>com.java110.store.ShopServiceApplicationStart</mainClass>
                        <mainClass>com.java110.shop.ShopServiceApplicationStart</mainClass>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>
ShopService/src/main/java/com/java110/shop/ShopServiceApplicationStart.java
@@ -25,13 +25,13 @@
 * @date 2016年8月6日
 * @tag
 */
@SpringBootApplication(scanBasePackages={"com.java110.service","com.java110.store","com.java110.core","com.java110.cache"})
@SpringBootApplication(scanBasePackages={"com.java110.service","com.java110.shop","com.java110.core","com.java110.cache"})
@EnableDiscoveryClient
@Java110ListenerDiscovery(listenerPublishClass = BusinessServiceDataFlowEventPublishing.class,
        basePackages = {"com.java110.store.listener"})
        basePackages = {"com.java110.shop.listener"})
public class ShopServiceApplicationStart {
    private final static String LISTENER_PATH = "java110.StoreService.listeners";
    private final static String LISTENER_PATH = "java110.ShopService.listeners";
    /**
     * 实例化RestTemplate,通过@LoadBalanced注解开启均衡负载能力.
ShopService/src/main/java/com/java110/shop/api/ShopApi.java
@@ -28,7 +28,7 @@
    @Autowired
    IShopServiceSMO shopServiceSMOImpl;
    @RequestMapping(path = "/storeApi/service",method= RequestMethod.GET)
    @RequestMapping(path = "/shopApi/service",method= RequestMethod.GET)
    public String serviceGet(HttpServletRequest request) {
        return DataTransactionFactory.createBusinessResponseJson(ResponseConstant.RESULT_CODE_ERROR,"不支持Get方法请求").toJSONString();
    }
@@ -39,7 +39,7 @@
     * @param request
     * @return
     */
    @RequestMapping(path = "/storeApi/service",method= RequestMethod.POST)
    @RequestMapping(path = "/shopApi/service",method= RequestMethod.POST)
    public String servicePost(@RequestBody String orderInfo, HttpServletRequest request) {
        BusinessServiceDataFlow businessServiceDataFlow = null;
        JSONObject responseJson = null;
ShopService/src/main/java/com/java110/shop/dao/impl/ShopServiceDaoImpl.java
@@ -503,14 +503,14 @@
    }
    /**
     * 商品描述查询(instance)
     * 商品目录查询(instance)
     * @param info bId 信息
     * @return
     * @throws DAOException
     */
    @Override
    public Map getShopCatalog(Map info) throws DAOException {
        logger.debug("查询商品证件信息 入参 info : {}",info);
        logger.debug("查询商品目录信息 入参 info : {}",info);
        List<Map> shopCatalogs = sqlSessionTemplate.selectList("shopServiceDaoImpl.getShopCatalog",info);
        if(shopCatalogs == null || shopCatalogs.size() == 0){
@@ -660,7 +660,7 @@
     */
    @Override
    public void updateShopCatalogInstance(Map info) throws DAOException {
        logger.debug("修改商品描述信息Instance 入参 info : {}",info);
        logger.debug("修改商品目录信息Instance 入参 info : {}",info);
        int saveFlag = sqlSessionTemplate.update("shopServiceDaoImpl.updateShopCatalogInstance",info);
ShopService/src/main/java/com/java110/shop/listener/DeleteShopAttrAndAttrParamListener.java
@@ -43,7 +43,7 @@
    @Override
    public String getServiceCode() {
        return ServiceCodeConstant.SERVICE_CODE_DELETE_STORE_INFO;
        return ServiceCodeConstant.SERVICE_CODE_DELETE_SHOP_INFO;
    }
    /**
ShopService/src/main/java/com/java110/shop/listener/FlushAboutBuyIdListener.java
@@ -77,5 +77,14 @@
        String buyId = GenerateCodeFactory.getShopBuyId();
        JSONObject businessBuyShop = data.getJSONObject("businessBuyShop");
        businessBuyShop.put("buyId",buyId);
        //刷商品属性
        if(data.containsKey("businessBuyShopAttr")) {
            JSONArray businessBuyShopAttrs = data.getJSONArray("businessBuyShopAttr");
            for(int businessBuyShopAttrIndex = 0;businessBuyShopAttrIndex < businessBuyShopAttrs.size();businessBuyShopAttrIndex++) {
                JSONObject businessBuyShopAttr = businessBuyShopAttrs.getJSONObject(businessBuyShopAttrIndex);
                businessBuyShopAttr.put("buyId", buyId);
            }
        }
    }
}
ShopService/src/main/java/com/java110/shop/listener/FlushAboutShopIdListener.java
@@ -78,7 +78,7 @@
        //刷新 shopPreferentialId
        if(data.containsKey("businessShopPreferential")){
            JSONObject businessShopPreferential = data.getJSONObject("businessShopPreferential");
            if(!businessShopPreferential.containsKey("shopPreferentialId") || businessShopPreferential.getString("shopId").startsWith("-")){
            if(!businessShopPreferential.containsKey("shopPreferentialId") || businessShopPreferential.getString("shopPreferentialId").startsWith("-")){
                businessShopPreferential.put("shopPreferentialId",GenerateCodeFactory.getShopPreferentialId());
            }
        }
@@ -118,6 +118,14 @@
                businessStoreAttr.put("shopId", shopId);
            }
        }
        //刷商品属性
        if(data.containsKey("businessShopAttrParam")) {
            JSONArray businessShopAttrParams = data.getJSONArray("businessShopAttrParam");
            for(int businessShopAttrParamIndex = 0;businessShopAttrParamIndex < businessShopAttrParams.size();businessShopAttrParamIndex++) {
                JSONObject businessStoreAttrParam = businessShopAttrParams.getJSONObject(businessShopAttrParamIndex);
                businessStoreAttrParam.put("shopId", shopId);
            }
        }
        //刷 是商品照片 的 shopId
        if(data.containsKey("businessShopPhoto")) {
            JSONArray businessShopPhotos = data.getJSONArray("businessShopPhoto");
ShopService/src/main/java/com/java110/shop/listener/SaveShopCatalogListener.java
@@ -119,7 +119,7 @@
     */
    private void doBusinessShopCatalog(Business business,JSONObject businessShopCatalog){
        Assert.jsonObjectHaveKey(businessShopCatalog,"shopId","businessShopCatalog 节点下没有包含 shopId 节点");
        Assert.jsonObjectHaveKey(businessShopCatalog,"storeId","businessShopCatalog 节点下没有包含 storeId 节点");
        businessShopCatalog.put("bId",business.getbId());
        businessShopCatalog.put("operate", StatusConstant.OPERATE_ADD);
ShopService/src/main/java/com/java110/shop/listener/SaveShopInfoListener.java
@@ -125,6 +125,9 @@
        Assert.jsonObjectHaveKey(businessShop,"shopId","businessShop 节点下没有包含 storeId 节点");
        Assert.jsonObjectHaveKey(businessShop,"startDate","businessShop 节点下没有包含 startDate 节点");
        Assert.jsonObjectHaveKey(businessShop,"endDate","businessShop 节点下没有包含 endDate 节点");
        businessShop.put("bId",business.getbId());
        businessShop.put("operate", StatusConstant.OPERATE_ADD);
        //对日期处理
@@ -132,11 +135,11 @@
        Date entDate = null;
        try {
            startDate = DateUtil.getDateFromString(businessShop.getString("startDate"), DateUtil.DATE_FORMATE_STRING_A);
            entDate = DateUtil.getDateFromString(businessShop.getString("entDate"), DateUtil.DATE_FORMATE_STRING_A);
            entDate = DateUtil.getDateFromString(businessShop.getString("endDate"), DateUtil.DATE_FORMATE_STRING_A);
            businessShop.put("startDate",startDate);
            businessShop.put("entDate",entDate);
        } catch (ParseException e) {
            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"传入参数 startDate entDate 格式不正确,请填写 "
            businessShop.put("endDate",entDate);
        } catch (Exception e) {
            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"传入参数 startDate endDate 格式不正确,请填写 "
                    +DateUtil.DATE_FORMATE_STRING_A +" 格式,"+businessShop);
        }
        //保存商户信息
ShopService/src/main/java/com/java110/shop/listener/SaveShopPreferentialListener.java
@@ -120,6 +120,8 @@
    private void doBusinessShopPreferential(Business business, JSONObject businessShopPreferential){
        Assert.jsonObjectHaveKey(businessShopPreferential,"shopPreferentialId","businessShop 节点下没有包含 shopPreferentialId 节点");
        Assert.jsonObjectHaveKey(businessShopPreferential,"preferentialStartDate","businessShop 节点下没有包含 preferentialStartDate 节点");
        Assert.jsonObjectHaveKey(businessShopPreferential,"preferentialEndDate","businessShop 节点下没有包含 preferentialEndDate 节点");
        businessShopPreferential.put("bId",business.getbId());
        businessShopPreferential.put("operate", StatusConstant.OPERATE_ADD);
@@ -127,11 +129,11 @@
        Date preferentialStartDate = null;
        Date preferentialEndDate = null;
        try {
            preferentialStartDate = DateUtil.getDateFromString(businessShopPreferential.getString("startDate"), DateUtil.DATE_FORMATE_STRING_A);
            preferentialEndDate = DateUtil.getDateFromString(businessShopPreferential.getString("entDate"), DateUtil.DATE_FORMATE_STRING_A);
            businessShopPreferential.put("startDate",preferentialStartDate);
            businessShopPreferential.put("entDate",preferentialEndDate);
        } catch (ParseException e) {
            preferentialStartDate = DateUtil.getDateFromString(businessShopPreferential.getString("preferentialStartDate"), DateUtil.DATE_FORMATE_STRING_A);
            preferentialEndDate = DateUtil.getDateFromString(businessShopPreferential.getString("preferentialEndDate"), DateUtil.DATE_FORMATE_STRING_A);
            businessShopPreferential.put("preferentialStartDate",preferentialStartDate);
            businessShopPreferential.put("preferentialEndDate",preferentialEndDate);
        } catch (Exception e) {
            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"传入参数 preferentialStartDate preferentialEndDate 格式不正确,请填写 "
                    +DateUtil.DATE_FORMATE_STRING_A +" 格式,"+businessShopPreferential);
        }
ShopService/src/main/resources/application-dev.yml
@@ -77,7 +77,7 @@
        reset: latest
    topic: test
    group:
      id: storeBusinessStatus
      id: shopBusinessStatus
    concurrency: 10
  producer:
ShopService/src/main/resources/application-prod.yml
@@ -77,7 +77,7 @@
        reset: latest
    topic: test
    group:
      id: storeBusinessStatus
      id: shopBusinessStatus
    concurrency: 10
  producer:
ShopService/src/main/resources/application-test.yml
@@ -77,7 +77,7 @@
        reset: latest
    topic: test
    group:
      id: storeBusinessStatus
      id: shopBusinessStatus
    concurrency: 10
  producer:
java110-config/db/CenterService/create_table.db
@@ -284,6 +284,28 @@
INSERT INTO c_service(service_code,business_type_cd,`name`,seq,url,provide_app_id)
VALUES('transfer.console.menu','T','透传菜单查询',1,'http://192.168.31.199:8001/userApi/service','8000418001');
INSERT INTO c_service(service_code,business_type_cd,`name`,seq,url,provide_app_id)
VALUES('save.shop.info','D','保存商品信息',1,'http://shop-service/shopApi/service','8000418003');
INSERT INTO c_service(service_code,business_type_cd,`name`,seq,url,provide_app_id)
VALUES('update.shop.info','D','修改商品信息',1,'http://shop-service/shopApi/service','8000418003');
INSERT INTO c_service(service_code,business_type_cd,`name`,seq,url,provide_app_id)
VALUES('delete.shop.info','D','删除商品信息',1,'http://shop-service/shopApi/service','8000418003');
INSERT INTO c_service(service_code,business_type_cd,`name`,seq,url,provide_app_id)
VALUES('buy.shop.info','D','购买商品信息',1,'http://shop-service/shopApi/service','8000418003');
INSERT INTO c_service(service_code,business_type_cd,`name`,seq,url,provide_app_id)
VALUES('save.shop.catalog','D','保存商品目录信息',1,'http://shop-service/shopApi/service','8000418003');
INSERT INTO c_service(service_code,business_type_cd,`name`,seq,url,provide_app_id)
VALUES('update.shop.catalog','D','修改商品目录信息',1,'http://shop-service/shopApi/service','8000418003');
INSERT INTO c_service(service_code,business_type_cd,`name`,seq,url,provide_app_id)
VALUES('delete.shop.catalog','D','删除商品目录信息',1,'http://shop-service/shopApi/service','8000418003');
insert into c_route(app_id,service_id,invoke_model,order_type_cd,status_cd) values(
'8000418001','1','S','Q','0'
);
@@ -346,6 +368,32 @@
'8000418002','17','S','Q','0'
);
insert into c_route(app_id,service_id,invoke_model,order_type_cd,status_cd) values(
'8000418001','21','S','Q','0'
);
insert into c_route(app_id,service_id,invoke_model,order_type_cd,status_cd) values(
'8000418001','22','S','Q','0'
);
insert into c_route(app_id,service_id,invoke_model,order_type_cd,status_cd) values(
'8000418001','23','S','Q','0'
);
insert into c_route(app_id,service_id,invoke_model,order_type_cd,status_cd) values(
'8000418001','24','S','Q','0'
);
insert into c_route(app_id,service_id,invoke_model,order_type_cd,status_cd) values(
'8000418001','25','S','Q','0'
);
insert into c_route(app_id,service_id,invoke_model,order_type_cd,status_cd) values(
'8000418001','26','S','Q','0'
);
insert into c_route(app_id,service_id,invoke_model,order_type_cd,status_cd) values(
'8000418001','27','S','Q','0'
);
java110-config/db/ShopService/create_table.sql
@@ -149,15 +149,15 @@
CREATE INDEX idx_business_shop_attr_param_b_id ON business_shop_attr_param(b_id);
-- 商品优惠表
create table business_shop_preferential(
CREATE TABLE business_shop_preferential(
    shop_preferential_id VARCHAR(30) NOT NULL COMMENT '商品ID',
    shop_id VARCHAR(30) NOT NULL COMMENT '商品ID',
    b_id VARCHAR(30) NOT NULL COMMENT '业务Id',
    original_price DECIMAL(10,2) not null comment '商品销售价,再没有优惠的情况下和售价是一致的',
    discount_rate decimal(1,2) not null default 1.00 comment '商品打折率',
    show_original_price varchar(2) not null default 'N' comment '是否显示原价,Y显示,N 不显示',
    preferential_start_date not null comment '商品优惠开始时间',
    preferential_end_date date not null comment '商品优惠结束时间',
    original_price DECIMAL(10,2) NOT NULL COMMENT '商品销售价,再没有优惠的情况下和售价是一致的',
    discount_rate DECIMAL(3,2) NOT NULL DEFAULT 1.00 COMMENT '商品打折率',
    show_original_price VARCHAR(2) NOT NULL DEFAULT 'N' COMMENT '是否显示原价,Y显示,N 不显示',
    preferential_start_date DATE NOT NULL COMMENT '商品优惠开始时间',
    preferential_end_date DATE NOT NULL COMMENT '商品优惠结束时间',
    `month` INT NOT NULL COMMENT '月份',
    create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    operate VARCHAR(3) NOT NULL COMMENT '数据状态,添加ADD,修改MOD 删除DEL'
@@ -259,9 +259,9 @@
    shop_id VARCHAR(30) NOT NULL COMMENT '商品ID',
    b_id VARCHAR(30) NOT NULL COMMENT '业务Id',
    original_price DECIMAL(10,2) not null comment '商品销售价,再没有优惠的情况下和售价是一致的',
    discount_rate decimal(1,2) not null default 1.00 comment '商品打折率',
    discount_rate decimal(3,2) not null default 1.00 comment '商品打折率',
    show_original_price varchar(2) not null default 'N' comment '是否显示原价,Y显示,N 不显示',
    preferential_start_date not null comment '商品优惠开始时间',
    preferential_start_date date not null comment '商品优惠开始时间',
    preferential_end_date date not null comment '商品优惠结束时间',
    create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    status_cd VARCHAR(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效',
@@ -291,11 +291,11 @@
    photo VARCHAR(100) NOT NULL COMMENT '照片',
    create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    status_cd VARCHAR(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效',
    UNIQUE KEY (store_photo_id)
    UNIQUE KEY (shop_photo_id)
);
CREATE INDEX idx_shop_photo_b_id ON s_store_photo(b_id);
CREATE INDEX idx_shop_photo_shop_id ON s_store_photo(shop_id);
CREATE INDEX idx_shop_photo_shop_photo_id ON s_store_photo(shop_photo_id);
CREATE INDEX idx_shop_photo_b_id ON s_shop_photo(b_id);
CREATE INDEX idx_shop_photo_shop_id ON s_shop_photo(shop_id);
CREATE INDEX idx_shop_photo_shop_photo_id ON s_shop_photo(shop_photo_id);
create table s_shop_catalog(
    catalog_id varchar(30) not null comment '目录ID',
@@ -304,7 +304,6 @@
    `name` varchar(100) not null comment '目录名称',
    level varchar(2) not null comment '目录等级',
    parent_catalog_id varchar(30) not null default '-1' comment '父目录ID,一级目录则写-1',
    `month` INT NOT NULL COMMENT '月份',
    create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    status_cd VARCHAR(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效',
     UNIQUE KEY (catalog_id)
@@ -315,15 +314,15 @@
-- 商品购买记录
create table s_buy_shop(
    buy_id varchar(30) not null comment '购买ID',
CREATE TABLE s_buy_shop(
    buy_id VARCHAR(30) NOT NULL COMMENT '购买ID',
    b_id VARCHAR(30) NOT NULL COMMENT '业务Id',
    shop_id VARCHAR(30) NOT NULL COMMENT '商品ID',
    buy_count DECIMAL(10,0) not null default 1 comment '购买商品数',
    buy_count DECIMAL(10,0) NOT NULL DEFAULT 1 COMMENT '购买商品数',
    `month` INT NOT NULL COMMENT '月份',
    create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    status_cd VARCHAR(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效',
     UNIQUE KEY (buy_id)
     UNIQUE KEY (buy_id,`month`)
)
PARTITION BY RANGE (`month`) (
    PARTITION buy_shop_1 VALUES LESS THAN (2),
@@ -350,7 +349,7 @@
    `month` INT NOT NULL COMMENT '月份',
    create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    status_cd VARCHAR(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效',
     UNIQUE KEY (attr_id)
     UNIQUE KEY (attr_id,`month`)
)
PARTITION BY RANGE (`month`) (
    PARTITION buy_shop_attr_1 VALUES LESS THAN (2),
java110-config/src/main/resources/mapper/shop/ShopServiceDaoImplMapper.xml
@@ -87,10 +87,10 @@
            and sap.b_id = #{bId}
        </if>
        <if test="shopId != null and shopId != ''">
            and sa.shop_id = #{shopId}
            and sap.shop_id = #{shopId}
        </if>
        <if test="attrParamId != null and attrParamId != ''">
            and sa.attr_param_id = #{attrParamId}
            and sap.attr_param_id = #{attrParamId}
        </if>
    </select>
@@ -111,7 +111,7 @@
    <!-- 查询商品 证件信息 add by wuxw 2018-07-03 -->
    <select id="getBusinessShopPreferential" parameterType="Map" resultType="Map">
        select sp.shop_preferential_id,sp.b_id,sc.shop_id,sp.original_price,sp.discount_rate,sp.show_original_price,sp.preferential_start_date,sp.preferential_end_date,sp.operate
        select sp.shop_preferential_id,sp.b_id,sp.shop_id,sp.original_price,sp.discount_rate,sp.show_original_price,sp.preferential_start_date,sp.preferential_end_date,sp.operate
        from business_shop_preferential sp where 1 = 1
        <if test="bId != null and bId !=''">
            and sp.b_id = #{bId}
@@ -174,8 +174,8 @@
    <insert id="saveShopAttrParamsInstance" parameterType="Map">
        insert into s_shop_attr_param(attr_param_id,b_id,shop_id,spec_cd,param,status_cd)
        select sap.attr_param_id,sap.b_id,sap.shop_id,sap.spec_cd,sap.param,'0'
        from business_shop_attr_param sa
        where sa.operate = 'ADD' and sa.b_id=#{bId}
        from business_shop_attr_param sap
        where sap.operate = 'ADD' and sap.b_id=#{bId}
    </insert>
    
    <!-- 保存 商品照片信息 instance add by wuxw 2018-07-03 -->
@@ -188,7 +188,7 @@
    <!-- 保存 商品证件信息 instance add by wuxw 2018-07-03 -->
    <insert id="saveShopPreferentialInstance" parameterType="Map">
        insert into s_shop_preferential(shop_preferential_id,b_id,shop_id,original_price,discount_rate,show_original_price,preferential_start_date,preferential_end_date,status_cd)
        select sp.shop_preferential_id,sp.b_id,sc.shop_id,sp.original_price,sp.discount_rate,sp.show_original_price,sp.preferential_start_date,sp.preferential_end_date,'0'
        select sp.shop_preferential_id,sp.b_id,sp.shop_id,sp.original_price,sp.discount_rate,sp.show_original_price,sp.preferential_start_date,sp.preferential_end_date,'0'
        from business_shop_preferential sp
        where sp.operate = 'ADD' and sp.b_id=#{bId}
    </insert>
@@ -296,7 +296,7 @@
    <!-- 查询商品证件信息 add by wuxw 2018-07-03 -->
    <select id="getShopPreferential" parameterType="Map" resultType="Map">
        select sp.shop_preferential_id,sp.b_id,sc.shop_id,sp.original_price,sp.discount_rate,sp.show_original_price,sp.preferential_start_date,sp.preferential_end_date,sc.status_cd
        select sp.shop_preferential_id,sp.b_id,sp.shop_id,sp.original_price,sp.discount_rate,sp.show_original_price,sp.preferential_start_date,sp.preferential_end_date,sp.status_cd
        from s_shop_preferential sp
        where 1=1
        <if test="statusCd != null and statusCd != ''">
@@ -332,13 +332,13 @@
        from s_shop_catalog sc
        where 1=1
        <if test="statusCd != null and statusCd != ''">
            and sd.status_cd = #{statusCd}
            and sc.status_cd = #{statusCd}
        </if>
        <if test="bId != null and bId !=''">
            and sd.b_id = #{bId}
            and sc.b_id = #{bId}
        </if>
        <if test="catalogId != null and catalogId !=''">
            and sd.catalog_id = #{catalogId}
            and sc.catalog_id = #{catalogId}
        </if>
    </select>
@@ -406,10 +406,10 @@
        <if test="shopCount != null and shopCount != ''">
            ,s.shop_count = #{shopCount}
        </if>
        <if test="startDate != null and startDate != ''">
        <if test="startDate != null">
            ,s.start_date = #{startDate}
        </if>
        <if test="endDate != null and endDate != ''">
        <if test="endDate != null">
            ,s.end_date = #{endDate}
        </if>
        where 1=1