| | |
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | |
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.entity.shop.BanLiShopGoodsSets;
|
| | | import com.yeshi.fanli.exception.shop.BanLiShopGoodsSetException;
|
| | | import com.yeshi.fanli.exception.shop.BanLiShopGoodsSetPayException;
|
| | | import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsSetService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
| | | @Resource
|
| | | private BanLiShopGoodsSetService banLiShopGoodsSetService;
|
| | |
|
| | | |
| | | /**
|
| | | * 保存信息
|
| | | * |
| | | * @param callback
|
| | | * @param special
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "save")
|
| | | public void save(String callback, BanLiShopGoodsSets record, HttpServletRequest request, PrintWriter out) {
|
| | | try {
|
| | | banLiShopGoodsSetService.addSet(record);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
|
| | | } catch (BanLiShopGoodsSetException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (BanLiShopGoodsSetPayException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 删除
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "query")
|
| | | public void query(String callback, Integer pageIndex, Integer pageSize, String key, PrintWriter out) {
|
| | | public void query(String callback, Integer pageIndex, Integer pageSize, String key, Long goodsId, PrintWriter out) {
|
| | | try {
|
| | | if (pageIndex == null || pageIndex < 1)
|
| | | pageIndex = 1;
|
| | |
| | | if (pageSize == null || pageSize < 1)
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | |
|
| | | List<BanLiShopGoodsSets> list = banLiShopGoodsSetService.listQuery(pageIndex, pageSize, key);
|
| | | List<BanLiShopGoodsSets> list = banLiShopGoodsSetService.listQuery(pageIndex, pageSize, key, goodsId);
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | long count = banLiShopGoodsSetService.countQuery(key);
|
| | | long count = banLiShopGoodsSetService.countQuery(key, goodsId);
|
| | |
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | |
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.entity.shop.BanLiShopGoodsSetsPay;
|
| | | import com.yeshi.fanli.exception.shop.BanLiShopGoodsSetPayException;
|
| | | import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsSetPayService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
| | |
|
| | | @Resource
|
| | | private BanLiShopGoodsSetPayService banLiShopGoodsSetPayService;
|
| | | |
| | | |
| | | @RequestMapping(value = "save")
|
| | | public void save(String callback, BanLiShopGoodsSetsPay record, HttpServletRequest request, PrintWriter out) {
|
| | | try {
|
| | | banLiShopGoodsSetPayService.addSetPay(record);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
|
| | | } catch (BanLiShopGoodsSetPayException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "query")
|
| | | public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer payType, PrintWriter out) {
|
| | | public void query(String callback, Integer pageIndex, Integer pageSize, Long setId, String key, Integer payType, PrintWriter out) {
|
| | | try {
|
| | | if (pageIndex == null || pageIndex < 1)
|
| | | pageIndex = 1;
|
| | |
| | | if (pageSize == null || pageSize < 1)
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | |
|
| | | List<BanLiShopGoodsSetsPay> list = banLiShopGoodsSetPayService.listQuery(pageIndex, pageSize, key, payType);
|
| | | List<BanLiShopGoodsSetsPay> list = banLiShopGoodsSetPayService.listQuery(pageIndex, pageSize, key, payType, setId);
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | long count = banLiShopGoodsSetPayService.countQuery(key, payType);
|
| | | long count = banLiShopGoodsSetPayService.countQuery(key, payType, setId);
|
| | |
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
| | | * @param count
|
| | | * @return
|
| | | */
|
| | | List<BanLiShopGoodsSets> listQuery(@Param("start") long start, @Param("count") int count, @Param("key") String key);
|
| | | List<BanLiShopGoodsSets> listQuery(@Param("start") long start, @Param("count") int count, |
| | | @Param("key") String key, @Param("goodsId")Long goodsId);
|
| | |
|
| | | /**
|
| | | * 计数
|
| | |
| | | * @param state
|
| | | * @return
|
| | | */
|
| | | long countQuery(@Param("key") String key);
|
| | | long countQuery(@Param("key") String key, @Param("goodsId")Long goodsId);
|
| | | } |
| | |
| | | * @param count
|
| | | * @return
|
| | | */
|
| | | List<BanLiShopGoodsSetsPay> listQuery(@Param("start") long start, @Param("count") int count, @Param("key") String key, @Param("payType") Integer payType);
|
| | | List<BanLiShopGoodsSetsPay> listQuery(@Param("start") long start, @Param("count") int count,
|
| | | @Param("key") String key, @Param("payType") Integer payType, @Param("setId")Long setId);
|
| | |
|
| | | /**
|
| | | * 计数
|
| | |
| | | * @param state
|
| | | * @return
|
| | | */
|
| | | long countQuery(@Param("key") String key, @Param("payType") Integer payType);
|
| | | long countQuery(@Param("key") String key, @Param("payType") Integer payType, @Param("setId")Long setId);
|
| | |
|
| | | } |
| | |
| | | <select id="listQuery" resultMap="BaseResultMap">
|
| | | select <include refid="Base_Column_List" /> from yeshi_ec_shop_goods_set
|
| | | where sgs_name like '${key}%'
|
| | | <if test="goodsId != null">AND sgs_goods_id = #{goodsId}</if>
|
| | | order by sgs_weight desc
|
| | | limit #{start},#{count}
|
| | | </select>
|
| | |
|
| | | <select id="countQuery" resultType="java.lang.Long">
|
| | | select count(sgs_id) from yeshi_ec_shop_goods_set
|
| | | where sgs_name like '${key}%'
|
| | | where sgs_name like '${key}%' <if test="goodsId != null">AND sgs_goods_id = #{goodsId}</if>
|
| | | </select>
|
| | |
|
| | |
|
| | |
| | | <if test="payType != null">
|
| | | and sp_pay_type=#{payType}
|
| | | </if>
|
| | | <if test="setId != null">
|
| | | and sp_goods_set_id = #{setId}
|
| | | </if>
|
| | | order by sp_weight desc
|
| | | limit #{start},#{count}
|
| | | </select>
|
| | |
| | | <if test="payType != null">
|
| | | and sp_pay_type=#{payType}
|
| | | </if>
|
| | | <if test="setId != null">
|
| | | and sp_goods_set_id = #{setId}
|
| | | </if>
|
| | | </select>
|
| | |
|
| | |
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | public List<BanLiShopGoodsSetsPay> listQuery(int page, int pageSize, String key, Integer payType) {
|
| | | return banLiShopGoodsSetsPayMapper.listQuery((page - 1) * pageSize, pageSize, key, payType);
|
| | | public List<BanLiShopGoodsSetsPay> listQuery(int page, int pageSize, String key, Integer payType, Long setId) {
|
| | | return banLiShopGoodsSetsPayMapper.listQuery((page - 1) * pageSize, pageSize, key, payType, setId);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countQuery(String key, Integer payType) {
|
| | | return banLiShopGoodsSetsPayMapper.countQuery(key, payType);
|
| | | public long countQuery(String key, Integer payType, Long setId) {
|
| | | return banLiShopGoodsSetsPayMapper.countQuery(key, payType, setId);
|
| | | }
|
| | |
|
| | |
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | public List<BanLiShopGoodsSets> listQuery(int page, int pageSize, String key) {
|
| | | return banLiShopGoodsSetsMapper.listQuery((page - 1) * pageSize, pageSize, key);
|
| | | public List<BanLiShopGoodsSets> listQuery(int page, int pageSize, String key, Long goodsId) {
|
| | | return banLiShopGoodsSetsMapper.listQuery((page - 1) * pageSize, pageSize, key, goodsId);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countQuery(String key) {
|
| | | return banLiShopGoodsSetsMapper.countQuery(key);
|
| | | public long countQuery(String key, Long goodsId) {
|
| | | return banLiShopGoodsSetsMapper.countQuery(key, goodsId);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | * @param payType
|
| | | * @return
|
| | | */
|
| | | public List<BanLiShopGoodsSetsPay> listQuery(int page, int pageSize, String key, Integer payType);
|
| | | public List<BanLiShopGoodsSetsPay> listQuery(int page, int pageSize, String key, Integer payType, Long setId);
|
| | |
|
| | | public long countQuery(String key, Integer payType);
|
| | | public long countQuery(String key, Integer payType, Long setId);
|
| | |
|
| | | }
|
| | |
| | | * @param key
|
| | | * @return
|
| | | */
|
| | | public List<BanLiShopGoodsSets> listQuery(int page, int pageSize, String key);
|
| | | public List<BanLiShopGoodsSets> listQuery(int page, int pageSize, String key, Long goodsId);
|
| | |
|
| | | public long countQuery(String key);
|
| | | public long countQuery(String key, Long goodsId);
|
| | |
|
| | | }
|