Forráskód Böngészése

收款权限错误取值bugfix

zhijiezhao 1 éve
szülő
commit
a5eed0287f
45 módosított fájl, 449 hozzáadás és 5027 törlés
  1. 3 3
      src/main/java/com/caimei/modules/order/entity/CmDiscernReceipt.java
  2. 2 2
      src/main/java/com/caimei/modules/order/entity/ReceiptRecordVo.java
  3. 0 16
      src/main/java/com/caimei/modules/permission/dao/ReceiptUserPermissionDao.java
  4. 0 75
      src/main/java/com/caimei/modules/permission/entity/ReceiptUserPermission.java
  5. 0 52
      src/main/java/com/caimei/modules/permission/service/ReceiptUserPermissionService.java
  6. 0 112
      src/main/java/com/caimei/modules/permission/web/ReceiptUserPermissionController.java
  7. 0 36
      src/main/java/com/caimei/modules/weisha/dao/CmOrganizeProductDao.java
  8. 1 2
      src/main/java/com/caimei/modules/weisha/dao/CmOrganizeStoreDao.java
  9. 1 38
      src/main/java/com/caimei/modules/weisha/service/CmOrganizeProductService.java
  10. 4 27
      src/main/java/com/caimei/modules/weisha/service/CmOrganizeStoreService.java
  11. 0 12
      src/main/java/com/caimei/modules/weisha/web/CmOrganizeProductController.java
  12. 0 161
      src/main/resources/mappings/modules/activity/FreeShippingMapper.xml
  13. 0 116
      src/main/resources/mappings/modules/activity/FreeShippingTypeMapper.xml
  14. 0 111
      src/main/resources/mappings/modules/activity/LaserMapper.xml
  15. 0 102
      src/main/resources/mappings/modules/advisory/CmAdvisoryMapper.xml
  16. 0 129
      src/main/resources/mappings/modules/banner/CrmBannerMapper.xml
  17. 0 165
      src/main/resources/mappings/modules/brand/BrandAgentMapper.xml
  18. 0 120
      src/main/resources/mappings/modules/brand/BrandIdentificationCodeMapper.xml
  19. 0 239
      src/main/resources/mappings/modules/brand/BrandProductMapper.xml
  20. 0 169
      src/main/resources/mappings/modules/brand/BrandProductsMapper.xml
  21. 0 148
      src/main/resources/mappings/modules/brand/BrandPurchaserMapper.xml
  22. 0 184
      src/main/resources/mappings/modules/brand/BrandSupplierMapper.xml
  23. 0 76
      src/main/resources/mappings/modules/brand/ProductModelMapper.xml
  24. 0 75
      src/main/resources/mappings/modules/brand/ShopModelMapper.xml
  25. 0 106
      src/main/resources/mappings/modules/bulkpurchase/CmRefundsRecordMapper.xml
  26. 0 28
      src/main/resources/mappings/modules/bulkpurchase/CommissionsMapper.xml
  27. 0 143
      src/main/resources/mappings/modules/cibe/CibeBlessingCompoMapper.xml
  28. 0 107
      src/main/resources/mappings/modules/cibe/CibePrizeMapper.xml
  29. 0 113
      src/main/resources/mappings/modules/cibe/CibeProductTypeMapper.xml
  30. 0 150
      src/main/resources/mappings/modules/cibe/CibeShopMapper.xml
  31. 0 96
      src/main/resources/mappings/modules/cibe/CibeSpecialMobileMapper.xml
  32. 0 127
      src/main/resources/mappings/modules/cibe/CibeUserMapper.xml
  33. 0 93
      src/main/resources/mappings/modules/cmme/dict/CmmeSysDictMapper.xml
  34. 0 124
      src/main/resources/mappings/modules/cmme/product/CmmeBigtypeMapper.xml
  35. 0 114
      src/main/resources/mappings/modules/cmme/product/CmmeMainproductMapper.xml
  36. 3 3
      src/main/resources/mappings/modules/order/CmDiscernReceiptMapper.xml
  37. 2 2
      src/main/resources/mappings/modules/order/CmRefundShopMapper.xml
  38. 0 115
      src/main/resources/mappings/modules/permission/ReceiptUserPermissionMapper.xml
  39. 0 207
      src/main/resources/mappings/modules/user/CmGclubMapper.xml.bak
  40. 110 117
      src/main/resources/mappings/modules/weisha/CmMallOrganizeMapper.xml
  41. 23 14
      src/main/resources/mappings/modules/weisha/CmMallUserMapper.xml
  42. 0 139
      src/main/resources/mappings/modules/weisha/CmOrganizeBuyerMapper.xml
  43. 247 361
      src/main/resources/mappings/modules/weisha/CmOrganizeProductMapper.xml
  44. 0 442
      src/main/resources/mappings/modules/weisha/CmOrganizePromotionMapper.xml
  45. 53 256
      src/main/resources/mappings/modules/weisha/CmOrganizeStoreMapper.xml

+ 3 - 3
src/main/java/com/caimei/modules/order/entity/CmDiscernReceipt.java

@@ -24,9 +24,9 @@ public class    CmDiscernReceipt extends DataEntity<CmDiscernReceipt> {
     private String receiptAmount;        // 收款金额(线上一次性付款和支付金额一致)
     private String receiptAmount;        // 收款金额(线上一次性付款和支付金额一致)
     private String handlingFee;        // 手续费(个别银行存在手续费)
     private String handlingFee;        // 手续费(个别银行存在手续费)
     private String confirmType;        // 确认订单类型:1小额抹平确认,2大额抹平确认,3大额退款余额,4确认关联
     private String confirmType;        // 确认订单类型:1小额抹平确认,2大额抹平确认,3大额退款余额,4确认关联
-    private Long confirmUserPermissionID;        // 确认人权限ID(对应receipt_user_permission表)
-    private Long reviewUserPermissionID;        // 审核人权限ID(对应receipt_user_permission表)
-    private Long cancelUserPermissionID;        // 撤销人权限ID(对应receipt_user_permission表)
+    private Long confirmUserPermissionID;        // 确认人权限ID(对应cm_receipt_user表)
+    private Long reviewUserPermissionID;        // 审核人权限ID(对应cm_receipt_user表)
+    private Long cancelUserPermissionID;        // 撤销人权限ID(对应cm_receipt_user表)
     private String transactionNum;        // 交易号--[线上字段]
     private String transactionNum;        // 交易号--[线上字段]
     private String bankID;        // 银行Id--[线上字段]
     private String bankID;        // 银行Id--[线上字段]
     private String bankCode;        // 银行卡号--[线上字段]
     private String bankCode;        // 银行卡号--[线上字段]

+ 2 - 2
src/main/java/com/caimei/modules/order/entity/ReceiptRecordVo.java

@@ -16,10 +16,10 @@ public class ReceiptRecordVo {
     private Double receiptAmount; //收款金额
     private Double receiptAmount; //收款金额
     private String payWay;        // 用户付款方式:1线上,2线下
     private String payWay;        // 用户付款方式:1线上,2线下
     private String transactionNum;        // 交易号--[线上字段]
     private String transactionNum;        // 交易号--[线上字段]
-    private Long confirmUserPermissionID;        // 确认人权限ID(对应receipt_user_permission表)
+    private Long confirmUserPermissionID;        // 确认人权限ID(对应cm_receipt_user表)
     private String confirmUserName;   //确认人名称
     private String confirmUserName;   //确认人名称
 
 
-    private Long reviewUserPermissionID;        // 审核人权限ID(对应receipt_user_permission表)
+    private Long reviewUserPermissionID;        // 审核人权限ID(对应cm_receipt_user表)
     private String reviewUserName;  //审核人名称
     private String reviewUserName;  //审核人名称
     private String confirmDate;        // 确认时间
     private String confirmDate;        // 确认时间
     private String reviewDate;        // 审核时间
     private String reviewDate;        // 审核时间

+ 0 - 16
src/main/java/com/caimei/modules/permission/dao/ReceiptUserPermissionDao.java

@@ -1,16 +0,0 @@
-package com.caimei.modules.permission.dao;
-
-import com.thinkgem.jeesite.common.persistence.CrudDao;
-import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
-import com.caimei.modules.permission.entity.ReceiptUserPermission;
-
-/**
- * 权限表DAO接口
- * @author lwt
- * @version 2019-06-18
- */
-@MyBatisDao
-public interface ReceiptUserPermissionDao extends CrudDao<ReceiptUserPermission> {
-
-    ReceiptUserPermission findDupBean(ReceiptUserPermission receiptUserPermission);
-}

+ 0 - 75
src/main/java/com/caimei/modules/permission/entity/ReceiptUserPermission.java

@@ -1,75 +0,0 @@
-package com.caimei.modules.permission.entity;
-
-import com.thinkgem.jeesite.common.persistence.DataEntity;
-import org.hibernate.validator.constraints.Length;
-
-/**
- * 权限表Entity
- *
- * @author lwt
- * @version 2019-06-18
- */
-public class ReceiptUserPermission extends DataEntity<ReceiptUserPermission> {
-
-    private static final long serialVersionUID = 1L;
-    private String userType;        // 用户类型:1收款通知权限(财务人员使用),2收款确认权限,3收款审核权限 4、返佣管理权限
-    private String name;        // 名称
-    private String mobile;        // 授权人手机号
-    private String openid;        // 微信openid
-    /**
-     * 用户身份
-     */
-    private String userIdentity;
-
-    public ReceiptUserPermission() {
-        super();
-    }
-
-    public ReceiptUserPermission(String id) {
-        super(id);
-    }
-
-    @Length(min = 0, max = 1, message = "用户类型:1收款通知权限(财务人员使用),2收款确认权限,3收款审核权限 4、返佣管理权限长度必须介于 0 和 1 之间")
-    public String getUserType() {
-        return userType;
-    }
-
-    public void setUserType(String userType) {
-        this.userType = userType;
-    }
-
-    @Length(min = 0, max = 50, message = "名称长度必须介于 0 和 50 之间")
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    @Length(min = 0, max = 11, message = "授权人手机号长度必须介于 0 和 11 之间")
-    public String getMobile() {
-        return mobile;
-    }
-
-    public void setMobile(String mobile) {
-        this.mobile = mobile;
-    }
-
-    @Length(min = 0, max = 255, message = "微信openid长度必须介于 0 和 255 之间")
-    public String getOpenid() {
-        return openid;
-    }
-
-    public void setOpenid(String openid) {
-        this.openid = openid;
-    }
-
-	public String getUserIdentity() {
-		return userIdentity;
-	}
-
-	public void setUserIdentity(String userIdentity) {
-		this.userIdentity = userIdentity;
-	}
-}

+ 0 - 52
src/main/java/com/caimei/modules/permission/service/ReceiptUserPermissionService.java

@@ -1,52 +0,0 @@
-package com.caimei.modules.permission.service;
-
-import java.util.List;
-
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import com.thinkgem.jeesite.common.persistence.Page;
-import com.thinkgem.jeesite.common.service.CrudService;
-import com.caimei.modules.permission.entity.ReceiptUserPermission;
-import com.caimei.modules.permission.dao.ReceiptUserPermissionDao;
-
-import javax.annotation.Resource;
-
-/**
- * 权限表Service
- * @author lwt
- * @version 2019-06-18
- */
-@Service
-@Transactional(readOnly = true)
-public class ReceiptUserPermissionService extends CrudService<ReceiptUserPermissionDao, ReceiptUserPermission> {
-
-	@Resource
-	private ReceiptUserPermissionDao receiptUserPermissionDao;
-
-	public ReceiptUserPermission get(String id) {
-		return super.get(id);
-	}
-	
-	public List<ReceiptUserPermission> findList(ReceiptUserPermission receiptUserPermission) {
-		return super.findList(receiptUserPermission);
-	}
-	
-	public Page<ReceiptUserPermission> findPage(Page<ReceiptUserPermission> page, ReceiptUserPermission receiptUserPermission) {
-		return super.findPage(page, receiptUserPermission);
-	}
-	
-	@Transactional(readOnly = false)
-	public void save(ReceiptUserPermission receiptUserPermission) {
-		super.save(receiptUserPermission);
-	}
-	
-	@Transactional(readOnly = false)
-	public void delete(ReceiptUserPermission receiptUserPermission) {
-		super.delete(receiptUserPermission);
-	}
-
-	public ReceiptUserPermission findDupBean(ReceiptUserPermission receiptUserPermission) {
-		return receiptUserPermissionDao.findDupBean(receiptUserPermission);
-	}
-}

+ 0 - 112
src/main/java/com/caimei/modules/permission/web/ReceiptUserPermissionController.java

@@ -1,112 +0,0 @@
-package com.caimei.modules.permission.web;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
-import org.springframework.web.bind.annotation.ModelAttribute;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.servlet.mvc.support.RedirectAttributes;
-
-import com.thinkgem.jeesite.common.config.Global;
-import com.thinkgem.jeesite.common.persistence.Page;
-import com.thinkgem.jeesite.common.web.BaseController;
-import com.thinkgem.jeesite.common.utils.StringUtils;
-import com.caimei.modules.permission.entity.ReceiptUserPermission;
-import com.caimei.modules.permission.service.ReceiptUserPermissionService;
-
-/**
- * 权限表Controller
- * @author lwt
- * @version 2019-06-18
- */
-@Controller
-@RequestMapping(value = "${adminPath}/permission/receiptUserPermission")
-public class ReceiptUserPermissionController extends BaseController {
-
-	@Autowired
-	private ReceiptUserPermissionService receiptUserPermissionService;
-	
-	@ModelAttribute
-	public ReceiptUserPermission get(@RequestParam(required=false) String id) {
-		ReceiptUserPermission entity = null;
-		if (StringUtils.isNotBlank(id)){
-			entity = receiptUserPermissionService.get(id);
-		}
-		if (entity == null){
-			entity = new ReceiptUserPermission();
-		}
-		return entity;
-	}
-	
-	@RequiresPermissions("permission:receiptUserPermission:view")
-	@RequestMapping(value = {"list", ""})
-	public String list(ReceiptUserPermission receiptUserPermission, HttpServletRequest request, HttpServletResponse response, Model model) {
-		if (StringUtils.isNotBlank(receiptUserPermission.getOpenid()))
-			receiptUserPermission.setOpenid(receiptUserPermission.getOpenid().trim());
-		Page<ReceiptUserPermission> page = receiptUserPermissionService.findPage(new Page<ReceiptUserPermission>(request, response), receiptUserPermission); 
-		model.addAttribute("page", page);
-		if ("1".equals(receiptUserPermission.getUserType()))
-			return "modules/permission/receiptNoticePermissionList";
-		if ("2".equals(receiptUserPermission.getUserType()))
-			return "modules/permission/receiptConfirmPermissionList";
-		if ("3".equals(receiptUserPermission.getUserType()))
-			return "modules/permission/receiptReviewPermissionList";
-		if ("4".equals(receiptUserPermission.getUserType()))
-			return "modules/permission/rebateManagePermissionList";
-		if ("5".equals(receiptUserPermission.getUserType())){
-			return "modules/permission/shopRefundPermissionList";
-		}
-		return "";
-	}
-
-	@RequiresPermissions("permission:receiptUserPermission:view")
-	@RequestMapping(value = "form")
-	public String form(ReceiptUserPermission receiptUserPermission, Model model) {
-		model.addAttribute("receiptUserPermission", receiptUserPermission);
-		if ("1".equals(receiptUserPermission.getUserType()))
-			return "modules/permission/receiptNoticePermissionForm";
-		if ("2".equals(receiptUserPermission.getUserType()))
-			return "modules/permission/receiptConfirmPermissionForm";
-		if ("3".equals(receiptUserPermission.getUserType()))
-			return "modules/permission/receiptReviewPermissionForm";
-		if ("4".equals(receiptUserPermission.getUserType()))
-			return "modules/permission/rebateManagePermissionForm";
-		if ("5".equals(receiptUserPermission.getUserType())){
-			return "modules/permission/shopRefundPermissionForm";
-		}
-		return "";
-	}
-
-	@RequiresPermissions("permission:receiptUserPermission:edit")
-	@RequestMapping(value = "save")
-	public String save(ReceiptUserPermission receiptUserPermission, Model model, RedirectAttributes redirectAttributes) {
-		receiptUserPermission.setOpenid(receiptUserPermission.getOpenid().trim());
-		if (!beanValidator(model, receiptUserPermission)){
-			return form(receiptUserPermission, model);
-		}
-		if (StringUtils.isEmpty(receiptUserPermission.getId())) {
-			ReceiptUserPermission b = receiptUserPermissionService.findDupBean(receiptUserPermission);
-			if (b != null) {
-				model.addAttribute("message", "数据验证失败:<br/>微信openID已存在<br/>");
-				return form(receiptUserPermission, model);
-			}
-		}
-		receiptUserPermissionService.save(receiptUserPermission);
-		addMessage(redirectAttributes, "保存权限表成功");
-		return "redirect:"+Global.getAdminPath()+"/permission/receiptUserPermission/?userType="+receiptUserPermission.getUserType()+"&repage";
-	}
-	
-	@RequiresPermissions("permission:receiptUserPermission:delete")
-	@RequestMapping(value = "delete")
-	public String delete(ReceiptUserPermission receiptUserPermission, RedirectAttributes redirectAttributes) {
-		receiptUserPermissionService.delete(receiptUserPermission);
-		addMessage(redirectAttributes, "删除权限表成功");
-		return "redirect:"+Global.getAdminPath()+"/permission/receiptUserPermission/?userType="+receiptUserPermission.getUserType()+"&repage";
-	}
-
-}

+ 0 - 36
src/main/java/com/caimei/modules/weisha/dao/CmOrganizeProductDao.java

@@ -108,36 +108,6 @@ public interface CmOrganizeProductDao extends CrudDao<CmOrganizeProduct> {
     CmOrganizeProduct findProductByProductId(String productId);
     CmOrganizeProduct findProductByProductId(String productId);
 
 
 
 
-    /**
-     * 更新商品上架状态
-     * @param id
-     * @param status
-     */
-    void updateStatus(@Param("id")Integer id, @Param("status")Integer status);
-
-    /**
-     * 获取商品阶梯价格列表
-     * @param productId
-     * @return
-     */
-    List<OrganizeProductLadderPrice> findLadderPrice(String productId);
-
-    /**
-     * 更新商品阶梯价格
-     * @param organizeProductLadderPrice
-     */
-    void updateLadderPrice(OrganizeProductLadderPrice organizeProductLadderPrice);
-    /**
-     * 插入商品阶梯价格
-     * @param organizeProductLadderPrice
-     */
-    void insertLadderPrice(OrganizeProductLadderPrice organizeProductLadderPrice);
-    /**
-     * 删除商品阶梯价格
-     * @param ladderId
-     */
-    void deleteLadderPriceById(String ladderId);
-
     /**
     /**
      * 查询对应采美商品的阶梯价格列表
      * 查询对应采美商品的阶梯价格列表
      * @param productId
      * @param productId
@@ -145,10 +115,4 @@ public interface CmOrganizeProductDao extends CrudDao<CmOrganizeProduct> {
      */
      */
     List<OrganizeProductLadderPrice> findFormerLadderPriceList(String productId);
     List<OrganizeProductLadderPrice> findFormerLadderPriceList(String productId);
 
 
-    /**
-     * 更新阶梯价格标识
-     * @param productId
-     * @param ladderPriceFlag
-     */
-    void updateLadderPriceFlag(@Param("productId") String productId,@Param("ladderPriceFlag") int ladderPriceFlag);
 }
 }

+ 1 - 2
src/main/java/com/caimei/modules/weisha/dao/CmOrganizeStoreDao.java

@@ -20,11 +20,10 @@ public interface CmOrganizeStoreDao extends CrudDao<CmOrganizeStore> {
     void cleanWx(@Param("userId") Integer userId);
     void cleanWx(@Param("userId") Integer userId);
 
 
     void clubStatus(@Param("id") Integer id,@Param("status") Integer status);
     void clubStatus(@Param("id") Integer id,@Param("status") Integer status);
+
     void userStatus(@Param("id") Integer id,@Param("status") Integer status);
     void userStatus(@Param("id") Integer id,@Param("status") Integer status);
 
 
     CmOrganizeStore getclubInfo(CmOrganizeStore cmOrganizeStore);
     CmOrganizeStore getclubInfo(CmOrganizeStore cmOrganizeStore);
 
 
-    List<CmOrganizeStore> findListByMobile(CmOrganizeStore cmOrganizeStore);
-
     String findOrganizeNameById(Integer organizeId);
     String findOrganizeNameById(Integer organizeId);
 }
 }

+ 1 - 38
src/main/java/com/caimei/modules/weisha/service/CmOrganizeProductService.java

@@ -31,42 +31,10 @@ import javax.annotation.Resource;
 @Service
 @Service
 @Transactional(readOnly = true)
 @Transactional(readOnly = true)
 public class CmOrganizeProductService extends CrudService<CmOrganizeProductDao, CmOrganizeProduct> {
 public class CmOrganizeProductService extends CrudService<CmOrganizeProductDao, CmOrganizeProduct> {
+
 	@Resource
 	@Resource
 	private CmOrganizeProductDao cmOrganizeProductDao;
 	private CmOrganizeProductDao cmOrganizeProductDao;
-	@Resource
-	private CmOrganizePromotionDao cmOrganizePromotionDao;
 
 
-	public CmOrganizeProduct get(String id) {
-		return super.get(id);
-	}
-
-	public List<CmOrganizeProduct> findList(CmOrganizeProduct cmOrganizeProduct) {
-		return super.findList(cmOrganizeProduct);
-	}
-
-	public Page<CmOrganizeProduct> findPage(Page<CmOrganizeProduct> page, CmOrganizeProduct cmOrganizeProduct) {
-		cmOrganizeProduct.setPage(page);
-		List<CmOrganizeProduct> productList = cmOrganizeProductDao.findList(cmOrganizeProduct);
-		DecimalFormat decimalFormat = new DecimalFormat("0000");
-		productList.forEach(product->{
-			product.setProductImage(AppUtils.getImageURL("product", product.getProductImage(), 0, ""));
-			//格式化组织商品Id
-			product.setId(decimalFormat.format(Integer.parseInt(product.getId())));
-			//比例成本价加上机构税费处理
-			//若为含税,则成本为:售价*比例
-			//若为不含税,则成本为:(售价+售价*机构税率)*比例
-			//若为未知,则成本为:售价*比例
-			if (2 == product.getCostType()) {
-				if (0 == product.getIncludedTax() && 3 != product.getInvoiceType()) {
-					product.setCostPrice((product.getPrice()+product.getPrice()*product.getClubTaxPoint()*0.01)*product.getCostProportional()*0.01);
-				} else {
-					product.setCostPrice(product.getPrice()*product.getCostProportional());
-				}
-			}
-		});
-		page.setList(productList);
-		return page;
-	}
 	public Page<CmOrganizeProduct> organizeProductList(Page<CmOrganizeProduct> page, CmOrganizeProduct cmOrganizeProduct) {
 	public Page<CmOrganizeProduct> organizeProductList(Page<CmOrganizeProduct> page, CmOrganizeProduct cmOrganizeProduct) {
 		cmOrganizeProduct.setPage(page);
 		cmOrganizeProduct.setPage(page);
 		// 商品信息
 		// 商品信息
@@ -235,11 +203,6 @@ public class CmOrganizeProductService extends CrudService<CmOrganizeProductDao,
 
 
 	}
 	}
 
 
-	@Transactional(readOnly = false)
-	public void updateStatus(Integer id, Integer status) {
-		cmOrganizeProductDao.updateStatus(id, status);
-	}
-
 	/**
 	/**
 	 * 组织商品编辑回显
 	 * 组织商品编辑回显
 	 * @param id
 	 * @param id

+ 4 - 27
src/main/java/com/caimei/modules/weisha/service/CmOrganizeStoreService.java

@@ -1,19 +1,17 @@
 package com.caimei.modules.weisha.service;
 package com.caimei.modules.weisha.service;
 
 
-import java.util.List;
 
 
 import com.caimei.utils.AppKeys;
 import com.caimei.utils.AppKeys;
 import com.caimei.utils.AppUtils;
 import com.caimei.utils.AppUtils;
 import com.thinkgem.jeesite.common.config.Global;
 import com.thinkgem.jeesite.common.config.Global;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
-
-import com.thinkgem.jeesite.common.persistence.Page;
 import com.thinkgem.jeesite.common.service.CrudService;
 import com.thinkgem.jeesite.common.service.CrudService;
 import com.caimei.modules.weisha.entity.CmOrganizeStore;
 import com.caimei.modules.weisha.entity.CmOrganizeStore;
 import com.caimei.modules.weisha.dao.CmOrganizeStoreDao;
 import com.caimei.modules.weisha.dao.CmOrganizeStoreDao;
 
 
+import javax.annotation.Resource;
+
 /**
 /**
  * 采美组织门店Service
  * 采美组织门店Service
  * @author Aslee
  * @author Aslee
@@ -23,29 +21,8 @@ import com.caimei.modules.weisha.dao.CmOrganizeStoreDao;
 @Transactional(readOnly = true)
 @Transactional(readOnly = true)
 public class CmOrganizeStoreService extends CrudService<CmOrganizeStoreDao, CmOrganizeStore> {
 public class CmOrganizeStoreService extends CrudService<CmOrganizeStoreDao, CmOrganizeStore> {
 
 
-	@Autowired private CmOrganizeStoreDao cmOrganizeStoreDao;
-
-	public CmOrganizeStore get(String id) {
-		return super.get(id);
-	}
-
-	public List<CmOrganizeStore> findList(CmOrganizeStore cmOrganizeStore) {
-		return super.findList(cmOrganizeStore);
-	}
-
-	public Page<CmOrganizeStore> findPage(Page<CmOrganizeStore> page, CmOrganizeStore cmOrganizeStore) {
-		return super.findPage(page, cmOrganizeStore);
-	}
-
-	@Transactional(readOnly = false)
-	public void save(CmOrganizeStore cmOrganizeStore) {
-		super.save(cmOrganizeStore);
-	}
-
-	@Transactional(readOnly = false)
-	public void delete(CmOrganizeStore cmOrganizeStore) {
-		super.delete(cmOrganizeStore);
-	}
+	@Resource
+	private CmOrganizeStoreDao cmOrganizeStoreDao;
 
 
 
 
 	public CmOrganizeStore gtClubInfo(CmOrganizeStore cmOrganizeStore) {
 	public CmOrganizeStore gtClubInfo(CmOrganizeStore cmOrganizeStore) {

+ 0 - 12
src/main/java/com/caimei/modules/weisha/web/CmOrganizeProductController.java

@@ -46,18 +46,6 @@ public class CmOrganizeProductController extends BaseController {
 	@Autowired
 	@Autowired
 	private CmMallOrganizeService cmMallOrganizeService;
 	private CmMallOrganizeService cmMallOrganizeService;
 
 
-	@ModelAttribute
-	public CmOrganizeProduct get(@RequestParam(required=false) String id) {
-		CmOrganizeProduct entity = null;
-		if (StringUtils.isNotBlank(id)){
-			entity = cmOrganizeProductService.get(id);
-		}
-		if (entity == null){
-			entity = new CmOrganizeProduct();
-		}
-		return entity;
-	}
-
 	@RequestMapping(value = {"list", ""})
 	@RequestMapping(value = {"list", ""})
 	public String list(CmOrganizeProduct cmOrganizeProduct, HttpServletRequest request, HttpServletResponse response, Model model) {
 	public String list(CmOrganizeProduct cmOrganizeProduct, HttpServletRequest request, HttpServletResponse response, Model model) {
 		Page<CmOrganizeProduct> page = cmOrganizeProductService.organizeProductList(new Page<CmOrganizeProduct>(request, response), cmOrganizeProduct);
 		Page<CmOrganizeProduct> page = cmOrganizeProductService.organizeProductList(new Page<CmOrganizeProduct>(request, response), cmOrganizeProduct);

+ 0 - 161
src/main/resources/mappings/modules/activity/FreeShippingMapper.xml

@@ -1,161 +0,0 @@
-<?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="com.caimei.modules.activity.dao.FreeShippingDao">
-    
-     <resultMap  id="CountResultMap" type="com.caimei.modules.activity.model.FreeShippingCount">
-		<result column="total" property="total" />
-		<result column="unused" property="unused"/>
-		<result column="used" property="used" />
-		<result column="unpay" property="unpay" />
- 	</resultMap>
-    
-	<select id="usedCount" resultMap="CountResultMap">
-		select count(1) total,
-		sum(case  a.`status` WHEN 0 then 1 ELSE 0 end) unused,
-		sum(case  a.`status` WHEN 1 then 1 ELSE 0 end) used,
-		sum(case  s.`status` WHEN 0 then 1 ELSE 0 end) unpay
-		from activity_free_shipping a
-		LEFT JOIN (select * FROM shoporder  WHERE STATUS &lt;&gt; '6') s ON s.freePostageTicketID = a.id
-		
-		<!-- select count(1) total,
-		sum(case WHEN a.`status`='0' then 1 ELSE 0 end) unused,
-		sum(case WHEN (a.`status`='1' AND s.`status` &lt;&gt; '6' ) then 1 ELSE 0 end) used,
-		sum(case WHEN s.`status`= '0' then 1 ELSE 0 end) unpay
-		from activity_free_shipping a
-		LEFT JOIN shoporder s ON (s.freePostageTicketID=a.id AND s.status &lt;&gt; '6') -->
-	</select>
-	
-	<sql id="freeShippingColumns">
-		a.id AS "id",
-		a.type_id AS "freeShippingtTpe.id",
-		a.user_id AS "userId",
-		a.club_id AS "clubId",
-		a.status AS "status",
-		a.spId,
-		a.enabled_status AS "enabledStatus",
-		a.create_date AS "createDate",
-		b.start_time AS "freeShippingtTpe.startTime",
-		b.end_time AS "freeShippingtTpe.endTime",
-		c.name AS "clubName",
-		c.contractMobile AS "clubMobile",
-		u.userName AS "userName",
-		u.userLevelID AS "userLevelType",
-		s.shopOrderID AS "shopOrederNo",
-		s.status AS "shopOrderStatus",
-		sp.`name` AS "spName",
-		sp.serviceLevelID AS "spLevelId",
-		sp.contractMobile AS "spMobile"
-
-	</sql>
-	
-	<sql id="freeShippingJoins">
-		LEFT JOIN activity_free_shipping_type b ON b.id=a.type_id
-		LEFT JOIN club c ON c.clubID=a.club_id
-		LEFT JOIN user u ON u.userID = a.user_id
-		LEFT JOIN (select * FROM shoporder  WHERE STATUS &lt;&gt; '6') s ON s.freePostageTicketID = a.id
-		LEFT JOIN serviceprovider sp ON sp.serviceProviderID=a.spId
-	</sql>
-    
-	<select id="get" resultType="FreeShipping">
-		SELECT 
-			<include refid="freeShippingColumns"/>
-		FROM activity_free_shipping a
-		<include refid="freeShippingJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="FreeShipping">
-		SELECT 
-			<include refid="freeShippingColumns"/>
-		FROM activity_free_shipping a
-		<include refid="freeShippingJoins"/>
-		<where>
-			<if test="userName != null and userName != ''">
-				AND u.userName LIKE concat('%',#{userName},'%')
-			</if>
-			<if test="clubId != null and clubId != ''">
-				AND c.clubID =#{clubId}
-			</if>
-			<if test="clubName != null and clubName != ''">
-				AND c.name LIKE concat('%',#{clubName},'%')
-			</if>
-			<if test="clubMobile != null and clubMobile != ''">
-				AND c.contractMobile LIKE concat('%',#{clubMobile},'%')
-			</if>
-			<if test="status != null and status != ''">
-				AND a.status = #{status}
-			</if>
-			<if test="enabledStatus != null and enabledStatus != ''">
-				AND a.enabled_status = #{enabledStatus}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.status ASC,
-				a.create_date DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="FreeShipping">
-		SELECT 
-			<include refid="freeShippingColumns"/>
-		FROM activity_free_shipping a
-		<include refid="freeShippingJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="FreeShipping"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO activity_free_shipping(
-			type_id,
-			user_id,
-			club_id,
-			status,
-			enabled_status,
-			create_date
-		) VALUES (
-			#{freeShippingtTpe.id},
-			#{userId},
-			#{clubId},
-			#{status},
-			#{enabledStatus},
-			#{createDate}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE activity_free_shipping SET 	
-			type_id = #{freeShippingtTpe.id},
-			user_id = #{userId},
-			club_id = #{clubId},
-			status = #{status},
-			enabled_status = #{enabledStatus}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM activity_free_shipping
-		WHERE id = #{id}
-	</delete>
-	
-		<update id="updateEnabledStatusByIds">
-		UPDATE activity_free_shipping a SET a.enabled_status = #{param1} 
-		WHERE  a.id IN
-	 	<foreach collection="param2" item="id" index="index" open="(" separator="," close=")" >
-	       #{id}
-	 	</foreach>
-	</update>
-	
-</mapper>

+ 0 - 116
src/main/resources/mappings/modules/activity/FreeShippingTypeMapper.xml

@@ -1,116 +0,0 @@
-<?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="com.caimei.modules.activity.dao.FreeShippingTypeDao">
-    
-	<sql id="freeShippingTypeColumns">
-		a.id AS "id",
-		a.scope AS "scope",
-		a.number AS "number",
-		a.start_time AS "startTime",
-		a.end_time AS "endTime",
-		a.info AS "info",
-		a.images AS "images",
-		a.crm_images AS "crmImages",
-		a.status AS "status",
-		a.enabled_status AS "enabledStatus",
-		a.update_by AS "updateBy.id",
-		a.update_date AS "updateDate"
-	</sql>
-	
-	<sql id="freeShippingTypeJoins">
-	</sql>
-    
-	<select id="get" resultType="FreeShippingType">
-		SELECT 
-			<include refid="freeShippingTypeColumns"/>
-		FROM activity_free_shipping_type a
-		<include refid="freeShippingTypeJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="FreeShippingType">
-		SELECT 
-			<include refid="freeShippingTypeColumns"/>
-		FROM activity_free_shipping_type a
-		<include refid="freeShippingTypeJoins"/>
-		<where>
-			
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.update_date DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="FreeShippingType">
-		SELECT 
-			<include refid="freeShippingTypeColumns"/>
-		FROM activity_free_shipping_type a
-		<include refid="freeShippingTypeJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.update_date DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="FreeShippingType"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO activity_free_shipping_type(
-			scope,
-			number,
-			start_time,
-			end_time,
-			info,
-			images,
-			crm_images,
-			status,
-			enabled_status,
-			update_by,
-			update_date
-		) VALUES (
-			#{scope},
-			#{number},
-			#{startTime},
-			#{endTime},
-			#{info},
-			#{images},
-			#{crmImages},
-			#{status},
-			#{enabledStatus},
-			#{updateBy.id},
-			#{updateDate}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE activity_free_shipping_type SET 	
-			scope = #{scope},
-			number = #{number},
-			start_time = #{startTime},
-			end_time = #{endTime},
-			info = #{info},
-			images = #{images},
-			crm_images = #{crmImages},
-			status = #{status},
-			enabled_status = #{enabledStatus},
-			update_by = #{updateBy.id},
-			update_date = #{updateDate}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM activity_free_shipping_type
-		WHERE id = #{id}
-	</delete>
-	
-</mapper>

+ 0 - 111
src/main/resources/mappings/modules/activity/LaserMapper.xml

@@ -1,111 +0,0 @@
-<?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="com.caimei.modules.activity.dao.LaserDao">
-    
-	<sql id="laserColumns">
-		a.id AS "id",
-		a.title AS "title",
-		a.image AS "image",
-		a.sortIndex AS "sortIndex",
-		a.enabledStatus AS "enabledStatus",
-		a.createDate AS "createDate"
-	</sql>
-	
-	<sql id="laserJoins">
-	</sql>
-    
-	<select id="get" resultType="Laser">
-		SELECT 
-			<include refid="laserColumns"/>
-		FROM activity_laser a
-		<include refid="laserJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="Laser">
-		SELECT 
-			<include refid="laserColumns"/>
-		FROM activity_laser a
-		<include refid="laserJoins"/>
-		<where>
-			
-			<if test="title != null and title != ''">
-				AND a.title LIKE 
-					<if test="dbName == 'oracle'">'%'||#{title}||'%'</if>
-					<if test="dbName == 'mssql'">'%'+#{title}+'%'</if>
-					<if test="dbName == 'mysql'">concat('%',#{title},'%')</if>
-			</if>
-			<if test="enabledStatus != null and enabledStatus != ''">
-				AND a.enabledStatus = #{enabledStatus}
-			</if>
-		</where>
-		<choose>
-			<when test="sqlMap.orderBy !=null and sqlMap.orderBy !=''">
-				${sqlMap.orderBy}
-			</when>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.enabledStatus DESC,a.createDate DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="Laser">
-		SELECT 
-			<include refid="laserColumns"/>
-		FROM activity_laser a
-		<include refid="laserJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="Laser"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO activity_laser(
-			title,
-			image,
-			sortIndex,
-			enabledStatus,
-			createDate
-		) VALUES (
-			#{title},
-			#{image},
-			#{sortIndex},
-			#{enabledStatus},
-			#{createDate}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE activity_laser SET 	
-			title = #{title},
-			image = #{image},
-			sortIndex = #{sortIndex},
-			enabledStatus = #{enabledStatus},
-			createDate = #{createDate}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM activity_laser
-		WHERE id = #{id}
-	</delete>
-	
-	<update id="updateEnabledStatusByIds">
-		UPDATE activity_laser a SET a.enabledStatus = #{param1} 
-		WHERE  a.id IN
-	 	<foreach collection="param2" item="id" index="index" open="(" separator="," close=")" >
-	       #{id}
-	 	</foreach>
-	</update>
-	
-</mapper>

+ 0 - 102
src/main/resources/mappings/modules/advisory/CmAdvisoryMapper.xml

@@ -1,102 +0,0 @@
-<?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="com.caimei.modules.advisory.dao.CmAdvisoryDao">
-    
-	<sql id="cmAdvisoryColumns">
-		a.id AS "id",
-		a.name AS "name",
-		a.mobile AS "mobile",
-		a.commitTime AS "commitTime",
-		a.delFlag AS "delFlag"
-	</sql>
-	
-	<sql id="cmAdvisoryJoins">
-	</sql>
-    
-	<select id="get" resultType="CmAdvisory">
-		SELECT 
-			<include refid="cmAdvisoryColumns"/>
-		FROM cm_advisory a
-		<include refid="cmAdvisoryJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="CmAdvisory">
-		SELECT 
-			<include refid="cmAdvisoryColumns"/>
-		FROM cm_advisory a
-		<include refid="cmAdvisoryJoins"/>
-		<where>
-			
-			<if test="name != null and name != ''">
-				AND a.name LIKE 
-					<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
-					<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
-					<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
-			</if>
-			<if test="mobile != null and mobile != ''">
-				AND a.mobile = #{mobile}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.commitTime DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="CmAdvisory">
-		SELECT 
-			<include refid="cmAdvisoryColumns"/>
-		FROM cm_advisory a
-		<include refid="cmAdvisoryJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="CmAdvisory"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cm_advisory(
-			id,
-			name,
-			mobile,
-			commitTime,
-			delFlag
-		) VALUES (
-			#{id},
-			#{name},
-			#{mobile},
-			#{commitTime},
-			#{delFlag}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE cm_advisory SET 	
-			name = #{name},
-			mobile = #{mobile},
-			commitTime = #{commitTime},
-			delFlag = #{delFlag}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM cm_advisory
-		WHERE id = #{id}
-	</delete>
-
-	<select id="findUser" resultType="com.caimei.modules.user.entity.CmUser">
-		SELECT * FROM USER WHERE bindMobile = #{mobile}  AND validFlag='1'
-	</select>
-	
-</mapper>

+ 0 - 129
src/main/resources/mappings/modules/banner/CrmBannerMapper.xml

@@ -1,129 +0,0 @@
-<?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="com.caimei.modules.banner.dao.CrmBannerDao">
-    
-	<sql id="crmBannerColumns">
-		a.id AS "id",
-		a.title AS "title",
-		a.link AS "link",
-		a.appLink AS "appLink",
-		a.image AS "image",
-		a.sort AS "sort",
-		a.enabledStatus AS "enabledStatus",
-		a.createBy AS "createBy.id",
-		a.createDate AS "createDate",
-		a.updateBy AS "updateBy.id",
-		a.updateDate AS "updateDate"
-	</sql>
-	
-	<sql id="crmBannerJoins">
-	</sql>
-    
-	<select id="get" resultType="CrmBanner">
-		SELECT 
-			<include refid="crmBannerColumns"/>
-		FROM crm_banner a
-		<include refid="crmBannerJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="CrmBanner">
-		SELECT 
-			<include refid="crmBannerColumns"/>
-		FROM crm_banner a
-		<include refid="crmBannerJoins"/>
-		<where>
-			
-			<if test="id != null and id != ''">
-				AND a.id = #{id}
-			</if>
-			<if test="title != null and title != ''">
-				AND a.title LIKE CONCAT('%',#{title},'%')
-			</if>
-			<if test="enabledStatus != null and enabledStatus != ''">
-				AND a.enabledStatus = #{enabledStatus}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.enabledStatus DESC,a.createDate DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="CrmBanner">
-		SELECT 
-			<include refid="crmBannerColumns"/>
-		FROM crm_banner a
-		<include refid="crmBannerJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="CrmBanner"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO crm_banner(
-			title,
-			link,
-			appLink,
-			image,
-			sort,
-			enabledStatus,
-			createBy,
-			createDate,
-			updateBy,
-			updateDate
-		) VALUES (
-			#{title},
-			#{link},
-			#{appLink},
-			#{image},
-			#{sort},
-			#{enabledStatus},
-			#{createBy.id},
-			#{createDate},
-			#{updateBy.id},
-			#{updateDate}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE crm_banner SET 	
-			title = #{title},
-			link = #{link},
-			appLink = #{appLink},
-			image = #{image},
-			sort = #{sort},
-			enabledStatus = #{enabledStatus},
-			updateBy = #{updateBy.id},
-			updateDate = #{updateDate}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM crm_banner
-		WHERE id = #{id}
-	</delete>
-	
-	<update id="updateEnabledStatusByIds">
-		UPDATE crm_banner a SET a.enabledStatus = #{param1} 
-		WHERE  a.id IN
-	 	<foreach collection="param2" item="id" index="index" open="(" separator="," close=")" >
-	       #{id}
-	 	</foreach>
-	</update>
-	
-	<select id="countEnabledStatus" resultType="java.lang.Integer">
-		SELECT count(1) FROM  crm_banner a WHERE a.enabledStatus = #{param1}
-	</select>
-</mapper>

+ 0 - 165
src/main/resources/mappings/modules/brand/BrandAgentMapper.xml

@@ -1,165 +0,0 @@
-<?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="com.caimei.modules.brand.dao.BrandAgentDao">
-
-	<sql id="brandAgentColumns">
-		a.id AS "id",
-		a.name AS "name",
-		a.business_license AS "businessLicense",
-		a.business_address AS "businessAddress",
-		a.business_phone AS "businessPhone",
-		a.legal_representaive AS "legalRepresentaive",
-		a.registered_capital AS "registeredCapital",
-		a.enterprise_type AS "enterpriseType",
-		a.business_scope AS "businessScope",
-		a.enabled_status AS "enabledStatus",
-		a.create_by AS "createBy.id",
-		a.create_date AS "createDate",
-		a.update_by AS "updateBy.id",
-		a.update_date AS "updateDate"
-	</sql>
-
-	<sql id="brandAgentColumnsWithProductCount">
-		a.id AS "id",
-		a.name AS "name",
-		a.business_license AS "businessLicense",
-		a.business_address AS "businessAddress",
-		a.business_phone AS "businessPhone",
-		a.legal_representaive AS "legalRepresentaive",
-		a.registered_capital AS "registeredCapital",
-		a.enterprise_type AS "enterpriseType",
-		a.business_scope AS "businessScope",
-		a.enabled_status AS "enabledStatus",
-		a.create_by AS "createBy.id",
-		a.create_date AS "createDate",
-		a.update_by AS "updateBy.id",
-		a.update_date AS "updateDate",
-		COUNT(b.id) AS "productTotalCount",
-		COUNT(DISTINCT c.productID) AS "productTypeCount"
-	</sql>
-
-	<sql id="brandAgentJoins">
-	</sql>
-
-	<sql id="brandAgentJoinsWithProductCount">
-		LEFT JOIN brand_product b ON a.id = b.agent_id
-		LEFT JOIN product c ON b.productID = c.productID
-	</sql>
-
-	<select id="get" resultType="BrandAgent">
-		SELECT
-			<include refid="brandAgentColumns"/>
-		FROM brand_agent a
-		<include refid="brandAgentJoins"/>
-		WHERE a.id = #{id}
-	</select>
-
-	<select id="findList" resultType="BrandAgent">
-		SELECT
-			<include refid="brandAgentColumnsWithProductCount"/>
-		FROM brand_agent a
-		<include refid="brandAgentJoinsWithProductCount"/>
-		<where>
-			<if test="id != null and id != ''">
-				AND a.id = #{id}
-			</if>
-			<if test="name != null and name != ''">
-				AND a.name LIKE
-					<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
-					<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
-					<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
-			</if>
-			<if test="enabledStatus != null and enabledStatus != ''">
-				AND a.enabled_status = #{enabledStatus}
-			</if>
-			and c.productCategory = 1
-		</where>
-		GROUP BY a.id
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.enabled_status DESC,a.update_date DESC
-			</otherwise>
-		</choose>
-	</select>
-
-	<select id="findAllList" resultType="BrandAgent">
-		SELECT
-			<include refid="brandAgentColumns"/>
-		FROM brand_agent a
-		<include refid="brandAgentJoins"/>
-		<where>
-
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.update_date DESC
-			</otherwise>
-		</choose>
-	</select>
-
-	<insert id="insert" parameterType="BrandAgent"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO brand_agent(
-			name,
-			business_license,
-			business_address,
-			business_phone,
-			legal_representaive,
-			registered_capital,
-			enterprise_type,
-			business_scope,
-			enabled_status,
-			create_by,
-			create_date,
-			update_by,
-			update_date
-		) VALUES (
-			#{name},
-			#{businessLicense},
-			#{businessAddress},
-			#{businessPhone},
-			#{legalRepresentaive},
-			#{registeredCapital},
-			#{enterpriseType},
-			#{businessScope},
-			#{enabledStatus},
-			#{createBy.id},
-			#{createDate},
-			#{updateBy.id},
-			#{updateDate}
-		)
-	</insert>
-
-	<update id="update">
-		UPDATE brand_agent SET
-			name = #{name},
-			business_license = #{businessLicense},
-			business_address = #{businessAddress},
-			business_phone = #{businessPhone},
-			legal_representaive = #{legalRepresentaive},
-			registered_capital = #{registeredCapital},
-			enterprise_type = #{enterpriseType},
-			business_scope = #{businessScope},
-			enabled_status = #{enabledStatus},
-			update_by = #{updateBy.id},
-			update_date = #{updateDate}
-		WHERE id = #{id}
-	</update>
-
-	<delete id="delete">
-		DELETE FROM brand_agent
-		WHERE id = #{id}
-	</delete>
-
-	<update id="changeStatus" parameterType="Map">
-		UPDATE brand_agent SET
-			enabled_status = #{enabledStatus}
-		WHERE id = #{id}
-	</update>
-
-</mapper>

+ 0 - 120
src/main/resources/mappings/modules/brand/BrandIdentificationCodeMapper.xml

@@ -1,120 +0,0 @@
-<?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="com.caimei.modules.brand.dao.BrandIdentificationCodeDao">
-    
-	<sql id="brandIdentificationCodeColumns">
-		a.id AS "id",
-		a.identificationcode AS "identificationCode",
-		a.brandproductid AS "brandProductID",
-		a.createtime AS "createTime"
-	</sql>
-	
-	<sql id="brandIdentificationCodeJoins">
-	</sql>
-    
-	<select id="get" resultType="BrandIdentificationCode">
-		SELECT 
-			<include refid="brandIdentificationCodeColumns"/>
-		FROM brand_identification_code a
-		<include refid="brandIdentificationCodeJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="BrandIdentificationCode">
-		SELECT 
-			<include refid="brandIdentificationCodeColumns"/>
-		FROM brand_identification_code a
-		<include refid="brandIdentificationCodeJoins"/>
-		<where>
-			
-			<if test="identificationCode != null and identificationCode != ''">
-				AND a.identificationcode LIKE 
-					<if test="dbName == 'oracle'">'%'||#{identificationCode}||'%'</if>
-					<if test="dbName == 'mssql'">'%'+#{identificationCode}+'%'</if>
-					<if test="dbName == 'mysql'">concat('%',#{identificationCode},'%')</if>
-			</if>
-			<if test="status != null and status != ''">
-				<if test="status == -1">
-					AND a.brandProductID IS NOT NULL
-				</if>
-				<if test="status == 1">
-					AND a.brandProductID IS NULL
-				</if>
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="BrandIdentificationCode">
-		SELECT 
-			<include refid="brandIdentificationCodeColumns"/>
-		FROM brand_identification_code a
-		<include refid="brandIdentificationCodeJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="BrandIdentificationCode"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO brand_identification_code(
-			identificationcode,
-			brandproductid,
-			createtime
-		) VALUES (
-			#{identificationCode},
-			#{brandProductID},
-			#{createTime}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE brand_identification_code SET 	
-				identificationcode = #{identificationCode},
-				brandProductID = #{brandProductID},
-				createTime = #{createTime}
-		WHERE id = #{id}
-	</update>
-	
-	<update id="useCode">
-		UPDATE brand_identification_code SET 	
-				brandProductID = #{brandProductID}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM brand_identification_code
-		WHERE id = #{id}
-	</delete>
-	
-	<select id="getUnusedNum" resultType="Long">
-		SELECT COUNT(id) as unUsedNum
-		FROM brand_identification_code
-		WHERE brandProductID IS NULL
-	</select>
-	
-	<select id="getIdentificationCode" resultType="BrandIdentificationCode">
-		SELECT * FROM brand_identification_code
-		WHERE brandProductID IS NULL
-		ORDER BY id ASC
-		LIMIT 1
-	</select>
-	
-	<select id="getByCode" resultType="BrandIdentificationCode">
-		SELECT * FROM brand_identification_code
-		WHERE identificationCode = #{code}
-	</select>
-	
-</mapper>

+ 0 - 239
src/main/resources/mappings/modules/brand/BrandProductMapper.xml

@@ -1,239 +0,0 @@
-<?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="com.caimei.modules.brand.dao.BrandProductDao">
-    
-	<sql id="brandProductColumns">
-		a.id AS "id",
-		a.productID AS "productID",
-		a.supplier_id AS "brandSupplier.id",
-		a.agent_id AS "brandAgent.id",
-		a.purchaser_id AS "brandPurchaser.id",
-		a.file_number AS "fileNumber",
-		a.license_start_date AS "licenseStartDate",
-		a.license_end_date AS "licenseEndDate",
-		a.name AS "name",
-		a.license_name AS "licenseName",
-		a.sn AS "sn",
-		a.factory_date AS "factoryDate",
-		a.service_life AS "serviceLife",
-		a.purpose AS "purpose",
-		a.images AS "images",
-		a.large_Images AS "largeImages",
-		a.parameter AS "parameter",
-		a.parameter_images AS "parameterImages",
-		a.parameter_Large_Images AS "parameterLargeImages",
-		a.show_Agent AS "showAgent",
-		a.show_Purchaser AS "showPurchaser",
-		a.enabled_status AS "enabledStatus",
-		a.scan_num AS "scanNum",
-		a.query_num AS "queryNum",
-		a.create_by AS "createBy.id",
-		a.create_date AS "createDate",
-		a.update_by AS "updateBy.id",
-		a.update_date AS "updateDate",
-		a.identification_code AS "identificationCode"
-	</sql>
-	
-	<sql id="brandProductJoins">
-	</sql>
-    
-	<select id="get" resultType="BrandProduct">
-		SELECT 
-			<include refid="brandProductColumns"/>
-		FROM brand_product a
-		<include refid="brandProductJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="BrandProduct">
-		SELECT 
-			<include refid="brandProductColumns"/>
-		FROM brand_product a
-		<include refid="brandProductJoins"/>
-		<where>
-			<if test="productID != null and productID != ''">
-				AND a.productID = #{productID}
-			</if>
-			<if test="name != null and name != ''">
-				AND a.name LIKE CONCAT('%',#{name},'%')
-			</if>
-			<if test="sn != null and sn != ''">
-				AND a.sn = #{sn}
-			</if>
-			<if test="enabledStatus != null and enabledStatus != ''">
-				AND a.enabled_status = #{enabledStatus}
-			</if>
-			<if test="brandAgent != null and brandAgent.id != null and brandAgent.id != ''">
-				AND a.agent_id = #{brandAgent.id}
-			</if>
-			<if test="brandSupplier !=null and brandSupplier.id != null and brandSupplier.id != ''">
-				AND a.supplier_id = #{brandSupplier.id}
-			</if>
-			<if test="brandPurchaser != null and brandPurchaser.id != null and brandPurchaser.id != ''">
-				AND a.purchaser_id = #{brandPurchaser.id}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.enabled_status DESC,a.update_date DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="BrandProduct">
-		SELECT 
-			<include refid="brandProductColumns"/>
-		FROM brand_product a
-		<include refid="brandProductJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.update_date DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="BrandProduct"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO brand_product(
-			productID,
-			supplier_id,
-			agent_id,
-			purchaser_id,
-			file_number,
-			license_start_date,
-			license_end_date,
-			name,
-			license_name,
-			sn,
-			factory_date,
-			service_life,
-			purpose,
-			images,
-			large_Images,
-			parameter,
-			parameter_images,
-			parameter_Large_Images,
-			show_Agent,
-			show_Purchaser,
-			enabled_status,
-			scan_num,
-			query_num,
-			create_by,
-			create_date,
-			update_by,
-			update_date,
-			identification_code
-		) VALUES (
-			#{productID},
-			#{brandSupplier.id},
-			#{brandAgent.id},
-			#{brandPurchaser.id},
-			#{fileNumber},
-			#{licenseStartDate},
-			#{licenseEndDate},
-			#{name},
-			#{licenseName},
-			#{sn},
-			#{factoryDate},
-			#{serviceLife},
-			#{purpose},
-			#{images},
-			#{largeImages},
-			#{parameter},
-			#{parameterImages},
-			#{parameterLargeImages},
-			#{showAgent},
-			#{showPurchaser},
-			#{enabledStatus},
-			#{scanNum},
-			#{queryNum},
-			#{createBy.id},
-			#{createDate},
-			#{updateBy.id},
-			#{updateDate},
-			#{identificationCode}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE brand_product SET 	
-			productid = #{productID},
-			supplier_id = #{brandSupplier.id},
-			agent_id = #{brandAgent.id},
-			purchaser_id = #{brandPurchaser.id},
-			file_number = #{fileNumber},
-			license_start_date = #{licenseStartDate},
-			license_end_date = #{licenseEndDate},
-			name = #{name},
-			license_name = #{licenseName},
-			sn = #{sn},
-			factory_date = #{factoryDate},
-			service_life = #{serviceLife},
-			purpose = #{purpose},
-			images = #{images},
-			large_Images = #{largeImages},
-			parameter = #{parameter},
-			parameter_images = #{parameterImages},
-			parameter_Large_Images = #{parameterLargeImages},
-			show_Agent = #{showAgent},
-			show_Purchaser = #{showPurchaser},
-			enabled_status = #{enabledStatus},
-			scan_num = #{scanNum},
-			query_num = #{queryNum},
-			update_by = #{updateBy.id},
-			update_date = #{updateDate},
-			identification_code = #{identificationCode}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM brand_product
-		WHERE id = #{id}
-	</delete>
-	
-	<update id="changeStatus" parameterType="Map">
-		UPDATE brand_product SET enabled_status = #{enabledStatus} 
-		WHERE 
-		<if test="supplierID != null and supplierID != ''">
-			supplier_id = #{supplierID}
-		</if>
-		<if test="id != null and id != ''">
-			id = #{id}
-		</if>
-	</update>
-	
-	<update id="updateEnabledStatusByIds" parameterType="Map">
-		UPDATE brand_product a SET a.enabled_status = #{param1} 
-		WHERE  a.id IN
-	 	<foreach collection="param2" item="id" index="index" open="(" separator="," close=")" >
-	       #{id}
-	 	</foreach>
-	</update>
-	
-	<select id="getProductCount" resultType="BrandProduct">
-		SELECT 
-			<include refid="brandProductColumns"/>
-		FROM brand_product a
-		<include refid="brandProductJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.update_date DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-</mapper>

+ 0 - 169
src/main/resources/mappings/modules/brand/BrandProductsMapper.xml

@@ -1,169 +0,0 @@
-<?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="com.caimei.modules.brand.dao.BrandProductsDao">
-    
-	<sql id="brandProductsColumns">
-		a.id AS "id",
-		a.name AS "name",
-		a.sn AS "sn",
-		a.images AS "images",
-		a.largeImages AS "largeImages",
-		a.parameter AS "parameter",
-		a.parameterImages AS "parameterImages",
-		a.parameterLargeImages AS "parameterLargeImages",
-		a.purchase AS "purchase",
-		a.scanNum AS "scanNum",
-		a.queryNum AS "queryNum",
-		a.identificationCode AS "identificationCode",
-		a.enabledStatus AS "enabledStatus",
-		a.createBy AS "createBy.id",
-		a.createDate AS "createDate",
-		a.updateBy AS "updateBy.id",
-		a.updateDate AS "updateDate"
-	</sql>
-	
-	<sql id="brandProductsJoins">
-	</sql>
-    
-	<select id="get" resultType="BrandProducts">
-		SELECT 
-			<include refid="brandProductsColumns"/>
-		FROM brand_products a
-		<include refid="brandProductsJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="BrandProducts">
-		SELECT 
-			<include refid="brandProductsColumns"/>
-		FROM brand_products a
-		<include refid="brandProductsJoins"/>
-		<where>
-			
-			<if test="id != null and id != ''">
-				AND a.id = #{id}
-			</if>
-			<if test="name != null and name != ''">
-				AND a.name LIKE 
-					<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
-					<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
-					<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
-			</if>
-			<if test="sn != null and sn != ''">
-				AND a.sn = #{sn}
-			</if>
-			<if test="enabledStatus != null and enabledStatus != ''">
-				AND a.enabledStatus = #{enabledStatus}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.enabledStatus DESC,a.createDate DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="BrandProducts">
-		SELECT 
-			<include refid="brandProductsColumns"/>
-		FROM brand_products a
-		<include refid="brandProductsJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="BrandProducts"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO brand_products(
-			name,
-			sn,
-			images,
-			largeImages,
-			parameter,
-			parameterImages,
-			parameterLargeImages,
-			purchase,
-			identificationCode,
-			enabledStatus,
-			createBy,
-			createDate,
-			updateBy,
-			updateDate
-		) VALUES (
-			#{name},
-			#{sn},
-			#{images},
-			#{largeImages},
-			#{parameter},
-			#{parameterImages},
-			#{parameterLargeImages},
-			#{purchase},
-			#{identificationCode},
-			#{enabledStatus},
-			#{createBy.id},
-			#{createDate},
-			#{updateBy.id},
-			#{updateDate}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE brand_products SET 	
-			name = #{name},
-			sn = #{sn},
-			images = #{images},
-			largeImages = #{largeImages},
-			parameter = #{parameter},
-			parameterImages = #{parameterImages},
-			parameterLargeImages = #{parameterLargeImages},
-			purchase = #{purchase},
-			scanNum = #{scanNum},
-			queryNum = #{queryNum},
-			identificationCode = #{identificationCode},
-			enabledStatus = #{enabledStatus},
-			createBy = #{createBy.id},
-			createDate = #{createDate},
-			updateBy = #{updateBy.id},
-			updateDate = #{updateDate}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM brand_products
-		WHERE id = #{id}
-	</delete>
-	
-	<update id="updateEnabledStatusByIds" parameterType="Map">
-		UPDATE brand_products a SET a.enabledStatus = #{param1} 
-		WHERE  a.id IN
-	 	<foreach collection="param2" item="id" index="index" open="(" separator="," close=")" >
-	       #{id}
-	 	</foreach>
-	</update>
-	
-	<select id="findBySn" resultType="BrandProducts">
-		SELECT 
-			<include refid="brandProductsColumns"/>
-		FROM brand_products a
-		<include refid="brandProductsJoins"/>
-		WHERE a.sn = #{param1}
-	</select>
-	<select id="findByIdentificationCode" resultType="BrandProducts">
-		SELECT 
-			<include refid="brandProductsColumns"/>
-		FROM brand_products a
-		<include refid="brandProductsJoins"/>
-		WHERE a.identificationCode = #{param1}
-	</select>
-	
-</mapper>

+ 0 - 148
src/main/resources/mappings/modules/brand/BrandPurchaserMapper.xml

@@ -1,148 +0,0 @@
-<?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="com.caimei.modules.brand.dao.BrandPurchaserDao">
-
-	<sql id="brandPurchaserColumns">
-		a.id AS "id",
-		a.name AS "name",
-		a.purchase_date AS "purchaseDate",
-		a.intro AS "intro",
-		a.publicty_material_images AS "publictyMaterialImages",
-		a.large_Images AS "largeImages",
-		a.enabled_status AS "enabledStatus",
-		a.create_by AS "createBy.id",
-		a.create_date AS "createDate",
-		a.update_by AS "updateBy.id",
-		a.update_date AS "updateDate"
-	</sql>
-
-	<sql id="brandPurchaserColumnsWithProductCount">
-		a.id AS "id",
-		a.name AS "name",
-		a.purchase_date AS "purchaseDate",
-		a.intro AS "intro",
-		a.publicty_material_images AS "publictyMaterialImages",
-		a.large_Images AS "largeImages",
-		a.enabled_status AS "enabledStatus",
-		a.create_by AS "createBy.id",
-		a.create_date AS "createDate",
-		a.update_by AS "updateBy.id",
-		a.update_date AS "updateDate",
-		COUNT(b.id) AS "productTotalCount",
-		COUNT(DISTINCT c.productID) AS "productTypeCount"
-	</sql>
-
-	<sql id="brandPurchaserJoins">
-	</sql>
-
-	<sql id="brandPurchaserJoinsWithProductCount">
-		LEFT JOIN brand_product b ON a.id = b.purchaser_id
-		LEFT JOIN product c ON b.productID = c.productID
-	</sql>
-
-	<select id="get" resultType="BrandPurchaser">
-		SELECT
-			<include refid="brandPurchaserColumns"/>
-		FROM brand_purchaser a
-		<include refid="brandPurchaserJoins"/>
-		WHERE a.id = #{id}
-	</select>
-
-	<select id="findList" resultType="BrandPurchaser">
-		SELECT
-			<include refid="brandPurchaserColumnsWithProductCount"/>
-		FROM brand_purchaser a
-		<include refid="brandPurchaserJoinsWithProductCount"/>
-		<where>
-
-			<if test="id != null and id != ''">
-				AND a.id = #{id}
-			</if>
-			<if test="name != null and name != ''">
-				AND a.name LIKE concat('%',#{name},'%')
-			</if>
-			<if test="enabledStatus != null and enabledStatus != ''">
-				AND a.enabled_status = #{enabledStatus}
-			</if>
-			and c.productCategory = 1
-		</where>
-		GROUP BY a.id
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.enabled_status DESC,a.update_date DESC
-			</otherwise>
-		</choose>
-	</select>
-
-	<select id="findAllList" resultType="BrandPurchaser">
-		SELECT
-			<include refid="brandPurchaserColumns"/>
-		FROM brand_purchaser a
-		<include refid="brandPurchaserJoins"/>
-		<where>
-
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.update_date DESC
-			</otherwise>
-		</choose>
-	</select>
-
-	<insert id="insert" parameterType="BrandPurchaser"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO brand_purchaser(
-			name,
-			purchase_date,
-			intro,
-			publicty_material_images,
-			large_Images,
-			enabled_status,
-			create_by,
-			create_date,
-			update_by,
-			update_date
-		) VALUES (
-			#{name},
-			#{purchaseDate},
-			#{intro},
-			#{publictyMaterialImages},
-			#{largeImages},
-			#{enabledStatus},
-			#{createBy.id},
-			#{createDate},
-			#{updateBy.id},
-			#{updateDate}
-		)
-	</insert>
-
-	<update id="update">
-		UPDATE brand_purchaser SET
-			name = #{name},
-			purchase_date = #{purchaseDate},
-			intro = #{intro},
-			publicty_material_images = #{publictyMaterialImages},
-			large_Images = #{largeImages},
-			enabled_status = #{enabledStatus},
-			update_by = #{updateBy.id},
-			update_date = #{updateDate}
-		WHERE id = #{id}
-	</update>
-
-	<delete id="delete">
-		DELETE FROM brand_purchaser
-		WHERE id = #{id}
-	</delete>
-
-	<update id="changeStatus" parameterType="Map">
-		UPDATE brand_purchaser SET
-			enabled_status = #{enabledStatus}
-		WHERE id = #{id}
-	</update>
-
-</mapper>

+ 0 - 184
src/main/resources/mappings/modules/brand/BrandSupplierMapper.xml

@@ -1,184 +0,0 @@
-<?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="com.caimei.modules.brand.dao.BrandSupplierDao">
-
-	<sql id="brandSupplierColumns">
-		a.id AS "id",
-		a.shopid AS "shopID",
-		a.logo AS "LOGO",
-		a.name AS "name",
-		a.business_license AS "businessLicense",
-		a.business_address AS "businessAddress",
-		a.business_phone AS "businessPhone",
-		a.legal_representaive AS "legalRepresentaive",
-		a.registered_capital AS "registeredCapital",
-		a.enterprise_type AS "enterpriseType",
-		a.business_scope AS "businessScope",
-		a.enabled_status AS "enabledStatus",
-		a.create_by AS "createBy.id",
-		a.create_date AS "createDate",
-		a.update_by AS "updateBy.id",
-		a.update_date AS "updateDate"
-	</sql>
-
-	<sql id="brandSupplierColumnsWithProductCount">
-		a.id AS "id",
-		a.shopid AS "shopID",
-		a.logo AS "LOGO",
-		a.name AS "name",
-		a.business_license AS "businessLicense",
-		a.business_address AS "businessAddress",
-		a.business_phone AS "businessPhone",
-		a.legal_representaive AS "legalRepresentaive",
-		a.registered_capital AS "registeredCapital",
-		a.enterprise_type AS "enterpriseType",
-		a.business_scope AS "businessScope",
-		a.enabled_status AS "enabledStatus",
-		a.create_by AS "createBy.id",
-		a.create_date AS "createDate",
-		a.update_by AS "updateBy.id",
-		a.update_date AS "updateDate",
-		COUNT(b.id) AS "productTotalCount",
-		COUNT(DISTINCT c.productID) AS "productTypeCount"
-	</sql>
-
-	<sql id="brandSupplierJoins">
-	</sql>
-
-	<sql id="brandSupplierJoinsWithProductCount">
-		LEFT JOIN brand_product b ON a.id = b.supplier_id
-		LEFT JOIN product c ON b.productID = c.productID
-	</sql>
-
-	<select id="get" resultType="BrandSupplier">
-		SELECT
-			<include refid="brandSupplierColumns"/>, b.name AS shopName
-
-		FROM brand_supplier a LEFT JOIN shop b ON a.shopID = b.shopID
-		<include refid="brandSupplierJoins"/>
-		WHERE a.id = #{id}
-	</select>
-
-	<select id="findList" resultType="BrandSupplier">
-		SELECT
-			<include refid="brandSupplierColumnsWithProductCount"/>
-		FROM brand_supplier a
-		<include refid="brandSupplierJoinsWithProductCount"/>
-		<where>
-
-			<if test="shopID != null and shopID != ''">
-				AND a.shopid = #{shopID}
-			</if>
-			<if test="name != null and name != ''">
-				AND a.name LIKE
-					<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
-					<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
-					<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
-			</if>
-			<if test="enabledStatus != null and enabledStatus != ''">
-				AND a.enabled_status = #{enabledStatus}
-			</if>
-			and c.productCategory = 1
-		</where>
-		GROUP BY a.id
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.enabled_status DESC,a.update_date DESC
-			</otherwise>
-		</choose>
-	</select>
-
-	<select id="findAllList" resultType="BrandSupplier">
-		SELECT
-			<include refid="brandSupplierColumns"/>
-		FROM brand_supplier a
-		<include refid="brandSupplierJoins"/>
-		<where>
-
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.update_date DESC
-			</otherwise>
-		</choose>
-	</select>
-
-	<insert id="insert" parameterType="BrandSupplier"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO brand_supplier(
-			shopid,
-			logo,
-			name,
-			business_license,
-			business_address,
-			business_phone,
-			legal_representaive,
-			registered_capital,
-			enterprise_type,
-			business_scope,
-			enabled_status,
-			create_by,
-			create_date,
-			update_by,
-			update_date
-		) VALUES (
-			#{shopID},
-			#{LOGO},
-			#{name},
-			#{businessLicense},
-			#{businessAddress},
-			#{businessPhone},
-			#{legalRepresentaive},
-			#{registeredCapital},
-			#{enterpriseType},
-			#{businessScope},
-			#{enabledStatus},
-			#{createBy.id},
-			#{createDate},
-			#{updateBy.id},
-			#{updateDate}
-		)
-	</insert>
-
-	<update id="update">
-		UPDATE brand_supplier SET
-			shopid = #{shopID},
-			logo = #{LOGO},
-			name = #{name},
-			business_license = #{businessLicense},
-			business_address = #{businessAddress},
-			business_phone = #{businessPhone},
-			legal_representaive = #{legalRepresentaive},
-			registered_capital = #{registeredCapital},
-			enterprise_type = #{enterpriseType},
-			business_scope = #{businessScope},
-			enabled_status = #{enabledStatus},
-			update_by = #{updateBy.id},
-			update_date = #{updateDate}
-		WHERE id = #{id}
-	</update>
-
-	<delete id="delete">
-		DELETE FROM brand_supplier
-		WHERE id = #{id}
-	</delete>
-
-	<update id="changeStatus" parameterType="Map">
-		UPDATE brand_supplier SET enabled_status = #{enabledStatus}
-		WHERE id = #{id}
-	</update>
-
-	<update id="updateEnabledStatusByIds" parameterType="Map">
-		UPDATE brand_supplier a SET a.enabled_status = #{param1}
-		WHERE  a.id IN
-	 	<foreach collection="param2" item="id" index="index" open="(" separator="," close=")" >
-	       #{id}
-	 	</foreach>
-	</update>
-
-</mapper>

+ 0 - 76
src/main/resources/mappings/modules/brand/ProductModelMapper.xml

@@ -1,76 +0,0 @@
-<?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="com.caimei.modules.brand.dao.ProductModelDao">
-
-	<sql id="aColumns">
-		a.productID AS "productID",
-		a.name AS "productName",
-		a.shopID AS "shopID",
-		b.name AS "shopName"
-	</sql>
-
-	<sql id="aJoins">
-		LEFT JOIN shop b ON b.shopID=a.shopID
-	</sql>
-
-	<select id="get" resultType="ProductModel">
-		SELECT
-			<include refid="aColumns"/>
-		FROM product a
-		<include refid="aJoins"/>
-		WHERE a.productID = #{productID}
-	</select>
-
-	<select id="findList" resultType="ProductModel">
-		SELECT
-			<include refid="aColumns"/>
-		FROM product a
-		<include refid="aJoins"/>
-		<where>
-			<if test="productID != null and productID != ''">
-				AND a.productID = #{productID}
-			</if>
-			<if test="productName != null and productName != ''">
-				AND a.name LIKE concat('%',#{productName},'%')
-			</if>
-				AND a.validFlag ='2'
-				and a.productCategory = 1
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.productID DESC
-			</otherwise>
-		</choose>
-	</select>
-
-	<select id="findAllList" resultType="ProductModel">
-		SELECT
-			<include refid="aColumns"/>
-		FROM product a
-		<include refid="aJoins"/>
-		<where>
-			a.productCategory = 1
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.productID DESC
-			</otherwise>
-		</choose>
-	</select>
-
-	<insert id="insert">
-	</insert>
-
-	<update id="update">
-	</update>
-
-	<delete id="delete">
-	</delete>
-
-</mapper>

+ 0 - 75
src/main/resources/mappings/modules/brand/ShopModelMapper.xml

@@ -1,75 +0,0 @@
-<?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="com.caimei.modules.brand.dao.ShopModelDao">
-    
-	<sql id="aColumns">
-		a.shopID AS "shopID",
-		a.name AS "shopName",
-		a.logo AS "logo",
-		a.ledgerNo as "ledgerNo"
-	</sql>
-	
-	<sql id="aJoins">
-		
-	</sql>
-    
-	<select id="get" resultType="ShopModel">
-		SELECT 
-			<include refid="aColumns"/>
-		FROM shop a
-		<include refid="aJoins"/>
-		WHERE a.shopID = #{shopID}
-	</select>
-	
-	<select id="findList" resultType="ShopModel">
-		SELECT 
-			<include refid="aColumns"/>
-		FROM shop a
-		<include refid="aJoins"/>
-		<where>
-			<if test="shopID != null and shopID != ''">
-				AND a.shopID = #{shopID}
-			</if>
-			<if test="shopName != null and shopName != ''">
-				AND a.name LIKE concat('%',#{shopName},'%')
-			</if>
-			AND a.status IN (9,10,90)
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.shopID DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="ShopModel">
-		SELECT 
-			<include refid="aColumns"/>
-		FROM shop a
-		<include refid="aJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.productID DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert">
-	</insert>
-	
-	<update id="update">
-	</update>
-	
-	<delete id="delete">
-	</delete>
-	
-</mapper>

+ 0 - 106
src/main/resources/mappings/modules/bulkpurchase/CmRefundsRecordMapper.xml

@@ -1,106 +0,0 @@
-<?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="com.caimei.modules.bulkpurchase.dao.CmRefundsRecordDao">
-    
-	<sql id="cmRefundsRecordColumns">
-		a.id AS "id",
-		a.orderId AS "orderId",
-		a.userId AS "userId",
-		a.userType AS "userType",
-		a.orderType AS "orderType",
-		a.recordContent AS "recordContent",
-		a.recordDate AS "recordDate"
-	</sql>
-	
-	<sql id="cmRefundsRecordJoins">
-	</sql>
-    
-	<select id="get" resultType="CmRefundsRecord">
-		SELECT 
-			<include refid="cmRefundsRecordColumns"/>
-		FROM cm_refunds_record a
-		<include refid="cmRefundsRecordJoins"/>
-		WHERE a.id = #{id}
-		order BY a.recordDate DESC
-	</select>
-	
-	<select id="findList" resultType="CmRefundsRecord">
-		SELECT 
-			<include refid="cmRefundsRecordColumns"/>
-		FROM cm_refunds_record a
-		<include refid="cmRefundsRecordJoins"/>
-		<where>
-			
-			<if test="userId != null and userId != ''">
-				AND a.userId = #{userId}
-			</if>
-			<if test="orderId != null and orderId != ''">
-				AND a.orderId = #{orderId}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-		order BY a.recordDate DESC
-	</select>
-	
-	<select id="findAllList" resultType="CmRefundsRecord">
-		SELECT 
-			<include refid="cmRefundsRecordColumns"/>
-		FROM cm_refunds_record a
-		<include refid="cmRefundsRecordJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="CmRefundsRecord"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cm_refunds_record(
-			id,
-			orderId,
-			userId,
-			userType,
-			orderType,
-			recordContent,
-			recordDate
-		) VALUES (
-			#{id},
-			#{orderId},
-			#{userId},
-			#{userType},
-			#{orderType},
-			#{recordContent},
-			#{recordDate}
-		)
-	</insert>
-	
-	<update id="update">
-	UPDATE cm_refunds_record SET
-	orderId = #{orderId},
-	userId = #{userId},
-	userType = #{userType},
-	orderType = #{orderType},
-	recordContent = #{recordContent},
-	recordDate = #{recordDate}
-	WHERE id = #{id}
-    </update>
-
-
-	
-	<delete id="delete">
-		DELETE FROM cm_refunds_record
-		WHERE id = #{id}
-	</delete>
-	
-</mapper>

+ 0 - 28
src/main/resources/mappings/modules/bulkpurchase/CommissionsMapper.xml

@@ -1,28 +0,0 @@
-<?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="com.caimei.modules.bulkpurchase.dao.CommissionsDao">
-
-<select id="findList" resultType="com.caimei.modules.bulkpurchase.entity.Commissions">
-    SELECT id,orderid,`name`,`addtime`,sales,script
-    FROM `sales_commissions`
-    WHERE orderid=#{orderId}
-    ORDER BY `addtime` DESC
-</select>
-
-
-    <insert id="insert" parameterType="com.caimei.modules.bulkpurchase.entity.Commissions" keyProperty="id"
-            useGeneratedKeys="true">
-        INSERT INTO `sales_commissions`
-        (orderid,
-         name,
-         `addtime`,
-         `sales`,
-         script)
-        VALUES (#{orderId},
-                #{name},
-                #{addTime},
-                #{sales},
-                #{script})
-    </insert>
-
-</mapper>

+ 0 - 143
src/main/resources/mappings/modules/cibe/CibeBlessingCompoMapper.xml

@@ -1,143 +0,0 @@
-<?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="com.caimei.modules.cibe.dao.CibeBlessingCompoDao">
-    
-	<sql id="cibeBlessingCompoColumns">
-		a.id AS "id",
-		a.userId AS "userId",
-		a.mobile AS "mobile",
-		a.blessNum AS "blessNum",
-		a.blessCode AS "blessCode",
-		a.getWay AS "getWay",
-		a.getTime AS "getTime",
-		a.activeNum AS "activeNum",
-		a.activeStartTime AS "activeStartTime",
-		a.activeEndTime AS "activeEndTime",
-		a.openStatus AS "openStatus",
-		a.prizeType AS "prizeType",
-		a.prizeDescribe AS "prizeDescribe",
-		a.money AS "money",
-		a.goPrize AS "goPrize"
-	</sql>
-	
-	<sql id="cibeBlessingCompoJoins">
-	</sql>
-    
-	<select id="get" resultType="CibeBlessingCompo">
-		SELECT 
-			<include refid="cibeBlessingCompoColumns"/>
-		FROM cibe_blessing_compo a
-		<include refid="cibeBlessingCompoJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="CibeBlessingCompo">
-		SELECT
-		a.*,cu.userType AS "userType",cu.userName AS "userName",cu.address AS "address"
-		FROM cibe_blessing_compo a
-		LEFT JOIN cibe_user cu ON cu.userId = a.userId
-		<where>
-			
-			<if test="userId != null and userId != ''">
-				AND a.userId = #{userId}
-			</if>
-			<if test="mobile != null and mobile != ''">
-				AND a.mobile = #{mobile}
-			</if>
-			<if test="blessCode != null and blessCode != ''">
-				AND a.blessCode = #{blessCode}
-			</if>
-			<if test="getWay != null and getWay != ''">
-				AND a.getWay = #{getWay}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="CibeBlessingCompo">
-		SELECT 
-			<include refid="cibeBlessingCompoColumns"/>
-		FROM cibe_blessing_compo a
-		<include refid="cibeBlessingCompoJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="CibeBlessingCompo"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cibe_blessing_compo(
-			userId,
-			mobile,
-			blessNum,
-			blessCode,
-			getWay,
-			getTime,
-			activeNum,
-			activeStartTime,
-			activeEndTime,
-			openStatus,
-			prizeType,
-			prizeDescribe,
-			money,
-			goPrize
-		) VALUES (
-			#{userId},
-			#{mobile},
-			#{blessNum},
-			#{blessCode},
-			#{getWay},
-			#{getTime},
-			#{activeNum},
-			#{activeStartTime},
-			#{activeEndTime},
-			#{openStatus},
-			#{prizeType},
-			#{prizeDescribe},
-			#{money},
-			#{goPrize}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE cibe_blessing_compo SET 	
-			mobile = #{mobile},
-			blessNum = #{blessNum},
-			blessCode = #{blessCode},
-			getWay = #{getWay},
-			getTime = #{getTime},
-			activeNum = #{activeNum},
-			activeStartTime = #{activeStartTime},
-			activeEndTime = #{activeEndTime},
-			openStatus = #{openStatus},
-			prizeType = #{prizeType},
-			prizeDescribe = #{prizeDescribe},
-			money = #{money},
-			goPrize = #{goPrize}
-		WHERE id = #{id}
-	</update>
-
-	<update id="updateLottery">
-		UPDATE cibe_blessing_compo SET
-		goPrize = 1
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM cibe_blessing_compo
-		WHERE id = #{id}
-	</delete>
-	
-</mapper>

+ 0 - 107
src/main/resources/mappings/modules/cibe/CibePrizeMapper.xml

@@ -1,107 +0,0 @@
-<?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="com.caimei.modules.cibe.dao.CibePrizeDao">
-    
-	<sql id="cibePrizeColumns">
-		a.id AS "id",
-		a.userId AS "userId",
-		a.prizeType AS "prizeType",
-		a.prizeCode AS "prizeCode",
-		a.mobile AS "mobile",
-		a.addTime AS "addTime"
-	</sql>
-	
-	<sql id="cibePrizeJoins">
-	</sql>
-    
-	<select id="get" resultType="CibePrize">
-		SELECT 
-			<include refid="cibePrizeColumns"/>
-		FROM cibe_prize a
-		<include refid="cibePrizeJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="CibePrize">
-		SELECT 
-			<include refid="cibePrizeColumns"/>
-		FROM cibe_prize a
-		<include refid="cibePrizeJoins"/>
-		<where>
-			
-			<if test="id != null and id != ''">
-				AND a.id = #{id}
-			</if>
-			<if test="userId != null and userId != ''">
-				AND a.userId = #{userId}
-			</if>
-			<if test="prizeType != null and prizeType != ''">
-				AND a.prizeType = #{prizeType}
-			</if>
-			<if test="mobile != null and mobile != ''">
-				AND a.mobile = LIKE
-				<if test="dbName == 'oracle'">'%'||#{mobile}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{mobile}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{mobile},'%')</if>
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY addTime DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="CibePrize">
-		SELECT 
-			<include refid="cibePrizeColumns"/>
-		FROM cibe_prize a
-		<include refid="cibePrizeJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY addTime DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="CibePrize"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cibe_prize(
-			userId,
-			prizeType,
-			prizeCode,
-			mobile,
-			addTime
-		) VALUES (
-			#{userId},
-			#{prizeType},
-			#{prizeCode},
-			#{mobile},
-			#{addTime}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE cibe_prize SET 	
-			userId = #{userId},
-			prizeType = #{prizeType},
-			prizeCode = #{prizeCode},
-			mobile = #{mobile},
-			addTime = #{addTime}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM cibe_prize
-		WHERE id = #{id}
-	</delete>
-	
-</mapper>

+ 0 - 113
src/main/resources/mappings/modules/cibe/CibeProductTypeMapper.xml

@@ -1,113 +0,0 @@
-<?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="com.caimei.modules.cibe.dao.CibeProductTypeDao">
-    
-	<sql id="cibeProductTypeColumns">
-		a.id AS "id",
-		a.productType AS "productType",
-		a.shopIDs AS "shopIDs",
-		a.enabledStatus AS "enabledStatus",
-		a.addTime AS "addTime",
-		a.updateTime AS "updateTime",
-		a.sortIndex AS "sortIndex"
-	</sql>
-	
-	<sql id="cibeProductTypeJoins">
-	</sql>
-    
-	<select id="get" resultType="CibeProductType">
-		SELECT 
-			<include refid="cibeProductTypeColumns"/>
-		FROM cibe_product_type a
-		<include refid="cibeProductTypeJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="CibeProductType">
-		SELECT 
-			<include refid="cibeProductTypeColumns"/>
-		FROM cibe_product_type a
-		<include refid="cibeProductTypeJoins"/>
-		<where>
-			
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.enabledStatus DESC ,a.sortIndex DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="CibeProductType">
-		SELECT 
-			<include refid="cibeProductTypeColumns"/>
-		FROM cibe_product_type a
-		<include refid="cibeProductTypeJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="CibeProductType"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cibe_product_type(
-			productType,
-			shopIDs,
-			enabledStatus,
-			addTime,
-			updateTime,
-			sortIndex
-		) VALUES (
-			#{productType},
-			#{shopIDs},
-			#{enabledStatus},
-			#{addTime},
-			#{updateTime},
-			#{sortIndex}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE cibe_product_type SET 	
-			productType = #{productType},
-			shopIDs = #{shopIDs},
-			enabledStatus = #{enabledStatus},
-			addTime = #{addTime},
-			updateTime = #{updateTime},
-			sortIndex = #{sortIndex}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM cibe_product_type
-		WHERE id = #{id}
-	</delete>
-
-
-	<!--判断商品分类名称唯一-->
-	<select id="getByProductType" resultType="CibeProductType">
-		SELECT
-		*
-		FROM cibe_product_type a
-		WHERE
-		a.productType = #{productType}
-		<if test="id != null and id != ''">
-			AND a.id != #{id}
-		</if>
-	</select>
-
-	<!--修改状态-->
-	<update id="updateEnabledStatusById">
-		UPDATE cibe_product_type a SET a.enabledStatus = #{enabledStatus}
-		WHERE  a.id = #{id}
-	</update>
-</mapper>

+ 0 - 150
src/main/resources/mappings/modules/cibe/CibeShopMapper.xml

@@ -1,150 +0,0 @@
-<?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="com.caimei.modules.cibe.dao.CibeShopDao">
-    
-	<sql id="cibeShopColumns">
-		a.id AS "id",
-		a.shopId AS "shopId",
-		a.shopName AS "shopName",
-		a.sname AS "sname",
-		a.exhibitionLocation AS "exhibitionLocation",
-		a.showKey AS "showKey",
-		a.searchKey AS "searchKey",
-		a.brandManufacturers AS "brandManufacturers",
-		a.sortIndex AS "sortIndex"
-	</sql>
-	
-	<sql id="cibeShopJoins">
-	</sql>
-    
-	<select id="get" resultType="CibeShop">
-		SELECT 
-			<include refid="cibeShopColumns"/>
-		FROM cibe_shop a
-		<include refid="cibeShopJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="CibeShop">
-		SELECT 
-			<include refid="cibeShopColumns"/>
-		FROM cibe_shop a
-		<include refid="cibeShopJoins"/>
-		<where>
-			
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="CibeShop">
-		SELECT 
-			<include refid="cibeShopColumns"/>
-		FROM cibe_shop a
-		<include refid="cibeShopJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="CibeShop"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cibe_shop(
-			id,
-			shopId,
-			shopName,
-			sname,
-			exhibitionLocation,
-			showKey,
-			searchKey,
-			brandManufacturers,
-			sortIndex
-		) VALUES (
-			#{id},
-			#{shopId},
-			#{shopName},
-			#{sname},
-			#{exhibitionLocation},
-			#{showKey},
-			#{searchKey},
-			#{brandManufacturers},
-			#{sortIndex}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE cibe_shop SET 	
-			shopId = #{shopId},
-			shopName = #{shopName},
-			sname = #{sname},
-			exhibitionLocation = #{exhibitionLocation},
-			showKey = #{showKey},
-			searchKey = #{searchKey},
-			brandManufacturers = #{brandManufacturers},
-			sortIndex = #{sortIndex}
-		WHERE id = #{id}
-	</update>
-
-	<delete id="deleteAll">
-		DELETE FROM cibe_shop
-	</delete>
-
-	<delete id="delete">
-		DELETE FROM cibe_shop
-		WHERE id = #{id}
-	</delete>
-
-	<update id="updateSname">
-		UPDATE cibe_shop SET
-		sname = #{sname}
-		WHERE id = #{id}
-	</update>
-
-	<!--获取采美供应商详情-->
-	<select id="getShopInfo" resultType="com.caimei.modules.cibe.entity.Shop">
-		SELECT
-		*
-		FROM shop
-		WHERE shopID = #{shopId}
-	</select>
-
-	<!--获取供应商资质认证-->
-	<select id="getShopCert" resultType="com.caimei.modules.cibe.entity.ShopCert">
-		SELECT
-		*
-		FROM shopcert
-		WHERE shopID = #{shopId}
-	</select>
-
-	<!--通过供应商ID串获取供应商-->
-	<select id="findCibeShopByShopIDs" resultType="com.caimei.modules.cibe.entity.CibeShop" parameterType="com.caimei.modules.cibe.entity.CibeProductType">
-		SELECT
-		*
-		FROM cibe_shop
-		WHERE  ${sqlMap.shopIDs}
-	</select>
-
-
-	<select id="getLocation" resultType="com.caimei.modules.cibe.entity.CibeShop">
-		SELECT
-		<include refid="cibeShopColumns"/>
-		FROM cibe_shop a
-		<include refid="cibeShopJoins"/>
-		WHERE
-		a.exhibitionLocation = #{location}
-		<if test="id != null and id != ''">
-			AND a.id != #{id}
-		</if>
-	</select>
-</mapper>

+ 0 - 96
src/main/resources/mappings/modules/cibe/CibeSpecialMobileMapper.xml

@@ -1,96 +0,0 @@
-<?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="com.caimei.modules.cibe.dao.CibeSpecialMobileDao">
-    
-	<sql id="cibeSpecialMobileColumns">
-		a.id AS "id",
-		a.mobile AS "mobile",
-		a.addTime AS "addTime",
-		a.state AS "state"
-	</sql>
-	
-	<sql id="cibeSpecialMobileJoins">
-	</sql>
-    
-	<select id="get" resultType="CibeSpecialMobile">
-		SELECT 
-			<include refid="cibeSpecialMobileColumns"/>
-		FROM cibe_special_mobile a
-		<include refid="cibeSpecialMobileJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="CibeSpecialMobile">
-		SELECT 
-			<include refid="cibeSpecialMobileColumns"/>
-		FROM cibe_special_mobile a
-		<include refid="cibeSpecialMobileJoins"/>
-		<where>
-			
-			<if test="mobile != null and mobile != ''">
-				AND a.mobile = #{mobile}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="CibeSpecialMobile">
-		SELECT 
-			<include refid="cibeSpecialMobileColumns"/>
-		FROM cibe_special_mobile a
-		<include refid="cibeSpecialMobileJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="CibeSpecialMobile"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cibe_special_mobile(
-			mobile,
-			addTime,
-			state
-		) VALUES (
-			#{mobile},
-			#{addTime},
-			#{state}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE cibe_special_mobile SET 	
-			mobile = #{mobile},
-			addTime = #{addTime},
-			state = #{state}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM cibe_special_mobile
-		WHERE id = #{id}
-	</delete>
-
-	<select id="getMobile" resultType="CibeSpecialMobile">
-		SELECT
-		*
-		FROM cibe_special_mobile a
-		<where>
-			   a.mobile = #{mobile}
-			<if test="id != null and id != ''">
-				AND a.id != #{id}
-			</if>
-		</where>
-	</select>
-</mapper>

+ 0 - 127
src/main/resources/mappings/modules/cibe/CibeUserMapper.xml

@@ -1,127 +0,0 @@
-<?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="com.caimei.modules.cibe.dao.CibeUserDao">
-    
-	<sql id="cibeUserColumns">
-		a.id AS "id",
-		a.userId AS "userId",
-		a.userName AS "userName",
-		a.mobile AS "mobile",
-		a.address AS "address",
-		a.userType AS "userType",
-		a.openid AS "openid",
-		a.prizeId AS "prizeId",
-		a.prizeType AS "prizeType",
-		a.prizeCode AS "prizeCode",
-		a.prizeTime AS "prizeTime"
-	</sql>
-	
-	<sql id="cibeUserJoins">
-	</sql>
-    
-	<select id="get" resultType="CibeUser">
-		SELECT 
-			<include refid="cibeUserColumns"/>
-		FROM cibe_user a
-		<include refid="cibeUserJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="CibeUser">
-		SELECT 
-			<include refid="cibeUserColumns"/>
-		FROM cibe_user a
-		<include refid="cibeUserJoins"/>
-		<where>
-			<if test="userId != null and userId != ''">
-				AND a.userId = #{userId}
-			</if>
-			<if test="userName != null and userName != ''">
-				AND a.userName LIKE 
-					<if test="dbName == 'oracle'">'%'||#{userName}||'%'</if>
-					<if test="dbName == 'mssql'">'%'+#{userName}+'%'</if>
-					<if test="dbName == 'mysql'">concat('%',#{userName},'%')</if>
-			</if>
-			<if test="mobile != null and mobile != ''">
-				AND a.mobile LIKE
-				<if test="dbName == 'oracle'">'%'||#{mobile}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{mobile}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{mobile},'%')</if>
-			</if>
-			<if test="prizeType != null and prizeType != ''">
-				AND a.prizeType = #{prizeType}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="CibeUser">
-		SELECT 
-			<include refid="cibeUserColumns"/>
-		FROM cibe_user a
-		<include refid="cibeUserJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="CibeUser"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cibe_user(
-			userId,
-			userName,
-			mobile,
-			address,
-			userType,
-			openid,
-			prizeId,
-			prizeType,
-			prizeCode,
-			prizeTime
-		) VALUES (
-			#{userId},
-			#{userName},
-			#{mobile},
-			#{address},
-			#{userType},
-			#{openid},
-			#{prizeId},
-			#{prizeType},
-			#{prizeCode},
-			#{prizeTime}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE cibe_user SET 	
-			userId = #{userId},
-			userName = #{userName},
-			mobile = #{mobile},
-			address = #{address},
-			userType = #{userType},
-			openid = #{openid},
-			prizeId = #{prizeId},
-			prizeType = #{prizeType},
-			prizeCode = #{prizeCode},
-			prizeTime = #{prizeTime}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM cibe_user
-		WHERE id = #{id}
-	</delete>
-	
-</mapper>

+ 0 - 93
src/main/resources/mappings/modules/cmme/dict/CmmeSysDictMapper.xml

@@ -1,93 +0,0 @@
-<?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="com.cmme.modules.dict.dao.CmmeSysDictDao">
-    
-	<select id="get" resultType="CmmeSysDict">
-		SELECT 
-			*
-		FROM cmme_sys_dict
-		WHERE id = #{id}
-	</select>
-	
-	<select id="findList" resultType="CmmeSysDict">
-		SELECT
-		*
-		FROM cmme_sys_dict
-		WHERE del_flag = #{DEL_FLAG_NORMAL}
-		<if test="type != null and type != ''">
-			AND type = #{type}
-		</if>
-		<if test="description != null and description != ''">
-			AND description LIKE
-			<if test="dbName == 'oracle'">'%'||#{description}||'%'</if>
-			<if test="dbName == 'mssql'">'%'+#{description}+'%'</if>
-			<if test="dbName == 'mysql'">CONCAT('%', #{description}, '%')</if>
-		</if>
-		ORDER BY type, sort, update_date DESC
-	</select>
-	
-	<select id="findAllList" resultType="CmmeSysDict">
-		SELECT
-		*
-		FROM cmme_sys_dict
-		WHERE del_flag = #{DEL_FLAG_NORMAL}
-		ORDER BY type, sort, update_date DESC
-	</select>
-
-	<select id="findTypeList" resultType="string">
-		SELECT
-		type
-		FROM cmme_sys_dict
-		WHERE del_flag = #{DEL_FLAG_NORMAL}
-		GROUP BY type
-		ORDER BY type
-	</select>
-
-
-	<insert id="insert" parameterType="CmmeSysDict"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cmme_sys_dict(
-			value,
-			label,
-			type,
-			description,
-			sort,
-			create_by,
-			create_date,
-			update_by,
-			update_date,
-			remarks,
-			del_flag
-		) VALUES (
-			#{value},
-			#{label},
-			#{type},
-			#{description},
-			#{sort},
-			#{createBy.id},
-			#{createDate},
-			#{updateBy.id},
-			#{updateDate},
-			#{remarks},
-			#{delFlag}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE cmme_sys_dict SET
-			value = #{value},
-			label = #{label},
-			type = #{type},
-			description = #{description},
-			sort = #{sort},
-			update_by = #{updateBy.id},
-			update_date = #{updateDate},
-			remarks = #{remarks}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM cmme_sys_dict
-		WHERE id = #{id}
-	</delete>
-	
-</mapper>

+ 0 - 124
src/main/resources/mappings/modules/cmme/product/CmmeBigtypeMapper.xml

@@ -1,124 +0,0 @@
-<?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="com.cmme.modules.product.dao.CmmeBigtypeDao">
-    
-	<sql id="cmmeBigtypeColumns">
-		a.bigTypeID AS "bigTypeID",
-		a.name AS "name",
-		a.bigTypeCode AS "bigTypeCode",
-		a.validFlag AS "validFlag",
-		a.sortIndex AS "sortIndex"
-	</sql>
-	
-	<sql id="cmmeBigtypeJoins">
-	</sql>
-    
-	<select id="get" resultType="CmmeBigtype">
-		SELECT 
-			<include refid="cmmeBigtypeColumns"/>
-		FROM cmme_bigtype a
-		<include refid="cmmeBigtypeJoins"/>
-		WHERE a.bigTypeID = #{id}
-	</select>
-
-	<!--由于分类ID必须不唯一则重复编辑的时候查看不等于自己ID的code是否重复-->
-	<select id="getByCode" resultType="CmmeBigtype">
-		SELECT
-		<include refid="cmmeBigtypeColumns"/>
-		FROM cmme_bigtype a
-		<include refid="cmmeBigtypeJoins"/>
-		WHERE
-		a.bigTypeCode = #{bigTypeCode}
-		<if test="bigTypeID != null and bigTypeID != ''">
-		AND a.bigTypeID != #{bigTypeID}
-		</if>
-	</select>
-
-	<select id="getByName" resultType="CmmeBigtype">
-		SELECT
-		<include refid="cmmeBigtypeColumns"/>
-		FROM cmme_bigtype a
-		<include refid="cmmeBigtypeJoins"/>
-		WHERE
-		a.name = #{name}
-		<if test="bigTypeID != null and bigTypeID != ''">
-			AND a.bigTypeID != #{bigTypeID}
-		</if>
-	</select>
-
-
-	<select id="findList" resultType="CmmeBigtype">
-		SELECT 
-			<include refid="cmmeBigtypeColumns"/>
-		FROM cmme_bigtype a
-		<include refid="cmmeBigtypeJoins"/>
-		<where>
-			
-			<if test="bigTypeID != null and bigTypeID != ''">
-				AND a.bigTypeID = #{bigTypeID}
-			</if>
-			<if test="name != null and name != ''">
-				AND a.name LIKE 
-					<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
-					<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
-					<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
-			</if>
-			<if test="validFlag != null and validFlag != ''">
-				AND a.validFlag = #{validFlag}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="CmmeBigtype">
-		SELECT 
-			<include refid="cmmeBigtypeColumns"/>
-		FROM cmme_bigtype a
-		<include refid="cmmeBigtypeJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="CmmeBigtype"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cmme_bigtype(
-			name,
-			bigTypeCode,
-			validFlag,
-			sortIndex
-		) VALUES (
-			#{name},
-			#{bigTypeCode},
-			#{validFlag},
-			#{sortIndex}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE cmme_bigtype SET 	
-			name = #{name},
-			bigTypeCode = #{bigTypeCode},
-			validFlag = #{validFlag},
-			sortIndex = #{sortIndex}
-		WHERE bigTypeID = #{bigTypeID}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM cmme_bigtype
-		WHERE bigTypeID = #{bigTypeID}
-	</delete>
-	
-</mapper>

+ 0 - 114
src/main/resources/mappings/modules/cmme/product/CmmeMainproductMapper.xml

@@ -1,114 +0,0 @@
-<?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="com.cmme.modules.product.dao.CmmeMainproductDao">
-    
-	<sql id="cmmeMainproductColumns">
-		a.mainProductID AS "mainProductID",
-		a.productID AS "productID",
-		a.shopID AS "shopID",
-		a.productIndex AS "productIndex",
-		a.productMainImage AS "productMainImage",
-		a.productName AS "productName",
-		a.validFlag AS "validFlag"
-	</sql>
-	
-	<sql id="cmmeMainproductJoins">
-	</sql>
-    
-	<select id="get" resultType="CmmeMainproduct">
-		SELECT 
-			<include refid="cmmeMainproductColumns"/>
-		FROM cmme_mainproduct a
-		<include refid="cmmeMainproductJoins"/>
-		WHERE a.mainProductID = #{id} AND validFlag = 1
-	</select>
-
-	<select id="getByProductID" resultType="CmmeMainproduct">
-		SELECT
-		<include refid="cmmeMainproductColumns"/>
-		FROM cmme_mainproduct a
-		<include refid="cmmeMainproductJoins"/>
-		WHERE a.productID = #{productID} AND validFlag = 1
-	</select>
-
-	<select id="findList" resultType="CmmeMainproduct">
-		SELECT 
-			<include refid="cmmeMainproductColumns"/>
-		FROM cmme_mainproduct a
-		<include refid="cmmeMainproductJoins"/>
-		<where>
-			
-			<if test="mainProductID != null and mainProductID != ''">
-				AND a.mainProductID = #{mainProductID}
-			</if>
-			<if test="productID != null and productID != ''">
-				AND a.productID = #{productID}
-			</if>
-			<if test="shopID != null and shopID != ''">
-				AND a.shopID = #{shopID}
-			</if>
-			<if test="validFlag != null and validFlag != ''">
-				AND a.validFlag = #{validFlag}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="CmmeMainproduct">
-		SELECT 
-			<include refid="cmmeMainproductColumns"/>
-		FROM cmme_mainproduct a
-		<include refid="cmmeMainproductJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="CmmeMainproduct"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cmme_mainproduct(
-			productID,
-			shopID,
-			productIndex,
-			productMainImage,
-			productName,
-			validFlag
-		) VALUES (
-			#{productID},
-			#{shopID},
-			#{productIndex},
-			#{productMainImage},
-			#{productName},
-			#{validFlag}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE cmme_mainproduct SET 	
-			productID = #{productID},
-			shopID = #{shopID},
-			productIndex = #{productIndex},
-			productMainImage = #{productMainImage},
-			productName = #{productName},
-			validFlag = #{validFlag}
-		WHERE mainProductID = #{mainProductID}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM cmme_mainproduct
-		WHERE mainProductID = #{id}
-	</delete>
-	
-</mapper>

+ 3 - 3
src/main/resources/mappings/modules/order/CmDiscernReceiptMapper.xml

@@ -645,7 +645,7 @@
         cdr.shopName as shopName
         cdr.shopName as shopName
 	    from
 	    from
 		cm_discern_receipt cdr
 		cm_discern_receipt cdr
-		left join receipt_user_permission rup on cdr.confirmUserPermissionID = rup.id
+		left join cm_receipt_user rup on cdr.confirmUserPermissionID = rup.id
         LEFT JOIN cm_offline_collection cof ON cdr.payType = cof.type
         LEFT JOIN cm_offline_collection cof ON cdr.payType = cof.type
 		where cdr.id = #{receiptID}
 		where cdr.id = #{receiptID}
 	</select>
 	</select>
@@ -724,11 +724,11 @@
         cdr.transactionNum AS transactionNum,
         cdr.transactionNum AS transactionNum,
         cror.mbOrderId AS mbOrderId,
         cror.mbOrderId AS mbOrderId,
         cdr.confirmUserPermissionID AS confirmUserPermissionID,
         cdr.confirmUserPermissionID AS confirmUserPermissionID,
-        (select rup.name from receipt_user_permission rup where rup.id = cdr.confirmUserPermissionID) AS
+        (select rup.name from cm_receipt_user rup where rup.id = cdr.confirmUserPermissionID) AS
         confirmUserName,
         confirmUserName,
         cdr.confirmDate AS confirmDate,
         cdr.confirmDate AS confirmDate,
         cdr.reviewUserPermissionID AS reviewUserPermissionID,
         cdr.reviewUserPermissionID AS reviewUserPermissionID,
-        (select rup.name from receipt_user_permission rup where rup.id = cdr.reviewUserPermissionID) AS reviewUserName,
+        (select rup.name from cm_receipt_user rup where rup.id = cdr.reviewUserPermissionID) AS reviewUserName,
         cdr.reviewDate AS reviewDate,
         cdr.reviewDate AS reviewDate,
         cdr.cancelUserPermissionID AS cancelUserPermissionID,
         cdr.cancelUserPermissionID AS cancelUserPermissionID,
         (select su.name from sys_user su where su.id = cdr.cancelUserPermissionID) AS cancelUserName,
         (select su.name from sys_user su where su.id = cdr.cancelUserPermissionID) AS cancelUserName,

+ 2 - 2
src/main/resources/mappings/modules/order/CmRefundShopMapper.xml

@@ -26,7 +26,7 @@
 		FROM cm_refund_shop a
 		FROM cm_refund_shop a
 		<include refid="cmRefundShopJoins"/>
 		<include refid="cmRefundShopJoins"/>
 		left join shop s on s.shopID = a.shopID
 		left join shop s on s.shopID = a.shopID
-		left join receipt_user_permission up on up.id = a.operator
+		left join cm_receipt_user up on up.id = a.operator
 		WHERE a.id = #{id}
 		WHERE a.id = #{id}
 		AND a.delFlag='0'
 		AND a.delFlag='0'
 	</select>
 	</select>
@@ -42,7 +42,7 @@
 		LEFT JOIN cm_refund_shop_record crsr ON crsr.refundShopID = a.id
 		LEFT JOIN cm_refund_shop_record crsr ON crsr.refundShopID = a.id
 		left join shop s on s.shopID = a.shopID
 		left join shop s on s.shopID = a.shopID
 		left join sys_user u on u.id = a.operator
 		left join sys_user u on u.id = a.operator
-		left join receipt_user_permission up on up.id = a.operator
+		left join cm_receipt_user up on up.id = a.operator
 		<where>
 		<where>
 			<if test="organizeID != null and organizeID != 9999 and organizeID != 0 ">
 			<if test="organizeID != null and organizeID != 9999 and organizeID != 0 ">
 				AND a.id IN (
 				AND a.id IN (

+ 0 - 115
src/main/resources/mappings/modules/permission/ReceiptUserPermissionMapper.xml

@@ -1,115 +0,0 @@
-<?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="com.caimei.modules.permission.dao.ReceiptUserPermissionDao">
-    
-	<sql id="receiptUserPermissionColumns">
-		a.id AS "id",
-		a.userType AS "userType",
-		a.userIdentity AS "userIdentity",
-		a.name AS "name",
-		a.mobile AS "mobile",
-		a.openid AS "openid",
-		a.delFlag AS "delFlag"
-	</sql>
-	
-	<sql id="receiptUserPermissionJoins">
-	</sql>
-    
-	<select id="get" resultType="ReceiptUserPermission">
-		SELECT 
-			<include refid="receiptUserPermissionColumns"/>
-		FROM receipt_user_permission a
-		<include refid="receiptUserPermissionJoins"/>
-		WHERE a.id = #{id}
-	</select>
-
-	<select id="findDupBean" resultType="ReceiptUserPermission">
-		SELECT
-		<include refid="receiptUserPermissionColumns"/>
-		FROM receipt_user_permission a
-		where a.openid = #{openid} and a.userType = #{userType}
-	</select>
-	
-	<select id="findList" resultType="ReceiptUserPermission">
-		SELECT 
-			<include refid="receiptUserPermissionColumns"/>
-		FROM receipt_user_permission a
-		<include refid="receiptUserPermissionJoins"/>
-		<where>
-			<if test="name != null and name != ''">
-				AND a.name LIKE 
-					<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
-					<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
-					<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
-			</if>
-			<if test="userType != null and userType != ''">
-				AND a.userType = #{userType}
-			</if>
-			<if test="mobile != null and mobile != ''">
-				AND a.mobile = #{mobile}
-			</if>
-			<if test="openid != null and openid != ''">
-				AND a.openid = #{openid}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="ReceiptUserPermission">
-		SELECT 
-			<include refid="receiptUserPermissionColumns"/>
-		FROM receipt_user_permission a
-		<include refid="receiptUserPermissionJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="ReceiptUserPermission"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO receipt_user_permission(
-			userType,
-			userIdentity,
-			name,
-			mobile,
-			openid,
-			delFlag
-		) VALUES (
-			#{userType},
-			#{userIdentity},
-			#{name},
-			#{mobile},
-			#{openid},
-			#{delFlag}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE receipt_user_permission SET 	
-			userType = #{userType},
-			userIdentity = #{userIdentity},
-			name = #{name},
-			mobile = #{mobile},
-			openid = #{openid},
-			delFlag = #{delFlag}
-		WHERE id = #{id}
-	</update>
-	
-	<delete id="delete">
-		DELETE FROM receipt_user_permission
-		WHERE id = #{id}
-	</delete>
-	
-</mapper>

+ 0 - 207
src/main/resources/mappings/modules/user/CmGclubMapper.xml.bak

@@ -1,207 +0,0 @@
-<?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="com.caimei.modules.user.dao.CmGclubDao">
-
-	<sql id="cmGclubColumns">
-		a.gclubID AS "gclubID",
-		a.name AS "name",
-		a.contacts AS "contacts",
-		a.cellphone AS "cellphone",
-		a.telphone AS "telphone",
-		a.post AS "post",
-		a.address AS "address",
-		a.scale AS "scale",
-		a.empnum AS "empnum",
-		a.mainpro AS "mainpro",
-		a.remark AS "remark",
-		a.image AS "image",
-		a.regStatus AS "regStatus",
-		a.addTime AS "addTime",
-		a.loginTime AS "loginTime",
-		a.provinceID AS "provinceID",
-		a.cityID AS "cityID",
-		a.townID AS "townID",
-		a.agreement AS "agreement",
-		a.flag AS "flag",
-		a.userID AS "userID",
-		a.clubstatus AS "clubstatus",
-		a.BUSINESSLICENSEIMAGE AS "BUSINESSLICENSEIMAGE",
-		a.LASTMODIFY AS "LASTMODIFY",
-		a.inviterBindID AS "inviterBindID",
-		a.inviterName AS "inviterName",
-		a.headpic AS "headpic",
-		a.mainServiceProviderID AS "mainServiceProviderID",
-		a.scanTime AS "scanTime",
-		a.checkTime AS "checkTime",
-		a.spID AS "spID"
-	</sql>
-
-	<sql id="cmGclubJoins">
-	</sql>
-
-	<select id="get" resultType="CmGclub">
-		SELECT
-		<include refid="cmGclubColumns"/>
-		FROM gclub a
-		<include refid="cmGclubJoins"/>
-		WHERE a.gclubID = #{id}
-	</select>
-
-	<select id="findList" resultType="CmGclub">
-		SELECT
-		<include refid="cmGclubColumns"/>
-		FROM gclub a
-		<include refid="cmGclubJoins"/>
-		<where>
-			<if test="gclubID != null and gclubID != ''">
-				AND a.gclubID = #{id}
-			</if>
-			<if test="userID != null and userID != ''">
-				AND a.userID = #{userID}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-
-	<select id="findAllList" resultType="CmGclub">
-		SELECT
-		<include refid="cmGclubColumns"/>
-		FROM gclub a
-		<include refid="cmGclubJoins"/>
-		<where>
-
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-
-	<insert id="insert" parameterType="CmGclub"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO gclub(
-		name,
-		contacts,
-		cellphone,
-		telphone,
-		post,
-		address,
-		scale,
-		empnum,
-		mainpro,
-		remark,
-		image,
-		regStatus,
-		addTime,
-		loginTime,
-		provinceID,
-		cityID,
-		townID,
-		agreement,
-		flag,
-		userID,
-		clubstatus,
-		BUSINESSLICENSEIMAGE,
-		LASTMODIFY,
-		inviterBindID,
-		inviterName,
-		headpic,
-		mainServiceProviderID,
-		scanTime,
-		checkTime,
-		spID
-		) VALUES (
-		#{name},
-		#{contacts},
-		#{cellphone},
-		#{telphone},
-		#{post},
-		#{address},
-		#{scale},
-		#{empnum},
-		#{mainpro},
-		#{remark},
-		#{image},
-		#{regStatus},
-		#{addTime},
-		#{loginTime},
-		#{provinceID},
-		#{cityID},
-		#{townID},
-		#{agreement},
-		#{flag},
-		#{userID},
-		#{clubstatus},
-		#{BUSINESSLICENSEIMAGE},
-		#{LASTMODIFY},
-		#{inviterBindID},
-		#{inviterName},
-		#{headpic},
-		#{mainServiceProviderID},
-		#{scanTime},
-		#{checkTime},
-		#{spID}
-		)
-	</insert>
-
-	<update id="update">
-		UPDATE gclub SET
-		name = #{name},
-		contacts = #{contacts},
-		cellphone = #{cellphone},
-		telphone = #{telphone},
-		post = #{post},
-		address = #{address},
-		scale = #{scale},
-		empnum = #{empnum},
-		mainpro = #{mainpro},
-		remark = #{remark},
-		image = #{image},
-		regStatus = #{regStatus},
-		addTime = #{addTime},
-		loginTime = #{loginTime},
-		provinceID = #{provinceID},
-		cityID = #{cityID},
-		townID = #{townID},
-		agreement = #{agreement},
-		flag = #{flag},
-		userID = #{userID},
-		clubstatus = #{clubstatus},
-		BUSINESSLICENSEIMAGE = #{BUSINESSLICENSEIMAGE},
-		LASTMODIFY = #{LASTMODIFY},
-		inviterBindID = #{inviterBindID},
-		inviterName = #{inviterName},
-		headpic = #{headpic},
-		mainServiceProviderID = #{mainServiceProviderID},
-		scanTime = #{scanTime},
-		checkTime = #{checkTime},
-		spID = #{spID}
-		WHERE gclubID = #{id}
-	</update>
-
-	<delete id="delete">
-		DELETE FROM gclub
-		WHERE gclubID = #{id}
-	</delete>
-
-	<update id="updateByUserId">
-		UPDATE gclub SET
-		regStatus = #{regStatus},
-		flag = #{flag},
-		LASTMODIFY = #{LASTMODIFY},
-		inviterBindID = #{inviterBindID},
-		inviterName = #{inviterName},
-		mainServiceProviderID = #{mainServiceProviderID},
-		spID = #{spID}
-		WHERE userID = #{userID}
-	</update>
-
-</mapper>

+ 110 - 117
src/main/resources/mappings/modules/weisha/CmMallOrganizeMapper.xml

@@ -2,8 +2,8 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.modules.weisha.dao.CmMallOrganizeDao">
 <mapper namespace="com.caimei.modules.weisha.dao.CmMallOrganizeDao">
 
 
-	<sql id="cmMallOrganizeColumns">
-		a.id AS "id",
+    <sql id="cmMallOrganizeColumns">
+        a.id AS "id",
 		a.organizeName AS "organizeName",
 		a.organizeName AS "organizeName",
 		a.organizeLinkName AS "organizeLinkName",
 		a.organizeLinkName AS "organizeLinkName",
 		a.mobile AS "mobile",
 		a.mobile AS "mobile",
@@ -17,129 +17,122 @@
 		a.updateTime AS "updateTime",
 		a.updateTime AS "updateTime",
 		a.addTime AS "addTime",
 		a.addTime AS "addTime",
 		a.delFlag AS "delFlag"
 		a.delFlag AS "delFlag"
-	</sql>
+    </sql>
 
 
-	<sql id="cmMallOrganizeJoins">
-	</sql>
 
 
-	<select id="get" resultType="CmMallOrganize">
-		SELECT
-			<include refid="cmMallOrganizeColumns"/>
-		FROM cm_mall_organize a
-		<include refid="cmMallOrganizeJoins"/>
-		WHERE a.id = #{id}
-	</select>
+    <select id="get" resultType="CmMallOrganize">
+        SELECT
+        <include refid="cmMallOrganizeColumns"/>
+        FROM cm_mall_organize a
+        WHERE a.id = #{id}
+    </select>
 
 
-	<select id="findList" resultType="CmMallOrganize">
-		SELECT
-			<include refid="cmMallOrganizeColumns"/>
-		FROM cm_mall_organize a
-		<include refid="cmMallOrganizeJoins"/>
-		<where>
-			id > 3
-			<if test="organizeName != null and organizeName != ''">
-				AND a.organizeName LIKE concat('%',#{organizeName},'%')
-			</if>
-			<if test="organizeLinkName != null and organizeLinkName != ''">
-				AND a.organizeLinkName = #{organizeLinkName}
-			</if>
-			<if test="mobile != null and mobile != ''">
-				AND a.mobile = #{mobile}
-			</if>
-			<if test="status != null and status != ''">
-				AND a.status = #{status}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.addTime DESC
-			</otherwise>
-		</choose>
-	</select>
+    <select id="findList" resultType="CmMallOrganize">
+        SELECT
+        <include refid="cmMallOrganizeColumns"/>
+        FROM cm_mall_organize a
+        <where>
+            id > 3
+            <if test="organizeName != null and organizeName != ''">
+                AND a.organizeName LIKE concat('%',#{organizeName},'%')
+            </if>
+            <if test="organizeLinkName != null and organizeLinkName != ''">
+                AND a.organizeLinkName = #{organizeLinkName}
+            </if>
+            <if test="mobile != null and mobile != ''">
+                AND a.mobile = #{mobile}
+            </if>
+            <if test="status != null and status != ''">
+                AND a.status = #{status}
+            </if>
+        </where>
+        <choose>
+            <when test="page !=null and page.orderBy != null and page.orderBy != ''">
+                ORDER BY ${page.orderBy}
+            </when>
+            <otherwise>
+                ORDER BY a.addTime DESC
+            </otherwise>
+        </choose>
+    </select>
 
 
-	<select id="findAllList" resultType="CmMallOrganize">
-		SELECT
-			<include refid="cmMallOrganizeColumns"/>
-		FROM cm_mall_organize a
-		<include refid="cmMallOrganizeJoins"/>
-		<where>
+    <select id="findAllList" resultType="CmMallOrganize">
+        SELECT
+        <include refid="cmMallOrganizeColumns"/>
+        FROM cm_mall_organize a
+        <where>
 
 
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
+        </where>
+        <choose>
+            <when test="page !=null and page.orderBy != null and page.orderBy != ''">
+                ORDER BY ${page.orderBy}
+            </when>
+            <otherwise>
+            </otherwise>
+        </choose>
+    </select>
 
 
-	<insert id="insert" parameterType="CmMallOrganize"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cm_mall_organize(
-			organizeName,
-			organizeLinkName,
-			mobile,
-			status,
-			contactNumber,
-			systemName,
-			systemImage,
-			introduction,
-			afterSale,
-			shoppingNotes,
-			updateTime,
-			addTime,
-			delFlag
-		) VALUES (
-			#{organizeName},
-			#{organizeLinkName},
-			#{mobile},
-			#{status},
-			#{contactNumber},
-			#{systemName},
-			#{systemImage},
-			#{introduction},
-			#{afterSale},
-			#{shoppingNotes},
-			NOW(),
-			NOW(),
-			0
-		)
-	</insert>
+    <insert id="insert" parameterType="CmMallOrganize" keyProperty="id" useGeneratedKeys="true">
+        INSERT INTO cm_mall_organize
+        (organizeName,
+         organizeLinkName,
+         mobile,
+         status,
+         contactNumber,
+         systemName,
+         systemImage,
+         introduction,
+         afterSale,
+         shoppingNotes,
+         updateTime,
+         addTime,
+         delFlag)
+        VALUES (#{organizeName},
+                #{organizeLinkName},
+                #{mobile},
+                #{status},
+                #{contactNumber},
+                #{systemName},
+                #{systemImage},
+                #{introduction},
+                #{afterSale},
+                #{shoppingNotes},
+                NOW(),
+                NOW(),
+                0)
+    </insert>
 
 
-	<update id="update">
-		UPDATE cm_mall_organize SET
-			organizeName = #{organizeName},
-			organizeLinkName = #{organizeLinkName},
-			mobile = #{mobile},
-			status = #{status},
-			contactNumber = #{contactNumber},
-			systemName = #{systemName},
-			systemImage = #{systemImage},
-			introduction = #{introduction},
-			afterSale = #{afterSale},
-			shoppingNotes = #{shoppingNotes},
-			updateTime = NOW()
-		WHERE id = #{id}
-	</update>
+    <update id="update">
+        UPDATE cm_mall_organize
+        SET organizeName     = #{organizeName},
+            organizeLinkName = #{organizeLinkName},
+            mobile           = #{mobile},
+            status           = #{status},
+            contactNumber    = #{contactNumber},
+            systemName       = #{systemName},
+            systemImage      = #{systemImage},
+            introduction     = #{introduction},
+            afterSale        = #{afterSale},
+            shoppingNotes    = #{shoppingNotes},
+            updateTime       = NOW()
+        WHERE id = #{id}
+    </update>
 
 
-	<update id="updateByStatus">
-		UPDATE cm_mall_organize SET
-			status = #{status},
-			updateTime = NOW()
-		WHERE id = #{organizeId}
-	</update>
+    <update id="updateByStatus">
+        UPDATE cm_mall_organize
+        SET status     = #{status},
+            updateTime = NOW()
+        WHERE id = #{organizeId}
+    </update>
 
 
-	<select id="findOrganizeMobileOnly" resultType="com.caimei.modules.weisha.entity.CmMallOrganize">
-		SELECT
-		<include refid="cmMallOrganizeColumns"/>
-		FROM cm_mall_organize a
-		WHERE a.mobile = #{mobile} AND a.delFlag = 0
-		<if test="id != null">
-			AND a.id != #{id}
-		</if>
-	</select>
+    <select id="findOrganizeMobileOnly" resultType="com.caimei.modules.weisha.entity.CmMallOrganize">
+        SELECT
+        <include refid="cmMallOrganizeColumns"/>
+        FROM cm_mall_organize a
+        WHERE a.mobile = #{mobile} AND a.delFlag = 0
+        <if test="id != null">
+            AND a.id != #{id}
+        </if>
+    </select>
 
 
 </mapper>
 </mapper>

+ 23 - 14
src/main/resources/mappings/modules/weisha/CmMallUserMapper.xml

@@ -3,8 +3,11 @@
 <mapper namespace="com.caimei.modules.weisha.dao.CmMallUserDao">
 <mapper namespace="com.caimei.modules.weisha.dao.CmMallUserDao">
 
 
     <select id="get" resultType="com.caimei.modules.weisha.entity.CmMallOrganize">
     <select id="get" resultType="com.caimei.modules.weisha.entity.CmMallOrganize">
-        select * from cm_mall_organize where id = #{id}
+        select *
+        from cm_mall_organize
+        where id = #{id}
     </select>
     </select>
+
     <select id="getMallUser" resultType="com.caimei.modules.weisha.entity.CmMallUser">
     <select id="getMallUser" resultType="com.caimei.modules.weisha.entity.CmMallUser">
         SELECT
         SELECT
         id,
         id,
@@ -35,35 +38,41 @@
             </if>
             </if>
         </where>
         </where>
     </select>
     </select>
+
     <update id="updateproduct">
     <update id="updateproduct">
         update cm_mall_admin_user
         update cm_mall_admin_user
         set status = #{validFlag}
         set status = #{validFlag}
         where id = #{id}
         where id = #{id}
     </update>
     </update>
+
     <select id="getMallUserById" resultType="com.caimei.modules.weisha.entity.CmMallUser">
     <select id="getMallUserById" resultType="com.caimei.modules.weisha.entity.CmMallUser">
-        SELECT
-            id,
-            organizeID,
-            account,
-            accountName,
-            password,
-            salt,
-            addTime,
-            updateTime
+        SELECT id,
+               organizeID,
+               account,
+               accountName,
+               password,
+               salt,
+               addTime,
+               updateTime
         FROM cm_mall_admin_user
         FROM cm_mall_admin_user
         where id = #{id}
         where id = #{id}
     </select>
     </select>
+
     <select id="getRepeat" resultType="java.lang.Integer">
     <select id="getRepeat" resultType="java.lang.Integer">
         select id from cm_mall_admin_user where account =#{account}
         select id from cm_mall_admin_user where account =#{account}
         <if test="id != null and id != ''">
         <if test="id != null and id != ''">
-         and  id != #{id}
+            and id != #{id}
         </if>
         </if>
-                                                limit 1
+        limit 1
     </select>
     </select>
+
     <insert id="insertMallUser">
     <insert id="insertMallUser">
-        INSERT INTO cm_mall_admin_user(account, accountName, PASSWORD, salt, organizeID, status, personnelType, ADDTIME, updateTime, delFlag)
-        VALUES(#{account}, #{accountName}, #{password}, #{salt}, #{organizeId}, #{status}, #{personnelType}, #{addTime}, #{updateTime}, #{delFlag})
+        INSERT INTO cm_mall_admin_user(account, accountName, PASSWORD, salt, organizeID, status, personnelType, ADDTIME,
+                                       updateTime, delFlag)
+        VALUES (#{account}, #{accountName}, #{password}, #{salt}, #{organizeId}, #{status}, #{personnelType},
+                #{addTime}, #{updateTime}, #{delFlag})
     </insert>
     </insert>
+
     <update id="updateMallUser">
     <update id="updateMallUser">
         update cm_mall_admin_user
         update cm_mall_admin_user
         <set>
         <set>

+ 0 - 139
src/main/resources/mappings/modules/weisha/CmOrganizeBuyerMapper.xml

@@ -1,139 +0,0 @@
-<?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="com.caimei.modules.weisha.dao.CmOrganizeBuyerDao">
-    
-	<sql id="cmOrganizeBuyerColumns">
-		a.id AS "id",
-		a.organizeId AS "organizeId",
-		a.name AS "name",
-		a.mobile AS "mobile",
-		a.invitationCode AS "invitationCode",
-		a.status AS "status",
-		a.nickName AS "nickName",
-		a.openid AS "openid",
-		a.addTime AS "addTime",
-		a.invitationCodeTime AS "invitationCodeTime",
-		a.bindTime AS "bindTime",
-		a.updateTime AS "updateTime",
-		a.delFlag AS "delFlag"
-	</sql>
-	
-	<sql id="cmOrganizeBuyerJoins">
-	</sql>
-    
-	<select id="get" resultType="CmOrganizeBuyer">
-		SELECT 
-			<include refid="cmOrganizeBuyerColumns"/>
-		FROM cm_organize_buyer a
-		<include refid="cmOrganizeBuyerJoins"/>
-		WHERE a.id = #{id}
-	</select>
-	
-	<select id="findList" resultType="CmOrganizeBuyer">
-		SELECT 
-			<include refid="cmOrganizeBuyerColumns"/>
-		FROM cm_organize_buyer a
-		<where>
-			a.delFlag = 0
-			AND a.organizeId = #{organizeId}
-			<if test="name != null and name != ''">
-				AND a.name LIKE 
-					<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
-					<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
-			</if>
-			<if test="mobile != null and mobile != ''">
-				AND a.mobile = #{mobile}
-			</if>
-			<if test="status != null and status != ''">
-				AND a.status = #{status}
-			</if>
-			<if test="startTime != null">
-				AND a.addTime <![CDATA[ > ]]> #{startTime}
-			</if>
-			<if test="endTime != null">
-				AND a.addTime <![CDATA[ < ]]> #{endTime}
-			</if>
-			<if test="invitationCode != null and invitationCode != ''">
-				AND a.invitationCode = #{invitationCode}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				ORDER BY a.addTime DESC
-			</otherwise>
-		</choose>
-	</select>
-	
-	<select id="findAllList" resultType="CmOrganizeBuyer">
-		SELECT 
-			<include refid="cmOrganizeBuyerColumns"/>
-		FROM cm_organize_buyer a
-		<include refid="cmOrganizeBuyerJoins"/>
-		<where>
-			
-		</where>		
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	
-	<insert id="insert" parameterType="CmOrganizeBuyer"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cm_organize_buyer(
-			organizeId,
-			name,
-			mobile,
-			invitationCode,
-			status,
-			nickName,
-			openid,
-			addTime,
-			invitationCodeTime,
-			bindTime,
-			updateTime,
-			delFlag
-		) VALUES (
-			#{organizeId},
-			#{name},
-			#{mobile},
-			#{invitationCode},
-			#{status},
-			#{nickName},
-			#{openid},
-			#{addTime},
-			#{invitationCodeTime},
-			#{bindTime},
-			#{updateTime},
-			#{delFlag}
-		)
-	</insert>
-	
-	<update id="update">
-		UPDATE cm_organize_buyer SET
-			name = #{name},
-			mobile = #{mobile},
-			invitationCode = #{invitationCode},
-			status = #{status},
-			nickName = #{nickName},
-			openid = #{openid},
-			invitationCodeTime = #{invitationCodeTime},
-			bindTime = #{bindTime},
-			updateTime = #{updateTime},
-			delFlag = #{delFlag}
-		WHERE id = #{id}
-	</update>
-
-	<select id="findByMobile" resultType="com.caimei.modules.weisha.entity.CmOrganizeBuyer">
-		SELECT
-			<include refid="cmOrganizeBuyerColumns"/>
-		FROM cm_organize_buyer a
-		WHERE a.mobile = #{mobile} AND delFlag = 0
-	</select>
-	
-</mapper>

+ 247 - 361
src/main/resources/mappings/modules/weisha/CmOrganizeProductMapper.xml

@@ -2,8 +2,8 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.modules.weisha.dao.CmOrganizeProductDao">
 <mapper namespace="com.caimei.modules.weisha.dao.CmOrganizeProductDao">
 
 
-	<sql id="cmOrganizeProductColumns">
-		a.id AS "id",
+    <sql id="cmOrganizeProductColumns">
+        a.id AS "id",
 		a.organizeId AS "organizeId",
 		a.organizeId AS "organizeId",
 		a.productId AS "productId",
 		a.productId AS "productId",
 		a.ladderPriceFlag AS "ladderPriceFlag",
 		a.ladderPriceFlag AS "ladderPriceFlag",
@@ -21,375 +21,261 @@
 		a.delFlag AS "delFlag",
 		a.delFlag AS "delFlag",
 		p.name AS "productName",
 		p.name AS "productName",
 		p.mainImage AS "productImage",
 		p.mainImage AS "productImage",
-# 		p.unit,
 		s.name AS "shopName"
 		s.name AS "shopName"
-	</sql>
+    </sql>
 
 
-	<sql id="cmOrganizeProductJoins">
-		left join product p on a.productId = p.productID
+    <sql id="cmOrganizeProductJoins">
+        left join product p on a.productId = p.productID
 		left join shop s on p.shopID = s.shopID
 		left join shop s on p.shopID = s.shopID
-	</sql>
+    </sql>
 
 
-	<select id="get" resultType="CmOrganizeProduct">
-		SELECT
-			<include refid="cmOrganizeProductColumns"/>
-		FROM cm_organize_product a
-		<include refid="cmOrganizeProductJoins"/>
-		WHERE a.id = #{id}
-	</select>
+    <select id="getOrganizeProductList" resultType="com.caimei.modules.weisha.entity.CmOrganizeProduct">
+        SELECT
+        cmop.id,
+        cmop.productID,
+        p.name as productName,
+        p.mainImage as productImage,
+        s.name as shopName,
+        cmop.validFlag as status,
+        p.includedTax,
+        p.invoiceType,
+        cmop.addTime,
+        cmps.minBuyNumber
+        FROM cm_mall_organize_products cmop
+        LEFT JOIN product p ON p.productId = cmop.productId
+        LEFT JOIN shop s ON s.shopID = p.shopID
+        LEFT JOIN cm_mall_product_sku cmps ON cmop.productID=cmps.productId
+        <where>
+            cmop.delFlag = 0
+            <if test="productId != null and productId != ''">
+                AND cmop.productId = #{productId}
+            </if>
+            <if test="productName != null and productName != ''">
+                and p.name like concat('%',#{productName},'%')
+            </if>
+            <if test="shopName != null and shopName != ''">
+                and s.name like concat('%',#{shopName},'%')
+            </if>
+            <if test="includedTax != null">
+                AND p.includedTax = #{includedTax}
+            </if>
+            <if test="status != null and status != ''">
+                AND cmop.validFlag = #{status}
+            </if>
+            <if test="invoiceType != null">
+                AND p.invoiceType = #{invoiceType}
+            </if>
+            <if test="organizeId != null">
+                AND cmop.organizeID = #{organizeId}
+            </if>
+        </where>
+        GROUP BY cmop.id
+        order by cmop.addTime desc
+    </select>
 
 
-	<select id="findList" resultType="CmOrganizeProduct">
-		SELECT
-			<include refid="cmOrganizeProductColumns"/>
-		FROM cm_organize_product a
-		<include refid="cmOrganizeProductJoins"/>
-		<where>
-			a.delFlag = 0
-			and p.productCategory = 1
-			<if test="id != null and id != ''">
-				AND a.id = #{id}
-			</if>
-			<if test="productName != null and productName != ''">
-				and p.name like concat('%',#{productName},'%')
-			</if>
-			<if test="shopName != null and shopName != ''">
-				and s.name like concat('%',#{shopName},'%')
-			</if>
-			<if test="includedTax != null">
-				AND a.includedTax = #{includedTax}
-			</if>
-			<if test="invoiceType != null">
-				AND a.invoiceType = #{invoiceType}
-			</if>
-			<if test="status != null">
-				AND a.status = #{status}
-			</if>
-			<if test="organizeId != null">
-				AND a.organizeId = #{organizeId}
-			</if>
-		</where>
-		order by a.addTime desc
-	</select>
+    <select id="getOrganizeSku" resultType="com.caimei.modules.weisha.entity.CmOrganizeSku">
+        SELECT
+        cmps.id,
+        cmps.productId,
+        cmps.id,
+        cmps.skuId,
+        cmps.minBuyNumber,
+        cmps.price,
+        cs.unit,
+        cs.price as clubPrice,
+        cs.costCheckFlag as costCheckFlag,
+        cs.costPrice as costPrice,
+        cs.costProportional as costProportional,
+        cs.minBuyNumber AS cmMinBuyNumber,
+        cmps.organizePercent,
+        cmps.shopPercent,
+        cmps.cmPercent
+        FROM cm_mall_product_sku cmps
+        LEFT JOIN cm_sku cs ON cmps.skuId = cs.skuId
+        <where>
+            <if test="productIds.size() > 0">
+                cmps.productId in
+                <foreach collection="productIds" item="productId" open="(" separator="," close=")">
+                    #{productId}
+                </foreach>
+            </if>
+        </where>
+    </select>
 
 
-	<select id="findAllList" resultType="CmOrganizeProduct">
-		SELECT
-			<include refid="cmOrganizeProductColumns"/>
-		FROM cm_organize_product a
-		<include refid="cmOrganizeProductJoins"/>
-		<where>
+    <update id="updateproduct">
+        update cm_mall_organize_products
+        set validFlag = #{validFlag}
+        where id = #{id}
+    </update>
 
 
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-			</otherwise>
-		</choose>
-	</select>
-	<select id="getOrganizeProductList" resultType="com.caimei.modules.weisha.entity.CmOrganizeProduct">
-		SELECT
-			cmop.id,
-			cmop.productID,
-			p.name as productName,
-			p.mainImage as productImage,
-			s.name as shopName,
-			cmop.validFlag as status,
-			p.includedTax,
-			p.invoiceType,
-			cmop.addTime,
-		    cmps.minBuyNumber
-		FROM cm_mall_organize_products cmop
-				 LEFT JOIN product p ON p.productId = cmop.productId
-				 LEFT JOIN shop s ON s.shopID = p.shopID
-				 LEFT JOIN cm_mall_product_sku cmps ON  cmop.productID=cmps.productId
-		<where>
-			cmop.delFlag = 0
-			<if test="productId != null and productId != ''">
-				AND cmop.productId = #{productId}
-			</if>
-			<if test="productName != null and productName != ''">
-				and p.name like concat('%',#{productName},'%')
-			</if>
-			<if test="shopName != null and shopName != ''">
-				and s.name like concat('%',#{shopName},'%')
-			</if>
-			<if test="includedTax != null">
-				AND p.includedTax = #{includedTax}
-			</if>
-			<if test="status != null and status != ''">
-				AND cmop.validFlag = #{status}
-			</if>
-			<if test="invoiceType != null">
-				AND p.invoiceType = #{invoiceType}
-			</if>
-			<if test="organizeId != null">
-				AND cmop.organizeID = #{organizeId}
-			</if>
-		</where>
-		GROUP BY cmop.id
-		order by cmop.addTime desc
-	</select>
-	<select id="getOrganizeSku" resultType="com.caimei.modules.weisha.entity.CmOrganizeSku">
-		SELECT
-		    cmps.id,
-			cmps.productId,
-			cmps.id,
-			cmps.skuId,
-			cmps.minBuyNumber,
-			cmps.price,
-			cs.unit,
-			cs.price as clubPrice,
-			cs.costCheckFlag as costCheckFlag,
-			cs.costPrice as costPrice,
-			cs.costProportional as costProportional,
-			cs.minBuyNumber AS cmMinBuyNumber,
-		   cmps.organizePercent,
-		   cmps.shopPercent,
-		   cmps.cmPercent
-		FROM cm_mall_product_sku cmps
-				 LEFT JOIN cm_sku cs ON cmps.skuId = cs.skuId
-		<where>
-			<if test="productIds.size() > 0">
-				cmps.productId in
-				<foreach collection="productIds" item="productId" open="(" separator="," close=")">
-					#{productId}
-				</foreach>
-			</if>
-		</where>
-	</select>
-	<update id="updateproduct">
-		update cm_mall_organize_products
-		set validFlag = #{validFlag}
-		where id = #{id}
-	</update>
-	<select id="findProductList" resultType="com.caimei.modules.product.entity.Product">
-		select p.productID, p.mainImage, p.name,
-		       s.name as shopName, IF(cmop.productId is not null, 0, 1) as validFlag,k.price
-		from product p
-			 left join cm_mall_organize_products cmop on p.productID = cmop.productId and cmop.organizeId = #{organizeId} and cmop.delFlag = 0
-			 left join shop s on p.shopID = s.shopID
-		 	 left join cm_sku k on p.productID = k.productId
-		<where>
-			p.productCategory = 1  AND p.validFlag not in ( 0,1,8 )  and s.shopType != 2  and  cmop.productId is null
-			AND p.shopID not in (SELECT s.`value` FROM `sys_dict` s WHERE s.type='heheShopID')
-			AND p.productID NOT IN (6060, 6061, 6062, 6063, 6064,6065, 6066, 6067, 6068, 6069)
-			<if test="productID != null">
-				AND p.productID = #{productID}
-			</if>
-			<if test="name != null and name != ''">
-				AND p.name LIKE concat('%',#{name},'%')
-			</if>
-			<if test="shopName != null and shopName != ''">
-				AND s.name LIKE concat('%',#{shopName},'%')
-			</if>
-		</where>
-		GROUP BY p.productID
-		order by price asc
-	</select>
-	<select id="findProductByProductId" resultType="com.caimei.modules.weisha.entity.CmOrganizeProduct">
-		select productID as productId, # ladderPriceFlag, price as price,
-		 	   ifnull(includedTax,2) as includedTax,invoiceType,taxPoint as clubTaxPoint,supplierTaxPoint as shopTaxPoint # minBuyNumber,
-		       # costCheckFlag as costType,
-		       # costPrice,costProportional
-		from product
-		where productID = #{productId}
-	</select>
-	<select id="findLadderPrice" resultType="com.caimei.modules.weisha.entity.OrganizeProductLadderPrice">
-		select * from organize_product_ladder_price where productId = #{productId}
-	</select>
-	<select id="findFormerLadderPriceList"
-			resultType="com.caimei.modules.weisha.entity.OrganizeProductLadderPrice">
-		select ladderNum,buyNum,buyPrice from product_ladder_price where productId = #{productId}
-	</select>
-	<select id="getOrganizeInfo" resultType="com.caimei.modules.weisha.entity.CmMallOrganize">
-		select a.id AS "id",
-			   a.organizeName AS "organizeName",
-			   a.organizeLinkName AS "organizeLinkName",
-			   a.mobile AS "mobile",
-			   a.status AS "status",
-			   a.contactNumber AS "contactNumber",
-			   a.systemName AS "systemName",
-			   a.systemImage AS "systemImage",
-			   a.introduction AS "introduction",
-			   a.afterSale AS "afterSale",
-			   a.shoppingNotes AS "shoppingNotes",
-			   a.updateTime AS "updateTime",
-			   a.addTime AS "addTime",
-			   a.delFlag AS "delFlag"
-			   from cm_mall_organize a
-			where a.id = #{id}
-	</select>
-	<select id="getShopInfo" resultType="com.caimei.modules.weisha.entity.CmOrganizeProduct">
-		SELECT
-			p.productId,
-			p.name AS productName,
-			s.name AS shopName
-		FROM product p
-		LEFT JOIN shop s ON p.shopId = s.shopId
-		<where>
-			<if test="productIds.size()>0">
-				productId in
-				<foreach collection="productIds" item="productId" open="(" separator="," close=")">
-					#{productId}
-				</foreach>
-			</if>
-		</where>
-	</select>
-	<select id="getSkuInfo" resultType="com.caimei.modules.product.entity.CmSku">
-		SELECT
-			skuId,
-			productId,
-			normalPrice,
-			price,
-			costPrice,
-			ladderPriceFlag,
-			minBuyNumber
-		FROM cm_sku
-		where productId = #{productId}
-		order by normalPrice
-	</select>
-	<insert id="insertMallProduct" parameterType="CmOrganizeProduct"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO  cm_mall_organize_products (organizeID, productID, normalPrice, costPrice, ladderPriceFlag, retailPrice, minBuyNumber, validFlag, ADDTIME, updateTime, delFlag)
-		VALUES(#{organizeId}, #{productId}, #{normalPrice}, #{costPrice}, #{ladderPriceFlag}, #{retailPrice}, #{minBuyNumber}, #{status},#{addTime}, #{updateTime}, #{delFlag})
-	</insert>
-	<insert id="insertMallSku">
-		INSERT INTO cm_mall_product_sku(skuId, productId, mallProductId, minBuyNumber, price)
-		VALUES (#{skuId}, #{productId}, #{mallProductId}, #{minBuyNumber}, #{price})
-	</insert>
-	<update id="updateMallProduct">
-		update cm_mall_organize_products
-		<set>
-			<if test="retailPrice != null and retailPrice != ''">
-				retailPrice = #{retailPrice},
-			</if>
-			<if test="minBuyNumber != null and minBuyNumber != ''">
-				minBuyNumber = #{minBuyNumber}
-			</if>
-		</set>
-		where id =#{id}
-	</update>
-	<update id="updateMallProductSku">
-		update cm_mall_product_sku
-		<set>
-			<if test="price != null and price != ''">
-				price = #{price},
-			</if>
-			<if test="minBuyNumber != null and minBuyNumber != ''">
-				minBuyNumber = #{minBuyNumber},
-			</if>
-			<if test="organizePercent != null and organizePercent != ''">
-				organizePercent = #{organizePercent},
-			</if>
-			<if test="shopPercent != null and shopPercent != ''">
-				shopPercent = #{shopPercent},
-			</if>
-			<if test="cmPercent != null and cmPercent != ''">
-				cmPercent = #{cmPercent}
-			</if>
-		</set>
-		where id =#{id}
-	</update>
-	<select id="getProductInfo" resultType="com.caimei.modules.weisha.entity.CmOrganizeProduct">
-		SELECT cmop.id,
-		       cmop.organizeID AS organizeId,
-			   p.productID AS productId,
-			   p.mainImage AS productImage,
-			   p.name AS productName,
-			   s.name AS shopName,
-			   IF(cmop.productId IS NOT NULL, 0, 1) AS validFlag,
-			   p.includedTax,
-			   p.invoiceType,
-			   p.taxPoint,
-			   p.supplierTaxPoint
-		FROM product p
-				 LEFT JOIN cm_mall_organize_products cmop ON p.productID = cmop.productId
-				 LEFT JOIN shop s ON p.shopID = s.shopID
-		WHERE p.productCategory = 1  AND cmop.id = #{id}
-	</select>
-	<update id="deleteProduct">
-		update cm_mall_organize_products
-		set delFlag = 1
-		where id = #{id}
-	</update>
-	<insert id="insert" parameterType="CmOrganizeProduct"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cm_organize_product(
-			organizeId,
-			productId,
-			ladderPriceFlag,
-			price,
-			includedTax,
-			invoiceType,
-			clubTaxPoint,
-			shopTaxPoint,
-			minBuyNumber,
-			costType,
-			costPrice,
-			costProportional,
-			addTime
-		) VALUES (
-			#{organizeId},
-			#{productId},
-			#{ladderPriceFlag},
-			#{price},
-			#{includedTax},
-			#{invoiceType},
-		    #{clubTaxPoint},
-		    #{shopTaxPoint},
-			#{minBuyNumber},
-			#{costType},
-			#{costPrice},
-			#{costProportional},
-			#{addTime}
-		)
-	</insert>
-	<insert id="insertLadderPrice">
-		insert into organize_product_ladder_price(
-		    productId, ladderNum, buyNum, buyPrice
-		) values (#{productId},#{ladderNum},#{buyNum},#{buyPrice})
+    <select id="findProductList" resultType="com.caimei.modules.product.entity.Product">
+        select p.productID, p.mainImage, p.name,
+        s.name as shopName, IF(cmop.productId is not null, 0, 1) as validFlag,k.price
+        from product p
+        left join cm_mall_organize_products cmop on p.productID = cmop.productId and cmop.organizeId = #{organizeId} and cmop.delFlag = 0
+        left join shop s on p.shopID = s.shopID
+        left join cm_sku k on p.productID = k.productId
+        <where>
+            p.productCategory = 1 AND p.validFlag not in ( 0,1,8 ) and s.shopType != 2 and cmop.productId is null
+            AND p.shopID not in (SELECT s.`value` FROM `sys_dict` s WHERE s.type='heheShopID')
+            AND p.productID NOT IN (6060, 6061, 6062, 6063, 6064,6065, 6066, 6067, 6068, 6069)
+            <if test="productID != null">
+                AND p.productID = #{productID}
+            </if>
+            <if test="name != null and name != ''">
+                AND p.name LIKE concat('%',#{name},'%')
+            </if>
+            <if test="shopName != null and shopName != ''">
+                AND s.name LIKE concat('%',#{shopName},'%')
+            </if>
+        </where>
+        GROUP BY p.productID
+        order by price asc
+    </select>
 
 
-	</insert>
+    <select id="findProductByProductId" resultType="com.caimei.modules.weisha.entity.CmOrganizeProduct">
+        select productID              as productId,
+               ifnull(includedTax, 2) as includedTax,
+               invoiceType,
+               taxPoint               as clubTaxPoint,
+               supplierTaxPoint       as shopTaxPoint
+        from product
+        where productID = #{productId}
+    </select>
 
 
-	<update id="update">
-		UPDATE cm_organize_product SET
-			ladderPriceFlag = #{ladderPriceFlag},
-			price = #{price},
-			includedTax = #{includedTax},
-			invoiceType = #{invoiceType},
-		    clubTaxPoint = #{clubTaxPoint},
-		    shopTaxPoint = #{shopTaxPoint},
-			minBuyNumber = #{minBuyNumber},
-			costType = #{costType},
-			costPrice = #{costPrice},
-			costProportional = #{costProportional},
-			status = #{status},
-			addTime = #{addTime},
-			delFlag = #{delFlag}
-		WHERE id = #{id}
-	</update>
+    <select id="findFormerLadderPriceList"
+            resultType="com.caimei.modules.weisha.entity.OrganizeProductLadderPrice">
+        select ladderNum, buyNum, buyPrice
+        from product_ladder_price
+        where productId = #{productId}
+    </select>
 
 
-	<update id="updateStatus">
-		UPDATE cm_organize_product SET
-			status = #{status}
-		WHERE id = #{id}
-	</update>
-	<update id="updateLadderPrice">
-		update organize_product_ladder_price
-		set productId = #{productId},ladderNum = #{ladderNum},buyNum=#{buyNum},buyPrice=#{buyPrice}
-		where id = #{id}
-	</update>
-	<update id="updateLadderPriceFlag">
-		update cm_organize_product set ladderPriceFlag = #{ladderPriceFlag} where id = #{productId}
-	</update>
+    <select id="getOrganizeInfo" resultType="com.caimei.modules.weisha.entity.CmMallOrganize">
+        select a.id               AS "id",
+               a.organizeName     AS "organizeName",
+               a.organizeLinkName AS "organizeLinkName",
+               a.mobile           AS "mobile",
+               a.status           AS "status",
+               a.contactNumber    AS "contactNumber",
+               a.systemName       AS "systemName",
+               a.systemImage      AS "systemImage",
+               a.introduction     AS "introduction",
+               a.afterSale        AS "afterSale",
+               a.shoppingNotes    AS "shoppingNotes",
+               a.updateTime       AS "updateTime",
+               a.addTime          AS "addTime",
+               a.delFlag          AS "delFlag"
+        from cm_mall_organize a
+        where a.id = #{id}
+    </select>
+
+    <select id="getShopInfo" resultType="com.caimei.modules.weisha.entity.CmOrganizeProduct">
+        SELECT
+        p.productId,
+        p.name AS productName,
+        s.name AS shopName
+        FROM product p
+        LEFT JOIN shop s ON p.shopId = s.shopId
+        <where>
+            <if test="productIds.size()>0">
+                productId in
+                <foreach collection="productIds" item="productId" open="(" separator="," close=")">
+                    #{productId}
+                </foreach>
+            </if>
+        </where>
+    </select>
+
+    <select id="getSkuInfo" resultType="com.caimei.modules.product.entity.CmSku">
+        SELECT skuId,
+               productId,
+               normalPrice,
+               price,
+               costPrice,
+               ladderPriceFlag,
+               minBuyNumber
+        FROM cm_sku
+        where productId = #{productId}
+        order by normalPrice
+    </select>
+
+    <insert id="insertMallProduct" parameterType="CmOrganizeProduct" keyProperty="id" useGeneratedKeys="true">
+        INSERT INTO cm_mall_organize_products (organizeID, productID, normalPrice, costPrice, ladderPriceFlag,
+                                               retailPrice, minBuyNumber, validFlag, ADDTIME, updateTime, delFlag)
+        VALUES (#{organizeId}, #{productId}, #{normalPrice}, #{costPrice}, #{ladderPriceFlag}, #{retailPrice},
+                #{minBuyNumber}, #{status}, #{addTime}, #{updateTime}, #{delFlag})
+    </insert>
+
+    <insert id="insertMallSku">
+        INSERT INTO cm_mall_product_sku(skuId, productId, mallProductId, minBuyNumber, price)
+        VALUES (#{skuId}, #{productId}, #{mallProductId}, #{minBuyNumber}, #{price})
+    </insert>
+
+    <update id="updateMallProduct">
+        update cm_mall_organize_products
+        <set>
+            <if test="retailPrice != null and retailPrice != ''">
+                retailPrice = #{retailPrice},
+            </if>
+            <if test="minBuyNumber != null and minBuyNumber != ''">
+                minBuyNumber = #{minBuyNumber}
+            </if>
+        </set>
+        where id =#{id}
+    </update>
+
+    <update id="updateMallProductSku">
+        update cm_mall_product_sku
+        <set>
+            <if test="price != null and price != ''">
+                price = #{price},
+            </if>
+            <if test="minBuyNumber != null and minBuyNumber != ''">
+                minBuyNumber = #{minBuyNumber},
+            </if>
+            <if test="organizePercent != null and organizePercent != ''">
+                organizePercent = #{organizePercent},
+            </if>
+            <if test="shopPercent != null and shopPercent != ''">
+                shopPercent = #{shopPercent},
+            </if>
+            <if test="cmPercent != null and cmPercent != ''">
+                cmPercent = #{cmPercent}
+            </if>
+        </set>
+        where id =#{id}
+    </update>
+
+    <select id="getProductInfo" resultType="com.caimei.modules.weisha.entity.CmOrganizeProduct">
+        SELECT cmop.id,
+               cmop.organizeID                      AS organizeId,
+               p.productID                          AS productId,
+               p.mainImage                          AS productImage,
+               p.name                               AS productName,
+               s.name                               AS shopName,
+               IF(cmop.productId IS NOT NULL, 0, 1) AS validFlag,
+               p.includedTax,
+               p.invoiceType,
+               p.taxPoint,
+               p.supplierTaxPoint
+        FROM product p
+                 LEFT JOIN cm_mall_organize_products cmop ON p.productID = cmop.productId
+                 LEFT JOIN shop s ON p.shopID = s.shopID
+        WHERE p.productCategory = 1
+          AND cmop.id = #{id}
+    </select>
+
+    <update id="deleteProduct">
+        update cm_mall_organize_products
+        set delFlag = 1
+        where id = #{id}
+    </update>
+
+    <delete id="deleteMallProductSku">
+        delete
+        from cm_mall_product_sku
+        where mallProductId = #{id}
+    </delete>
 
 
-	<delete id="delete">
-		UPDATE cm_organize_product set delFlag = 1 where id = #{id}
-	</delete>
-	<delete id="deleteMallProductSku">
-		delete from  cm_mall_product_sku where mallProductId = #{id}
-	</delete>
-	<delete id="deleteLadderPriceById">
-		delete from organize_product_ladder_price where id = #{ladderId}
-	</delete>
 
 
 </mapper>
 </mapper>

+ 0 - 442
src/main/resources/mappings/modules/weisha/CmOrganizePromotionMapper.xml

@@ -1,442 +0,0 @@
-<?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="com.caimei.modules.weisha.dao.CmOrganizePromotionDao">
-
-    <sql id="cmOrganizePromotionColumns">
-		cp.id AS "id",
-		cp.name AS "name",
-		cp.description AS "description",
-		cp.type AS "type",
-		cp.mode AS "mode",
-		cp.touchPrice AS "touchPrice",
-		cp.reducedPrice AS "reducedPrice",
-		cp.beginTime AS "beginTime",
-		cp.endTime AS "endTime",
-		cp.addTime AS "addTime",
-		cp.updateTime AS "updateTime",
-		cp.status AS "status",
-		cp.delFlag AS "delFlag1"
-	</sql>
-
-    <select id="get" resultType="CmOrganizePromotion">
-        SELECT
-        <include refid="cmOrganizePromotionColumns"/>
-        FROM cm_organize_promotions cp
-        WHERE cp.id = #{id}
-        and cp.delFlag != '2'
-    </select>
-
-    <select id="findList" resultType="CmOrganizePromotion">
-        SELECT
-        <include refid="cmOrganizePromotionColumns"/>
-        FROM cm_organize_promotions cp
-        LEFT JOIN cm_organize_promotions_product cpp ON cp.id = cpp.promotionsId
-        LEFT JOIN cm_organize_product cop ON cpp.productId = cop.id
-        LEFT JOIN product p ON cop.productId = p.productID
-        LEFT JOIN shop s ON p.shopID = s.shopID OR cpp.supplierId=s.shopID
-        <where>
-            cp.delFlag != 2
-            <if test="organizeId != null">
-                AND cp.organizeId = #{organizeId,jdbcType=INTEGER}
-            </if>
-            <if test="type != null and type != ''">
-                AND cp.type = #{type,jdbcType=INTEGER}
-            </if>
-            <if test="name != null and name != ''">
-                AND cp.name LIKE CONCAT('%',#{name,jdbcType=VARCHAR},'%')
-            </if>
-            <if test="description != null and description != ''">
-                AND cp.description LIKE CONCAT('%',#{description,jdbcType=VARCHAR},'%')
-            </if>
-            <if test="productName != null and productName != ''">
-                AND p.name LIKE CONCAT('%',#{productName,jdbcType=VARCHAR},'%')
-            </if>
-            <if test="shopName != null and shopName != ''">
-                AND s.name LIKE CONCAT('%',#{shopName,jdbcType=VARCHAR},'%')
-            </if>
-            <if test="mode != null and mode != ''">
-                AND cp.mode = #{mode,jdbcType=VARCHAR}
-            </if>
-            <if test="status != null and status != ''">
-                AND cp.status = #{status,jdbcType=VARCHAR}
-            </if>
-            <if test="delFlag1 != null and delFlag1 != ''">
-                <choose>
-                    <when test="delFlag1 == 1">
-                        AND NOW() <![CDATA[ < ]]> cp.beginTime
-                        AND cp.status != 1
-                        AND cp.delFlag != '1'
-                    </when>
-                    <when test="delFlag1 == 2">
-                        AND (NOW() between cp.beginTime AND cp.endTime
-                        OR cp.status = 1)
-                        AND cp.delFlag != '1'
-                    </when>
-                    <when test="delFlag1 == 3">
-                        AND NOW() <![CDATA[ > ]]> cp.endTime
-                        AND cp.status != 1
-                        AND cp.delFlag != '1'
-                    </when>
-                    <when test="delFlag1 == 0">
-                        AND cp.delFlag = '1'
-                    </when>
-                    <otherwise>
-                        AND cp.delFlag = null
-                    </otherwise>
-                </choose>
-            </if>
-        </where>
-        group by cp.id
-        <choose>
-            <when test="page !=null and page.orderBy != null and page.orderBy != ''">
-                ORDER BY ${page.orderBy,jdbcType=VARCHAR}
-            </when>
-            <otherwise>
-                ORDER BY cp.addTime DESC
-            </otherwise>
-        </choose>
-    </select>
-
-    <select id="findPromotionProduct" resultType="com.caimei.modules.product.entity.Product">
-        SELECT
-        cop.id as productID,p.mainImage,p.name,cop.price as price,
-        cp.reducedPrice AS "reducedPrice",
-        s.name AS "shopName"
-        FROM
-        cm_organize_promotions cp
-        LEFT JOIN cm_organize_promotions_product cpp ON cp.id = cpp.promotionsId
-        LEFT JOIN cm_organize_product cop ON cpp.productId = cop.id
-        LEFT JOIN product p ON cop.productId = p.productID
-        LEFT JOIN shop s ON s.shopID = p.shopID
-        WHERE
-            cp.id = #{id}
-        and p.productCategory = 1
-    </select>
-
-    <select id="findGiftProduct" resultType="com.caimei.modules.product.entity.Product">
-           SELECT
-                cop.id as productID,p.mainImage,p.name,cop.price as price,
-                cp.reducedPrice AS "reducedPrice",
-                s.name AS "shopName",
-                cpg.number AS "giftNumber"
-           FROM
-             cm_organize_promotions cp
-             LEFT JOIN cm_organize_promotions_gift cpg ON cp.id = cpg.promotionsId
-             LEFT JOIN cm_organize_product cop ON cpg.productId = cop.id
-             LEFT JOIN product p ON cop.productId = p.productID
-             LEFT JOIN shop s ON s.shopID = p.shopID
-           WHERE
-             cp.id = #{id}
-             and p.productCategory = 1
-    </select>
-
-    <select id="findGiftPurchaseProduct" resultType="com.caimei.modules.bulkpurchase.entity.PurchaseProduct">
-		SELECT p.name name,s.name shopName ,s.`shopID` shopId,p.name purchaseProductName,
-		cop.`price` price,cop.`productId` productId,p.productCode productNo,p.mainImage image
-		,cop.costType costCheckFlag,cop.costPrice costPrice,cop.costProportional costProportional, p.price0 AS normalPrice,
-        cpg.number AS num
-           FROM
-             cm_organize_promotions cp
-             LEFT JOIN cm_organize_promotions_gift cpg ON cp.id = cpg.promotionsId
-             LEFT JOIN cm_organize_product cop ON cpg.productId = cop.productId
-             LEFT JOIN product p ON cop.productId = p.productID
-             LEFT JOIN shop s ON s.shopID = p.shopID
-           WHERE
-             cp.id = #{id}
-             and p.productCategory = 1
-    </select>
-
-    <select id="findPromotionShops" resultType="com.caimei.modules.cibe.entity.Shop">
-        SELECT
-        s.*
-        FROM
-        cm_organize_promotions_product cpp
-        LEFT JOIN shop s ON cpp.supplierId = s.shopID
-        WHERE
-            cpp.promotionsId = #{id}
-    </select>
-
-    <select id="findAllProduct" resultType="com.caimei.modules.product.entity.Product">
-        SELECT
-        cop.id AS productID,cop.price AS price,
-        p.mainImage,p.name,
-        s.name AS "shopName"
-        FROM
-        cm_organize_product cop
-        LEFT JOIN product p ON cop.productId = p.productID
-        LEFT JOIN shop s ON s.shopID = p.shopID
-        <where>
-            cop.delFlag = 0
-            and cop.status = 1
-            and cop.organizeId = #{organizeId}
-            <if test="id != null and id != ''">
-                AND cop.id = #{id}
-            </if>
-            <if test="productID != null">
-                AND cop.productId = #{productID}
-            </if>
-            <if test="name != null and name != ''">
-                AND p.name LIKE concat('%',#{name},'%')
-            </if>
-            <if test="shopName != null and shopName != ''">
-                AND s.name LIKE concat('%',#{shopName},'%')
-            </if>
-            <if test="ids != null and ids.size > 0">
-                AND cop.id NOT IN
-                <foreach collection="ids" open="(" close=")" item="id" separator=",">
-                    #{id}
-                </foreach>
-            </if>
-            <if test="promotionType == 1 or promotionType == 2">
-                AND cop.id NOT IN
-                (SELECT cpp.productId
-                FROM cm_organize_promotions_product cpp
-                LEFT JOIN cm_organize_promotions cp on cpp.promotionsId = cp.id
-                <where>
-                    cp.type = #{promotionType}
-                    AND cp.delFlag != '2'
-                    AND cpp.productId != 0
-                    <if test="delIdList != null and delIdList.size > 0">
-                        AND cpp.productId NOT IN
-                        <foreach collection="delIdList" open="(" close=")" item="delId" separator=",">
-                            #{delId}
-                        </foreach>
-                    </if>
-                </where>
-                )
-            </if>
-        </where>
-    </select>
-
-    <select id="findAllShop" resultType="com.caimei.modules.cibe.entity.Shop">
-        SELECT
-        s.*
-        FROM
-        shop s
-        <where>
-            s.status = 90
-            AND s.shopID NOT IN
-            (SELECT supplierId
-            FROM cm_organize_promotions_product cpp
-            LEFT JOIN cm_organize_promotions cp on cpp.promotionsId = cp.id
-            <where>
-                supplierId != 0
-                AND cp.delFlag != '2'
-                <if test="delShopIdList!=null and delShopIdList.size > 0">
-                    AND cpp.supplierId NOT IN
-                    <foreach collection="delShopIdList" open="(" close=")" item="delShopId" separator=",">
-                        #{delShopId}
-                    </foreach>
-
-                </if>
-            </where>
-            )
-            <if test="shopID != null">
-                AND s.shopID = #{shopID}
-            </if>
-            <if test="name != null and name != ''">
-                AND s.name LIKE concat('%',#{name},'%')
-            </if>
-            <if test="sname != null and sname != ''">
-                AND s.sname LIKE concat('%',#{sname},'%')
-            </if>
-            <if test="ids != null and ids.size > 0">
-                AND s.shopID NOT IN
-                <foreach collection="ids" open="(" close=")" item="id" separator=",">
-                    #{id}
-                </foreach>
-            </if>
-        </where>
-    </select>
-
-    <delete id="deleteAllPromotionProductsAndShops">
-		DELETE FROM cm_organize_promotions_product
-		WHERE promotionsId = #{id}
-	</delete>
-
-    <delete id="deleteAllPromotionGifts">
-		DELETE FROM cm_organize_promotions_gift
-		WHERE promotionsId = #{id}
-	</delete>
-    <update id="deletePromotionByProductId">
-        update cm_organize_promotions set delFlag = '2' where id in (
-            select promotionsId from cm_organize_promotions_product
-            where productId = #{productId}) and delFlag != '2'
-    </update>
-
-    <insert id="insertPromotionProduct">
-		INSERT INTO cm_organize_promotions_product(
-			promotionsId,
-            productId,
-            addTime
-		) VALUES (
-			#{promotionId},
-			#{productId},
-			now()
-		)
-	</insert>
-
-    <insert id="insertGiftProduct">
-		INSERT INTO cm_organize_promotions_gift(
-			promotionsId,
-            productId,
-            number,
-            addTime
-		) VALUES (
-			#{promotionId},
-			#{giftId},
-			#{number},
-			now()
-		)
-	</insert>
-
-    <insert id="insertPromotionShop">
-		INSERT INTO cm_organize_promotions_product(
-			promotionsId,
-            supplierId,
-            productId,
-            addTime
-		) VALUES (
-			#{promotionId},
-			#{shopId},
-			0,
-			now()
-		)
-	</insert>
-
-    <insert id="insert" parameterType="CmOrganizePromotion" keyProperty="id" useGeneratedKeys="true">
-        INSERT INTO cm_organize_promotions(
-            organizeId,
-            name,
-            description,
-            type,
-            mode,
-            touchPrice,
-            reducedPrice,
-            beginTime,
-            endTime,
-            addTime,
-            updateTime,
-            status,
-            delFlag
-        ) VALUES (
-            #{organizeId},
-            #{name},
-            #{description},
-            #{type},
-            #{mode},
-            #{touchPrice},
-            #{reducedPrice},
-            #{beginTime},
-            #{endTime},
-            #{addTime},
-            #{updateTime},
-            #{status},
-            #{delFlag1}
-        )
-    </insert>
-
-
-    <update id="update">
-        UPDATE cm_organize_promotions
-        SET name = #{name},
-        description = #{description},
-        type = #{type},
-        mode = #{mode},
-        touchPrice = #{touchPrice},
-        reducedPrice = #{reducedPrice},
-        beginTime = #{beginTime},
-        endTime = #{endTime},
-        updateTime = #{updateTime},
-        status = #{status},
-        delFlag = #{delFlag1}
-        WHERE id = #{id}
-    </update>
-
-    <select id="findShop" resultType="com.caimei.modules.cibe.entity.Shop">
-        SELECT * from shop where shopID = #{id}
-    </select>
-
-    <select id="findProductPromotion" resultType="com.caimei.modules.weisha.entity.CmOrganizePromotion">
-        select  pr.id,
-                pr.name,
-                pr.type,
-                pr.mode,
-                pr.touchPrice,
-                pr.reducedPrice,
-                pr.beginTime,
-                pr.endTime,
-                pr.status,
-                prp.productId,
-                prp.supplierId
-        from cm_organize_promotions pr
-        left join cm_organize_promotions_product prp on pr.id = prp.promotionsId
-        where (prp.productId = #{productId}
-        or prp.supplierId = #{shopId})
-        and (pr.status = 1 or ( pr.status = 2 and (NOW() between pr.beginTime and pr.endTime)))
-        and pr.delFlag not in ('1','2')
-        order by pr.type desc
-        limit 1
-    </select>
-
-    <select id="findProductPromotionsGift" resultType="com.caimei.modules.weisha.entity.CmOrganizePromotion">
-        SELECT DISTINCT  pr.id,
-        pr.name,
-        pr.type,
-        pr.mode,
-        pr.touchPrice,
-        pr.reducedPrice,
-        pr.beginTime,
-        pr.endTime,
-        pr.status
-        FROM cm_organize_promotions_gift cpg
-        LEFT JOIN cm_organize_promotions pr ON pr.id = cpg.promotionsId
-        WHERE cpg.productId = #{productId}
-        AND (pr.status = 1 OR ( pr.status = 2 AND (NOW() BETWEEN pr.beginTime AND pr.endTime)))
-        AND pr.mode = 3
-        AND pr.delFlag not in ('1','2')
-        ORDER BY pr.type DESC
-        LIMIT 1
-    </select>
-
-    <select id="findOrderPromotions" resultType="com.caimei.modules.weisha.entity.CmOrganizePromotion">
-        SELECT * FROM cm_organize_promotions_order WHERE id = #{orderPromotionsId}
-    </select>
-
-    <select id="findPromotionsByProductId" resultType="com.caimei.modules.weisha.entity.CmOrganizePromotion">
-        select pr.id,
-               pr.name,
-               pr.description,
-               pr.type,
-               pr.mode,
-               pr.touchPrice,
-               pr.reducedPrice,
-               pr.beginTime,
-               pr.endTime,
-               pr.status,
-               prp.productId,
-               prp.supplierId
-        from cm_organize_promotions pr
-                 left join cm_organize_promotions_product prp on pr.id = prp.promotionsId
-        where (prp.productId = #{productId} or
-               prp.supplierId = (select p.shopID from product p where p.productID = #{productId})
-            )
-          and (pr.status = 1 or (pr.status = 2 and (NOW() between pr.beginTime and pr.endTime)))
-          and pr.delFlag not in (1,2)
-        order by pr.type desc
-        limit 1
-    </select>
-    <select id="getPresentPriceById" resultType="java.lang.Double">
-        select price from product where productID=#{productId}
-    </select>
-    <select id="getProductByProductId" resultType="com.caimei.modules.product.entity.Product">
-        select
-            cop.id AS productID,cop.price AS price,
-            p.mainImage,p.name,
-            s.name AS "shopName"
-        from cm_organize_product cop
-            left join product p on cop.productId = p.productID
-            left join shop s on p.shopID = s.shopID
-        where cop.id = #{productId}
-    </select>
-</mapper>

+ 53 - 256
src/main/resources/mappings/modules/weisha/CmOrganizeStoreMapper.xml

@@ -2,261 +2,58 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei.modules.weisha.dao.CmOrganizeStoreDao">
 <mapper namespace="com.caimei.modules.weisha.dao.CmOrganizeStoreDao">
 
 
-	<sql id="cmOrganizeStoreColumns">
-		a.id AS "id",
-		a.organizeId AS "organizeId",
-		a.name AS "name",
-		a.linkMan AS "linkMan",
-		a.mobile AS "mobile",
-		a.provinceId AS "provinceId",
-		a.cityId AS "cityId",
-		a.townId AS "townId",
-		a.address AS "address",
-		a.status AS "status",
-		a.addTime AS "addTime"
-	</sql>
-	<sql id="cmOrganizeUserinfo">
-		u.userID AS userID,
-		c.clubID as clubID,
-		u.userOrganizeID AS organizeId,
-		c.name AS NAME,
-		c.linkMan AS linkMan,
-		c.contractMobile AS mobile,
-		c.provinceId AS provinceId,
-		c.cityId AS cityId,
-		c.townId AS townId,
-		c.address AS address,
-		c.status AS STATUS,
-		c.addTime AS ADDTIME
-	</sql>
-	<sql id="addressName">
-		p.name AS provinceName,
-		ct.name AS cityName,
-		t.name AS townName
-	</sql>
-
-	<sql id="cmOrganizeStoreJoins">
-		LEFT JOIN province p ON c.provinceId = p.provinceID
-		LEFT JOIN city ct ON c.cityId = ct.cityID
-		LEFT JOIN town t ON c.townId = t.townID
-	</sql>
-
-	<select id="get" resultType="CmOrganizeStore">
-		SELECT
-			<include refid="cmOrganizeStoreColumns"/>
-		FROM cm_organize_store a
-		LEFT JOIN province p ON a.provinceId = p.provinceID
-		LEFT JOIN city ct ON a.cityId = ct.cityID
-		LEFT JOIN town t ON a.townId = t.townID
-		WHERE a.id = #{id}
-	</select>
-
-	<!--<select id="findList" resultType="CmOrganizeStore">
-		SELECT
-			<include refid="cmOrganizeStoreColumns"/>
-		FROM cm_organize_store a
-		<include refid="cmOrganizeStoreJoins"/>
-		<where>
-			<if test="name != null and name != ''">
-				AND a.name LIKE
-					<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
-					<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
-					<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
-			</if>
-			<if test="linkMan != null and linkMan != ''">
-				AND a.linkMan LIKE
-					<if test="dbName == 'oracle'">'%'||#{linkMan}||'%'</if>
-					<if test="dbName == 'mssql'">'%'+#{linkMan}+'%'</if>
-					<if test="dbName == 'mysql'">concat('%',#{linkMan},'%')</if>
-			</if>
-			<if test="mobile != null and mobile != ''">
-				AND a.mobile LIKE
-					<if test="dbName == 'oracle'">'%'||#{mobile}||'%'</if>
-					<if test="dbName == 'mssql'">'%'+#{mobile}+'%'</if>
-					<if test="dbName == 'mysql'">concat('%',#{mobile},'%')</if>
-			</if>
-			<if test="status != null and status != ''">
-				AND a.status = #{status}
-			</if>
-			<if test="startTime != null and startTime != ''">
-				AND a.addTime >= #{startTime}
-			</if>
-			<if test="endTime != null and endTime != ''">
-				AND a.addTime <![CDATA[   <=  ]]> #{endTime}
-			</if>
-			<if test="organizeId != null">
-				and a.organizeId = #{organizeId}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				order by a.addTime desc
-			</otherwise>
-		</choose>
-	</select>-->
-	<select id="findList" resultType="CmOrganizeStore">
-		SELECT
-		<include refid="cmOrganizeUserinfo"/>,
-		<include refid="addressName"/>
-		FROM USER u
-		LEFT JOIN club c ON c.userId = u.userId
-		<include refid="cmOrganizeStoreJoins"/>
-		<where>
-			<if test="name != null and name != ''">
-				AND c.name LIKE
-				<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
-			</if>
-			<if test="linkMan != null and linkMan != ''">
-				AND c.linkMan LIKE
-				<if test="dbName == 'oracle'">'%'||#{linkMan}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{linkMan}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{linkMan},'%')</if>
-			</if>
-			<if test="mobile != null and mobile != ''">
-				AND c.contractMobile LIKE
-				<if test="dbName == 'oracle'">'%'||#{mobile}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{mobile}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{mobile},'%')</if>
-			</if>
-			<if test="status != null and status != ''">
-				AND c.status = #{status}
-			</if>
-			<if test="startTime != null and startTime != ''">
-				AND c.addTime >= #{startTime}
-			</if>
-			<if test="endTime != null and endTime != ''">
-				AND c.addTime <![CDATA[   <=  ]]> #{endTime}
-			</if>
-			<if test="organizeId != null">
-				and u.userOrganizeID = #{organizeId}
-			</if>
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-				order by c.addTime desc
-			</otherwise>
-		</choose>
-	</select>
-	<select id="getOrganizeUser" resultType="java.lang.Integer">
-		SELECT DISTINCT userID FROM  cm_mall_operation_user WHERE userOrganizeID = #{organizeId} AND delFlag = 0
-	</select>
-
-	<update id="cleanWx">
-		update cm_mall_operation_user
-		set delFlag = 1
-		where userId = #{userId}
-	</update>
-	<update id="clubStatus">
-		update club
-		set status = #{status}
-		where userId = #{id};
-
-	</update>
-	<update id="userStatus">
-		update USER
-		set clubStatus = #{status}
-		where userId = #{id};
-
-	</update>
-	<select id="getclubInfo" resultType="com.caimei.modules.weisha.entity.CmOrganizeStore">
-		select
-		u.userOrganizeID AS organizeId,
-		c.clubId,
-		c.name,
-		c.linkMan,
-		c.contractMobile as mobile,
-		c.address,
-		c.medicalPracticeLicenseImg,
-		c.socialCreditCode,
-		c.headpic,
-		c.businessLicenseImage,
-		<include refid="addressName"/>
-		from club c
-		<include refid="cmOrganizeStoreJoins"/>
-		LEFT JOIN USER u ON c.userId = u.userId
-		where c.clubID = #{clubId}
-	</select>
-	<select id="findAllList" resultType="CmOrganizeStore">
-		SELECT
-			<include refid="cmOrganizeStoreColumns"/>
-		FROM cm_organize_store c
-		<include refid="cmOrganizeStoreJoins"/>
-		<where>
-
-		</where>
-		<choose>
-			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
-				ORDER BY ${page.orderBy}
-			</when>
-			<otherwise>
-                order by a.addTime desc
-			</otherwise>
-		</choose>
-	</select>
-	<select id="findListByMobile" resultType="com.caimei.modules.weisha.entity.CmOrganizeStore">
-		select
-			<include refid="cmOrganizeStoreColumns"/>
-		from cm_organize_store a
-		where a.mobile = #{mobile}
-		<if test="id != null and id != ''">
-			and a.id != #{id}
-		</if>
-	</select>
-	<select id="findOrganizeNameById" resultType="java.lang.String">
-		select organizeName from cm_mall_organize where id = #{organizeId}
-	</select>
-
-	<insert id="insert" parameterType="CmOrganizeStore"  keyProperty="id" useGeneratedKeys="true">
-		INSERT INTO cm_organize_store(
-			organizeId,
-			name,
-			linkMan,
-			mobile,
-			provinceId,
-			cityId,
-			townId,
-			address,
-			status,
-			addTime
-		) VALUES (
-			#{organizeId},
-			#{name},
-			#{linkMan},
-			#{mobile},
-			#{provinceId},
-			#{cityId},
-			#{townId},
-			#{address},
-			#{status},
-			#{addTime}
-		)
-	</insert>
-
-	<update id="update">
-		UPDATE cm_organize_store SET
-			organizeId = #{organizeId},
-			name = #{name},
-			linkMan = #{linkMan},
-			mobile = #{mobile},
-			provinceId = #{provinceId},
-			cityId = #{cityId},
-			townId = #{townId},
-			address = #{address},
-			status = #{status}
-		WHERE id = #{id}
-	</update>
-
-	<delete id="delete">
-		DELETE FROM cm_organize_store
-		WHERE id = #{id}
-	</delete>
+    <select id="getOrganizeUser" resultType="java.lang.Integer">
+        SELECT DISTINCT userID
+        FROM cm_mall_operation_user
+        WHERE userOrganizeID = #{organizeId}
+          AND delFlag = 0
+    </select>
+
+    <update id="cleanWx">
+        update cm_mall_operation_user
+        set delFlag = 1
+        where userId = #{userId}
+    </update>
+
+    <update id="clubStatus">
+        update club
+        set status = #{status}
+        where userId = #{id};
+    </update>
+
+    <update id="userStatus">
+        update USER
+        set clubStatus = #{status}
+        where userId = #{id};
+    </update>
+
+    <select id="getclubInfo" resultType="com.caimei.modules.weisha.entity.CmOrganizeStore">
+        select
+        u.userOrganizeID AS organizeId,
+        c.clubId,
+        c.name,
+        c.linkMan,
+        c.contractMobile as mobile,
+        c.address,
+        c.medicalPracticeLicenseImg,
+        c.socialCreditCode,
+        c.headpic,
+        c.businessLicenseImage,
+        p.name AS provinceName,
+        ct.name AS cityName,
+        t.name AS townName
+        from club c
+        LEFT JOIN province p ON c.provinceId = p.provinceID
+        LEFT JOIN city ct ON c.cityId = ct.cityID
+        LEFT JOIN town t ON c.townId = t.townID
+        LEFT JOIN USER u ON c.userId = u.userId
+        where c.clubID = #{clubId}
+    </select>
+
+    <select id="findOrganizeNameById" resultType="java.lang.String">
+        select organizeName
+        from cm_mall_organize
+        where id = #{organizeId}
+    </select>
 
 
 </mapper>
 </mapper>