SELECT prod.id,prod.dataXML,prod.imgXML FROM 201400220_product prod,201400220_product_cate cate WHERE prod.cateid = cate.id and (prod.inuse in ('1') or (prod.inuse='2' and prod.sdate <= '2017-06-24' and prod.edate >='2017-06-24')) and prod.cateid=2 order by cate.seq asc,prod.seq desc