mybatis写无签证接口APP

mybatis写无签证app接口

  • 一.实体类设计
  • 二.mapper.xml文件配置
  • 三.controller

一.实体类设计

(1)店铺

DROP TABLE IF EXISTS `shop_store`;
CREATE TABLE `shop_store` (
  `store_id` varchar(32) NOT NULL COMMENT '店铺索引id',
  `store_name` varchar(50) NOT NULL COMMENT '店铺名称',
  `store_auth` int(1) DEFAULT '0' COMMENT '店铺认证,0-未认证,1-认证',
  `name_auth` int(1) NOT NULL DEFAULT '0' COMMENT '店主认证,0-未认证,1-认证',
  `grade_id` varchar(32) NOT NULL COMMENT '店铺等级',
  `member_id` varchar(32) NOT NULL COMMENT '会员id',
  `member_name` varchar(50) NOT NULL COMMENT '会员名称',
  `store_owner_card` varchar(50) DEFAULT NULL COMMENT '身份证',
  `sc_id` varchar(32) DEFAULT NULL COMMENT '店铺分类',
  `area_id` varchar(32) DEFAULT NULL COMMENT '地区id',
  `store_sort` int(11) DEFAULT '0' COMMENT '店铺排序',
  `store_time` bigint(13) DEFAULT NULL COMMENT '店铺时间',
  `end_time` bigint(13) DEFAULT NULL,
  `store_label` varchar(255) DEFAULT NULL COMMENT '店铺logo',
  `store_banner` varchar(255) DEFAULT NULL COMMENT '店铺横幅',
  `store_logo` varchar(255) DEFAULT NULL COMMENT '店标',
  `store_keywords` varchar(255) DEFAULT '' COMMENT '店铺seo关键字',
  `store_description` varchar(255) DEFAULT '' COMMENT '店铺seo描述',
  `store_qq` varchar(50) DEFAULT NULL COMMENT 'QQ',
  `store_ww` varchar(50) DEFAULT NULL COMMENT '阿里旺旺',
  `description` text COMMENT '店铺简介',
  `store_zy` text COMMENT '主营商品',
  `store_domain` varchar(50) DEFAULT NULL COMMENT '店铺二级域名',
  `store_domain_times` int(1) unsigned DEFAULT '0' COMMENT '二级域名修改次数',
  `store_recommend` int(1) DEFAULT '0' COMMENT '推荐,0为否,1为是,默认为0',
  `praise_rate` float DEFAULT '0' COMMENT '店铺好评率',
  `is_del` tinyint(1) DEFAULT NULL COMMENT '是否删除,0否,1是',
  `store_desccredit` float DEFAULT '0' COMMENT '描述相符度分数',
  `store_servicecredit` float DEFAULT '0' COMMENT '服务态度分数',
  `store_deliverycredit` float DEFAULT '0' COMMENT '发货速度分数',
  `store_code` varchar(255) DEFAULT 'default_qrcode.png' COMMENT '店铺二维码',
  `store_collect` int(10) unsigned DEFAULT '0' COMMENT '店铺收藏数量',
  `store_slide` text COMMENT '店铺幻灯片',
  `store_slide_url` text COMMENT '店铺幻灯片链接',
  `store_center_quicklink` text COMMENT '卖家中心的常用操作快捷链接',
  `store_stamp` varchar(200) DEFAULT NULL COMMENT '店铺印章',
  `store_printdesc` varchar(500) DEFAULT NULL COMMENT '打印订单页面下方说明文字',
  `store_sales` int(10) unsigned DEFAULT '0' COMMENT '店铺销量',
  `store_presales` text COMMENT '售前客服',
  `store_aftersales` text COMMENT '售后客服',

  `store_lastlogintime` bigint(13) DEFAULT NULL COMMENT '上次登陆时间',
  `store_longitude` varchar(20) DEFAULT NULL COMMENT '经度',
  `store_atitude` varchar(20) DEFAULT NULL COMMENT '纬度',
  `type_id` varchar(32) DEFAULT '0' COMMENT '店铺类型ID',
  `type_name` varchar(32) DEFAULT '0' COMMENT '店铺类型名称',
  `store_app_cover` varchar(100) DEFAULT NULL COMMENT '店铺APP图标',
  `average_consumption` decimal(10,2) DEFAULT NULL COMMENT '人均消费',
  `wifi_name` varchar(30) DEFAULT NULL COMMENT 'wifi名称',
  `wifi_pwd` varchar(30) DEFAULT NULL COMMENT 'wifi密码',
  `line_order` tinyint(1) DEFAULT '0' COMMENT '在线点菜 0 支持、1 不支持',
  `line_pay` tinyint(1) DEFAULT '0' COMMENT '在线支付 0 支持、1 不支持',
  `cake_state` tinyint(1) DEFAULT '0' COMMENT '外卖 0 支持、1 不支持',
  `reservation_state` tinyint(1) DEFAULT '0' COMMENT '订房订位 0 支持、1 不支持',
  `parking_state` tinyint(1) DEFAULT '0' COMMENT '停车位 0 有、1 没有',
  `lunch_start_time` bigint(13) DEFAULT NULL COMMENT '午餐开始时间',
  `lunch_end_time` bigint(13) DEFAULT NULL COMMENT '午餐结束时间',
  `dinner_start_time` bigint(13) DEFAULT NULL COMMENT '晚餐开始时间',
  `dinner_end_time` bigint(13) DEFAULT NULL COMMENT '晚餐结束时间',
  `wifi_state` tinyint(1) DEFAULT '0' COMMENT 'WIFI 0 有、1 没有',
  `driving_state` tinyint(1) DEFAULT '0' COMMENT '代驾 0 有、1 没有',
  `store_more_picture` varchar(1000) DEFAULT NULL COMMENT '商家多张图片',
  PRIMARY KEY (`store_id`),
  KEY `store_name` (`store_name`) USING BTREE,
  KEY `sc_id` (`sc_id`) USING BTREE,
  KEY `area_id` (`area_id`) USING BTREE,
  KEY `store_state` (`store_state`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='店铺数据表';


DROP TABLE IF EXISTS `shop_store_class`;
CREATE TABLE `shop_store_class` (
  `id` varchar(32) NOT NULL COMMENT '索引ID',
  `name` varchar(100) NOT NULL COMMENT '分类名称',
  `parent_id` varchar(32) NOT NULL DEFAULT '0' COMMENT '父ID',
  `sort` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  `is_del` tinyint(4) DEFAULT '0' COMMENT '是否删除0:未删除;1:已删除',
  `create_time` bigint(13) DEFAULT NULL COMMENT '创建时间',
  `update_time` bigint(13) DEFAULT NULL COMMENT '修改时间',
  PRIMARY KEY (`id`),
  KEY `sc_parent_id` (`parent_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='店铺分类表';

-- ----------------------------
-- Table structure for kyt_shentong_storeparlor
-- ----------------------------
DROP TABLE IF EXISTS `storeparlor`;
CREATE TABLE `kyt_shentong_storeparlor` (
  `storeparlor_id` varchar(32) NOT NULL COMMENT '商家餐饮包间ID',
  `store_id` varchar(32) NOT NULL COMMENT '商家ID',
  `store_name` varchar(50) DEFAULT NULL COMMENT '商家名称',
  `buyer_id` varchar(32) NOT NULL COMMENT '用户id',
  `parlor_name` varchar(50) DEFAULT NULL COMMENT '包间名称',
  `lowest_cost` decimal(10,2) DEFAULT NULL COMMENT '最低消费',

  `limit_time` varchar(15) DEFAULT NULL COMMENT '限时退时间',
  `parlor_introduce` varchar(150) DEFAULT NULL COMMENT '包间介绍',
  `parlor_images` varchar(1000) DEFAULT NULL COMMENT '包间图片',
  `parlor_restaurant_state` tinyint(1) DEFAULT '0' COMMENT '包间餐位状态 0 未预定、1 已预定',
  `parlor_state` tinyint(1) DEFAULT '0' COMMENT '包间状态 0 上架、1 下架',
  `waiter_image` varchar(150) DEFAULT NULL COMMENT '服务员图片',
  `waiter_nickname` varchar(50) DEFAULT NULL COMMENT '服务员昵称',
  `is_toilet` tinyint(1) DEFAULT '0' COMMENT '独立卫生间 0 无、1 有',
  `is_wifi` tinyint(1) DEFAULT '0' COMMENT '有无WIFI 0 无、1 有',
  `is_mahjong` tinyint(1) DEFAULT '0' COMMENT '麻将机 0 无、1 有',
  `is_window` tinyint(1) DEFAULT '0' COMMENT '有无窗户 0 无、1 有',
  `parlor_type` tinyint(1) DEFAULT '0' COMMENT '类型 0 包间、1 餐位',
  `schedule_cost` decimal(10,2) DEFAULT NULL COMMENT '预订费',
  `min_num` int(10) unsigned DEFAULT '0' COMMENT '最小人数',
  `max_num` int(10) unsigned DEFAULT '0' COMMENT '最大人数',
  `is_TV` tinyint(1) DEFAULT '0' COMMENT '有无电视0 无、1 有',
  `is_airCondition` tinyint(1) DEFAULT '0' COMMENT '有无空调0无、1 有',
  PRIMARY KEY (`storeparlor_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='包间表';

mapper xml配置

 <resultMap type="com.kytsoft.core.entity.vo.StoreExcelVo" id="ParlorAndStoreMap" extends="BaseResultMap">
        <result column="store_name" property="storeName"  jdbcType="VARCHAR" />
        <result column="parking_state" property="parkingState" jdbcType="VARCHAR" />
        <result column="praise_rate" property="praiseRate"  jdbcType="VARCHAR" />
        <result column="sc_id" property="scId" jdbcType="VARCHAR" />
        <result column="store_address" property="storeAddress" jdbcType="VARCHAR"/>
        <result column="store_logo" property="storeLogo" jdbcType="VARCHAR"/>
        <result column="store_more_picture" property="storeMorePicture" jdbcType="VARCHAR"/>
        <result column="wifi_state" property="wifiState" jdbcType="VARCHAR"/>
        <result column="store_tel" property="storeTel" jdbcType="VARCHAR"/>
        <result column="schedule_cost" property="scheduleCost" jdbcType="VARCHAR"/>
        <result column="is_airCondition" property="isAirCondition" jdbcType="VARCHAR"/>
        <result column="is_mahjong" property="isMahjong" jdbcType="VARCHAR"/>
        <result column="is_toilet" property="isToilet" jdbcType="VARCHAR"/>
        <result column="is_TV" property="isTV" jdbcType="VARCHAR"/>
        <result column="is_wifi" property="isWifi" jdbcType="VARCHAR"/>
        <result column="is_window" property="isWindow" jdbcType="VARCHAR"/>
        <result column="max_num" property="maxNum" jdbcType="VARCHAR"/>
        <result column="min_num" property="minNum" jdbcType="VARCHAR"/>
        <result column="parlor_images" property="parlorImages" jdbcType="VARCHAR"/>
        <result column="parlor_name" property="parlorName" jdbcType="VARCHAR"/>
        <result column="juli" property="distance" jdbcType="VARCHAR"/>
        <result column="gc_name" property="gcName" jdbcType="VARCHAR"/>
        <result column="store_id" property="storeId" jdbcType="VARCHAR" />
    </resultMap> 
    <sql id="Base_Column_Juli2">
        <if test="test=condition.memberLongitude != null and condition.memberLongitude != ''
            and condition.memberAtitude != null and condition.memberAtitude != '' ">
            , round(6378.138 * 2 * asin(sqrt(pow(sin((#{condition.memberAtitude} * pi() / 180 - s1.store_atitude * pi() / 180) / 2),2) + cos(#{condition.memberAtitude} * pi() / 180) * cos(s1.store_atitude * pi() / 180) * pow(sin((#{condition.memberLongitude} * pi() / 180 - s1.store_longitude * pi() / 180) / 2),2))) * 1000) AS juli
        </if>
    </sql>
    <sql id="whereCondition1">
    <where>
      1=1
    <!-- 判断车位 -->
    <if test="condition.parkingState!=null and condition.parkingState!=''">
        <if test="condition.parkingState==1">
        or s1.parking_state=0
        </if>
    </if> 

    <if test="condition.wifiState!=null and condition.wifiState!=''">
    or s1.wifi_state=#{condition.wifiState}
    </if>

    <if test="condition.scId!=null and condition.scId!=''">
    or s1.sc_id=#{condition.scId}
    </if>

    <if test="condition.avgMinPrice!=null and condition.avgMaxPrice!=null">
    or s1.average_consumption between #{condition.avgMinPrice} and #{condition.avgMaxPrice}
    </if>

    <!-- 就餐人数 -->
    <if test="condition.minNum!=null and condition.minNum!='' and condition.maxNum!=null and condition.maxNum!='' ">
    or kytss.min_num &gt;#{condition.minNum}
    </if>

    <if test="condition.maxNum!=null and condition.maxNum!='' and condition.minNum!=null and condition.minNum!='' ">
    or kytss.max_num &gt;#{condition.maxNum}
    </if>

    <!-- 最低消费 -->
    <if test="condition.minPrice!=null and condition.minPrice!=''">
    or kytss.lowest_cost !=0
    </if>

    <!-- 订金 -->
    <if test="condition.scheduleCost!=null and condition.scheduleCost!=''">
    <if test="condition.isScheduleCost==0">
    or kytss.schedule_cost =0
    </if>  
    </if>

    <if test="condition.isScheduleCost==1">
    or kytss.schedule_cost &gt;0
    </if>

    <!-- 麻将机 -->
    <if test="condition.isMahjong!=null and condition.isMahjong!='' ">
    or kytss.is_mahjong=#{condition.isMahjong}    
    </if>

    <!-- 空调 -->
    <if test="condition.isAirCondition!=null">
    or kytss.is_airCondition=#{condition.isAirCondition}
    </if>

    <!-- 独卫 -->
    <if test="condition.isToilet!=null and condition.isToilet!=''">
    or kytss.is_toilet=#{condition.isToilet}
    </if>

    <!-- 电视 -->
    <if test="condition.isTV!=null">
    or kytss.is_TV=#{condition.isTV}
    </if>

    <!-- 窗户 -->
    <if test="condition.isWindow!=null and condition.isWindow!=''">
    or kytss.is_window=#{condition.isWindow}
    </if>
    </where>
    </sql>

    <sql id="whereCondition4">  
        <if test="condition.gcName!=null and condition.gcName!=''">
                or ssc.name=#{condition.gcName}
        </if>   
    </sql>

    <sql id="queryOrderBy1">
    <!-- 人气最旺 -->
        <if test="condition.storeSales==2">
            ORDER BY s2.store_sales     desc
    </if>
    </sql>
    <!-- 距离最短 -->
    <sql id="queryOrderBy2">
        <if test="condition.recently==0">       
        ORDER BY     s2.juli     asc
        </if>
    </sql>
    <!-- 评价 -->
    <sql id="queryOrderBy3">
    <if test="condition.praise==1">
   ORDER BY     s2.praise_rate  desc
    </if> 
    </sql>

    <!-- 活动筛选 -->
    <sql id="whereCondition5">
         <!-- 满减、满送 -->
        <if test="condition.activties==10 or condition.activties==30">
            and sct.activity_type=#{condition.activities}
        </if>
    </sql>

 <select id="queryParlorAndStore"  resultMap="ParlorAndStoreMap" parameterType="com.kytsoft.core.utils.page.Pager">         

                                            SELECT
                                                                s2.*                                                                                                                
                                                            FROM
                                                            (
                                                            SELECT 
                                                                        s3.*,
                                                                        ssc.name as gc_name
                                                                        FROM(   
                                                                                            SELECT 
                                                                                            s1.store_name,
                                                                                            s1.parking_state,
                                                                                            s1.praise_rate,
                                                                                            s1.store_id,
                                                                                            s1.sc_id,
                                                                                            s1.store_address,
                                                                                            s1.store_logo,
                                                                                            s1.store_more_picture,
                                                                                            s1.wifi_state,
                                                                                             s1.store_sales,                                                                                        
                                                                                            s1.store_tel,
                                                                                            kytss.schedule_cost,
                                                                                            kytss.is_airCondition,
                                                                                            kytss.is_mahjong,
                                                                                            kytss.is_toilet,
                                                                                            kytss.is_TV,
                                                                                            kytss.is_wifi,
                                                                                            kytss.is_window,
                                                                                            kytss.max_num,
                                                                                            kytss.min_num,
                                                                                            kytss.parlor_images,
                                                                                            kytss.parlor_name 
                                                                                            <include refid="Base_Column_Juli2"/>
                                                                                            from   shop_store s1 inner  join   kyt_shentong_storeparlor kytss
                                                                                            on  s1.store_id = kytss.store_id                                                                                                                                    
                                                                                            <include refid="whereCondition1"/>                                                                                                                                                                                                                                                                                                                                                          
                                                                                            )   s3  inner   join     shop_store_class   ssc 
                                                                                            on  s3.sc_id = ssc.id
                                                                                            <include refid="whereCondition4"/>                                                                                              
                                                                                )s2 inner join shop_activity sct 
                                                                                on s2.store_id=sct.store_id
                                                                                <!-- 筛选 人气-距离-评价 -->
                                                                                <include refid="whereCondition5"/>
                                                                                <include refid="queryOrderBy1"/>                                                                <include refid="queryOrderBy2"/>
                                                                                <include refid="queryOrderBy3"/>    



    </select>
dao层、server层、和mapper层方法
findParlorreserveAllList(Pager pager);

controller层方法接口
/**
 * 
 * @author H.jeao
 * @date 2017-4-20
 * @category 包间订餐处理接口
 * @version 1.0
 */

@Slf4j
@Controller
@RequestMapping("/showorderparlor")
public class ShowParlorListApiV1 extends BaseApiV1 {
    /**
     * 时间格式
     */
    public static final String dateFormatYMDHMS = "yyyy-MM-dd HH:mm:ss";

    @Resource
    private  storeparlorService storeparlorService;

    @Resource
    private parlorreserveService parlorreserveService;

    @Resource
    private StoreService storeService;

    @Resource
    private AppTokenService appTokenService;

    @RequestMapping(path = "showcanorderparlors", method = RequestMethod.GET)
    @ResponseBody
    public HashMap<String, Object> getStoreAndParlor(

            @RequestParam(value = "activties", required = false) String activties, // 活动中的0-优惠券10-满减30-满送
            @RequestParam(value = "scheduleCost", required = false, defaultValue = "0") String scheduleCost, // 订金
            @RequestParam(value = "minNum", required = false, defaultValue = "") String minNum, // 就餐人数
            @RequestParam(value = "maxNum", required = false, defaultValue = "") String maxNum, // 就餐人数
            @RequestParam(value = "sc_id", required = false, defaultValue = "") String sc_id, //
            @RequestParam(value = "selectName", required = false) String selectName, // 商家名称
            @RequestParam(value = "archArray", required = false) String archArray, // 0-距离最短;1-评价最好;2-人气最旺
            @RequestParam(value = "lowerCost", required = false, defaultValue = "") String lowerCost, // 最低消费、
            @RequestParam(value = "avgMinPrice", required = false) String avgMinPrice, // 人均消费下限
            @RequestParam(value = "avgMaxPrice", required = false) String avgMaxPrice, // 人均消费上限
            @RequestParam(value = "homeType", required = false) String homeType, // 商家类型
            @RequestParam(value = "homeSelectCondition", required = false) String homeSelectCondition, // 包间条件
            @RequestParam(value = "storeId", required = false) String storeId, // 商家Id
            @RequestParam(value = "longAititude", required = true) String longAititude, // 经度
            @RequestParam(value = "atitude", required = true) String atitude, // 纬度
            @RequestParam(value = "pageSize", required = false, defaultValue = "5") int pageSize, // 分页区间
            @RequestParam(value = "pageStart", required = false, defaultValue = "0") int pageStart, // 开始页
            @RequestParam(value = "dinnerTime", required = true) String dinnerTime, // 就餐日期
            @RequestParam(value = "selectType", required = true) String selectType// 筛
    // 选的分类,在包间列表页两处的分别作用,一是“搜索输入处”,二是筛选条件处。约定条件0、1、2;0——输入搜索,1——条件搜索
    // 2——从约定商家进入筛选其包间信息
    ) {
        try {
            Map<String, Object> resultMap = new HashMap<>();
            List<Map<String, Object>> list = new ArrayList<>();
            StoreparlorVo sstv0 = new StoreparlorVo();
            StoreExcelVo stv0 = new StoreExcelVo();
            sstv0.setParlorRestaurantState(0);
            sstv0.setParlorState(0);
            sstv0.setParlorType(0);
            Pager pager = new Pager();
            pager.setPageSize(pageSize);
            pager.setStart(pageStart);
            int caseCd = Integer.parseInt(selectType);
            if(StringUtils.isNotBlank(selectType)){
                switch (caseCd) {
                case 0:
                    if (selectName != null && !"".equals(selectName) && !"''".equals(selectName)) {
                        stv0.setStoreName(selectName);// 商家名,模糊查询
                        sstv0.setParlorName(selectName);// 包间名,模糊查询
                        stv0.setMemberLongitude(longAititude);
                        stv0.setMemberAtitude(atitude);
                        pager.setCondition(stv0);
                        List<Store> store_list1 = storeService.findStoreListByFzyName(pager);// 按商家名称搜索
                        pager.setCondition(sstv0);
                        List<Storeparlor> shtong_list1 = storeparlorService.findParlorByParlorName(pager);// 按包间名称搜索
                        List<List<Storeparlor>> returnSstList1 = null;
                        List<Storeparlor> returnSstList = null;
                        List<Store> returnStoreList1 = null;
                        if (store_list1 != null) {
                            int size = store_list1.size();
                            if (size != 0) {
                                returnSstList1 = new ArrayList<>();
                                returnStoreList1 = new ArrayList<>();
                                for (int i = 0; i < size; i++) {
                                    sstv0.setStoreId(store_list1.get(i).getStoreId());
                                    pager.setCondition(sstv0);
                                    List<Storeparlor> sst = storeparlorService.findParlorByStoreId(pager);
                                    if (sst != null) {
                                        returnSstList1.add(sst);// 一个商家对应若干个包间
                                        returnStoreList1.add(store_list1.get(i));
                                    }
                                }
                                resultMap.put("storeList", returnStoreList1);
                                resultMap.put("parlorList", returnSstList1);
                                list.add(resultMap);
                                pager.setResult(list);
                                return toResultMap(AppCode.SUCCESS, "查询结果:成功",
                                        JSONObject.fromObject(pager, JsonUtils.getJsonConfig()));
                            }
                        } else if (shtong_list1 != null) {
                            int shSize = shtong_list1.size();
                            returnSstList = new ArrayList<>();
                            returnStoreList1 = new ArrayList<>();
                            if (shSize != 0) {
                                for (int i = 0; i < shSize; i++) {
                                    stv0.setStoreId(shtong_list1.get(i).getStoreId());
                                    pager.setCondition(stv0);
                                    Store store = storeService.findStoreByStIdPage(pager);
                                    if (store != null) {
                                        returnStoreList1.add(store);
                                        returnSstList.add(shtong_list1.get(i));
                                        System.out.println(store);
                                    }
                                }
                                resultMap.put("storeList", returnStoreList1);
                                resultMap.put("parlorList", returnSstList);
                                list.add(resultMap);
                                pager.setResult(list);
                                return toResultMap(AppCode.SUCCESS, "查询结果:成功",
                                        JSONObject.fromObject(pager, JsonUtils.getJsonConfig()));
                            }
                        }
                    }
                case 1:
                    if (dinnerTime != null && !"".equals(dinnerTime) && longAititude != null && atitude != null&& !"".equals(longAititude) && !"".equals(atitude)) {
                        stv0.setGcName(homeType);
                        if(StringUtils.isNotBlank(longAititude)){
                            stv0.setMemberLongitude(longAititude);                      
                        }
                        if(StringUtils.isNotBlank(atitude)){
                            stv0.setMemberAtitude(atitude);                 
                        }
                        if(StringUtils.isNotBlank(dinnerTime)){
                            stv0.setLunchStartTime(Long.parseLong(dinnerTime)); 
                        }
                        stv0.setScId(sc_id);
                        if(StringUtils.isNotBlank(minNum)){
                                stv0.setMinNum(Integer.parseInt(minNum));
                            }               
                        if(StringUtils.isNotBlank(maxNum)){
                                stv0.setMaxNum(Integer.parseInt(maxNum));                   
                        }
                        if(StringUtils.isNotBlank(lowerCost)){
                            stv0.setMinPrice(new BigDecimal(lowerCost));                    
                        }
                        if(StringUtils.isNotBlank(scheduleCost)){
                            stv0.setIsScheduleCost(Integer.parseInt(scheduleCost));                     
                        }
                        if (StringUtils.isNotBlank(avgMinPrice)) {
                                stv0.setAvgMinPrice(avgMinPrice);                       
                        }
                        if (StringUtils.isNotBlank(avgMaxPrice)) {
                                stv0.setAvgMinPrice(avgMaxPrice);
                        }
                        if (archArray != null && !"".equals(archArray)) {
                            if (StringUtils.isNotBlank(archArray)) {
                                if ("0".equals(archArray)) {
                                    stv0.setRecently(0);
                                } else if ("1".equals(archArray)) {
                                    stv0.setPraise(1);
                                } else if ("2".equals(archArray)) {
                                    stv0.setStoreSales(2);
                                }
                            }
                        }
                        if (activties != null && "".equals(activties)) {
                            if (StringUtils.isNotBlank(activties)) {
                                if ("0".equals(activties)) {
                                    stv0.setCoupon("coupon");
                                } 
                                    stv0.setActivties(activties);
                            }
                        }                       
                        if (homeSelectCondition != null) {
                            if (homeSelectCondition.indexOf("停车")>0) {
                                stv0.setParkingState(0);
                            }
                            if (homeSelectCondition.indexOf("WIFI")>0) {
                                stv0.setWifiState(1);
                            }
                            if (homeSelectCondition.indexOf("麻将机")>0) {
                                stv0.setIsMahjong(1);
                                ;
                            }
                            if (homeSelectCondition.indexOf("空调")>0) {
                                stv0.setIsAirCondition("1");
                            }
                            if (homeSelectCondition.indexOf("独卫")>0) {
                                stv0.setIsToilet("1");
                            }
                            if (homeSelectCondition.indexOf("电视")>0) {
                                stv0.setIsTV("1");
                            }
                            if (homeSelectCondition.indexOf("窗户")>0) {
                                stv0.setIsWindow("1");
                            }
                        }
                        pager.setCondition(stv0);
                        List<StoreExcelVo> pslist = storeService.queryParlorAndStore(pager);
                        pager.setResult(pslist);
                        return toResultMap(AppCode.SUCCESS, "包间多条件查询结果:成功",
                                JSONObject.fromObject(pager, JsonUtils.getJsonConfig()));               
                    }
                    case 3:

                default:
                    return toResultMap(AppCode.FAILURE, "操作失败");
                }       
            }else{
                return toResultMap(AppCode.FAILURE, "输入有误!");
            }
        } catch (Exception e) { // TODO: handle exception
            e.printStackTrace();
            return toResultMap(AppCode.FAILURE, "操作失败");
        }
    }

请求的参数列表

![这里写图片描述](http://img.blog.csdn.net/20170508181938717?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvQ2hhdWRlbWVudFd1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)

响应数据
```json
{
    "msg": "包间多条件查询结果:成功",
    "code": 1,
    "data": {
        "result": [{
            "maxNum": 1,
            "isTV": "0",
            "minNum": 1,
            "praiseRate": 0.0,
            "scheduleCost": "234.00",
            "parkingState": 0,
            "isMahjong": 0,
            "storeId": "8b2425a288564a93bd7941e30433c6f5",
            "isWindow": "0",
            "wifiState": 0,
            "isAirCondition": "0",
            "isToilet": "0",
            "scId": "d2a9545fb6ec4fb68786096c55b42202",
            "distance": "7929139",
            "storeName": "小店铺",
            "gcName": "同城购物",
            "parlorName": "DFV",
            "isWifi": "0",
            "parlorImages": "/upload/img/store/3d3e58a85a034bda91edb1c03934d373/1490290081777.jpg,/upload/img/store/3d3e58a85a034bda91edb1c03934d373/1490290089762.jpg,"
        },
        {
            "maxNum": 2,
            "isTV": "1",
            "minNum": 2,
            "praiseRate": 0.0,
            "scheduleCost": "234.00",
            "parkingState": 0,
            "isMahjong": 1,
            "storeId": "8b2425a288564a93bd7941e30433c6f5",
            "isWindow": "0",
            "wifiState": 0,
            "isAirCondition": "1",
            "isToilet": "0",
            "scId": "d2a9545fb6ec4fb68786096c55b42202",
            "distance": "7929139",
            "storeName": "小店铺",
            "gcName": "同城购物",
            "parlorName": "234",
            "isWifi": "1",
            "parlorImages": "/upload/img/store/3d3e58a85a034bda91edb1c03934d373/1490290081777.jpg,/upload/img/store/3d3e58a85a034bda91edb1c03934d373/1490290089762.jpg,"
        },
        {
            "maxNum": 2,
            "isTV": "0",
            "minNum": 2,
            "praiseRate": 0.0,
            "scheduleCost": "300.00",
            "parkingState": 0,
            "isMahjong": 0,
            "storeId": "8b2425a288564a93bd7941e30433c6f5",
            "isWindow": "0",
            "wifiState": 0,
            "isAirCondition": "0",
            "isToilet": "0",
            "scId": "d2a9545fb6ec4fb68786096c55b42202",
            "distance": "7929139",
            "storeName": "小店铺",
            "gcName": "同城购物",
            "parlorName": "567",
            "isWifi": "0",
            "parlorImages": "/upload/img/store/8b2425a288564a93bd7941e30433c6f5/1493795634365.jpg,"
        },
        {
            "maxNum": 1,
            "isTV": "0",
            "minNum": 1,
            "praiseRate": 0.0,
            "scheduleCost": "234.00",
            "parkingState": 0,
            "isMahjong": 0,
            "storeId": "8b2425a288564a93bd7941e30433c6f5",
            "isWindow": "0",
            "wifiState": 0,
            "isAirCondition": "0",
            "isToilet": "0",
            "scId": "d2a9545fb6ec4fb68786096c55b42202",
            "distance": "7929139",
            "storeName": "小店铺",
            "gcName": "同城购物",
            "parlorName": "DFV",
            "isWifi": "0",
            "parlorImages": "/upload/img/store/3d3e58a85a034bda91edb1c03934d373/1490290081777.jpg,/upload/img/store/3d3e58a85a034bda91edb1c03934d373/1490290089762.jpg,"
        },
        {
            "maxNum": 2,
            "isTV": "1",
            "minNum": 2,
            "praiseRate": 0.0,
            "scheduleCost": "234.00",
            "parkingState": 0,
            "isMahjong": 1,
            "storeId": "8b2425a288564a93bd7941e30433c6f5",
            "isWindow": "0",
            "wifiState": 0,
            "isAirCondition": "1",
            "isToilet": "0",
            "scId": "d2a9545fb6ec4fb68786096c55b42202",
            "distance": "7929139",
            "storeName": "小店铺",
            "gcName": "同城购物",
            "parlorName": "234",
            "isWifi": "1",
            "parlorImages": "/upload/img/store/3d3e58a85a034bda91edb1c03934d373/1490290081777.jpg,/upload/img/store/3d3e58a85a034bda91edb1c03934d373/1490290089762.jpg,"
        }],
        "condition": {
            "isTV": "1",
            "minNum": 0,
            "memberAtitude": "21.2",
            "memberLongitude": "33.5",
            "avgMinPrice": "9000",
            "isScheduleCost": 0,
            "minPrice": 1,
            "lunchStartTimeStr": "1489717800000",
            "scId": "",
            "lunchStartTime": 1493270625000
        },
        "pageCount": 6,
        "toUrl": "",
        "pageNo": 1,
        "start": 0,
        "orderBy": 0,
        "pageSize": 5,
        "totalRows": 27
    }
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值