Explorar el Código

1、运营端专场功能;
2、贸易订单详情接口调整;

zk hace 2 años
padre
commit
0a4d9eba0a

+ 0 - 9
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/controller/KwfTruckController.java

@@ -1,11 +1,7 @@
 package com.sckw.fleet.controller;
 
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
-import com.sckw.core.exception.BusinessException;
 import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.constant.Global;
@@ -32,11 +28,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
 import java.util.*;
 
 /**

+ 1 - 1
sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwoTradeOrderGoodsUnitService.java

@@ -65,7 +65,7 @@ public class KwoTradeOrderGoodsUnitService {
      **/
     public List<GoodsUnitDetailRes> findGoodsUnitDetail(Long orderId) {
         List<GoodsUnitDetailRes> units = new ArrayList<>();
-        List<KwoTradeOrderGoodsUnit> assistUnit = goodsUnitMapper.findGoodsUnit(new HashMap<>(Global.NUMERICAL_SIXTEEN){{put("orderId", orderId);}});
+        List<KwoTradeOrderGoodsUnit> assistUnit = goodsUnitMapper.findGoodsUnit(new HashMap<>(Global.NUMERICAL_SIXTEEN){{put("tOrderId", orderId);}});
         if (CollectionUtils.isNotEmpty(assistUnit)) {
             assistUnit.forEach(e -> {
                 GoodsUnitDetailRes unit = BeanUtils.copyProperties(e, GoodsUnitDetailRes.class);

+ 1 - 1
sckw-modules/sckw-product/src/main/java/com/sckw/product/service/KwpGoodsService.java

@@ -323,7 +323,7 @@ public class KwpGoodsService {
             Map<String, String> finalUnitMap = unitMap;
             assistUnit.forEach(e -> {
                 e.setFromUnitName(finalUnitMap != null ? finalUnitMap.get(e.getFromUnit()) : null);
-                e.setToUnitName(finalUnitMap != null ? finalUnitMap.get(e.getFromUnit()) : null);
+                e.setToUnitName(finalUnitMap != null ? finalUnitMap.get(e.getToUnit()) : null);
             });
         }
         detail.setImages(images).setPriceRanges(ranges).setAttributes(attributes).setAddressInfo(addressInfo).setAssistUnit(assistUnit);

+ 107 - 2
sckw-modules/sckw-system/src/main/java/com/sckw/system/controller/KwsSpecialController.java

@@ -1,7 +1,24 @@
 package com.sckw.system.controller;
 
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.sckw.core.exception.SystemException;
+import com.sckw.core.model.page.PageHelperUtil;
+import com.sckw.core.model.page.PageResult;
+import com.sckw.core.web.context.LoginUserHolder;
+import com.sckw.core.web.response.HttpResult;
+import com.sckw.system.model.vo.req.KwsSpecialAddReqVo;
+import com.sckw.system.model.vo.req.KwsSpecialUpdateReqVo;
+import com.sckw.system.model.vo.res.KwsSpecialResVo;
+import com.sckw.system.service.KwsSpecialService;
+import jakarta.validation.Valid;
+import org.checkerframework.checker.units.qual.A;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 /**
  * @desc 专场
@@ -12,4 +29,92 @@ import org.springframework.web.bind.annotation.RestController;
 @RequestMapping("/kwsSpecial")
 public class KwsSpecialController {
 
+    @Autowired
+    KwsSpecialService kwsSpecialService;
+
+    /**
+     * @param id 主键ID
+     * @desc 根据主键查询
+     * @author zk
+     * @date 2023/12/13
+     **/
+    @GetMapping("/detail")
+    public HttpResult selectByKey(Long id) throws SystemException {
+        //车辆信息
+        KwsSpecialResVo truckDetailVo = kwsSpecialService.detail(id);
+        return HttpResult.ok(truckDetailVo);
+    }
+
+
+    /**
+     * @param params {page:页数、pageSize:每页条数、。。。}
+     * @desc 分页查询
+     * @author zk
+     * @date 2023/12/13
+     **/
+    @PostMapping("/select")
+    public HttpResult findPage(@RequestBody Map<String, Object> params) throws SystemException {
+        // 设置分页参数
+        PageHelper.startPage(PageResult.getPage(params), PageResult.getPageSize(params));
+        List<KwsSpecialResVo> list = kwsSpecialService.findPage(params);
+        PageResult pageResult = PageHelperUtil.getPageResult(new PageInfo<>(list));
+        return HttpResult.ok(pageResult);
+    }
+
+    /**
+     * @param params {。。。}
+     * @desc 查询
+     * @author zk
+     * @date 2023/12/13
+     **/
+    @PostMapping("/findList")
+    public HttpResult findList(@RequestBody Map<String, Object> params) throws SystemException {
+        return HttpResult.ok(kwsSpecialService.findList(params));
+    }
+
+    /**
+     * @param params 新增参数
+     * @return HttpResult
+     * @desc 新增专场
+     * @author czh
+     * @date 2023/12/13
+     */
+    @PostMapping("/add")
+    public HttpResult add(@Valid @RequestBody KwsSpecialAddReqVo params) throws SystemException{
+        return kwsSpecialService.add(params);
+    }
+
+    /**
+     * @param params {}
+     * @desc 更新
+     * @author zk
+     * @date 2023/12/13
+     **/
+    @PostMapping("/update")
+    public HttpResult update(@Valid @RequestBody KwsSpecialUpdateReqVo params) throws SystemException {
+        return kwsSpecialService.update(params);
+    }
+
+    /**
+     * @param {ids:主键ID(多个以逗号隔开)}
+     * @desc 删除
+     * @author zk
+     * @date 2023/12/13
+     **/
+    @DeleteMapping("/dels")
+    public HttpResult del(@RequestParam String ids) throws SystemException {
+        return kwsSpecialService.del(ids);
+    }
+
+    /**
+     * @param params {}
+     * @desc 加入专场
+     * @author zk
+     * @date 2023/12/13
+     **/
+    @PostMapping("/joinSpecial")
+    public HttpResult joinSpecial(@Valid @RequestBody HashMap<String, Object> params) throws SystemException {
+        return kwsSpecialService.joinSpecial(params);
+    }
+
 }

+ 8 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/dao/KwsEntSpecialDao.java

@@ -3,6 +3,8 @@ package com.sckw.system.dao;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.sckw.system.model.KwsEntSpecial;
 import org.apache.ibatis.annotations.Mapper;
+import java.util.Map;
+import java.util.List;
 
 /**
  * @desc 专场与企业关联信息
@@ -12,4 +14,10 @@ import org.apache.ibatis.annotations.Mapper;
 @Mapper
 public interface KwsEntSpecialDao extends BaseMapper<KwsEntSpecial> {
 
+    /**
+     * 专场企业查询
+     * @param params 查询参数
+     * @return 专场企业集
+     */
+    List<KwsEntSpecial> findList(Map<String, Object> params);
 }

+ 16 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/dao/KwsSpecialDao.java

@@ -2,7 +2,10 @@ package com.sckw.system.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.sckw.system.model.KwsSpecial;
+import com.sckw.system.model.vo.res.KwsSpecialResVo;
 import org.apache.ibatis.annotations.Mapper;
+import java.util.List;
+import java.util.Map;
 
 /**
  * @desc 专场信息
@@ -12,4 +15,17 @@ import org.apache.ibatis.annotations.Mapper;
 @Mapper
 public interface KwsSpecialDao extends BaseMapper<KwsSpecial> {
 
+    /**
+     * 专场查询
+     * @param params 查询参数
+     * @return 专场集
+     */
+    List<KwsSpecialResVo> findPage(Map<String, Object> params);
+
+    /**
+     * 专场查询
+     * @param params 查询参数
+     * @return 专场集
+     */
+    List<KwsSpecial> findList(Map<String, Object> params);
 }

+ 52 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/model/vo/req/KwsSpecialAddReqVo.java

@@ -0,0 +1,52 @@
+package com.sckw.system.model.vo.req;
+
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Size;
+import lombok.Data;
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @desc 专场
+ * @author zk
+ * @date 2023/12/13 0013
+ */
+@Data
+public class KwsSpecialAddReqVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = -7185010332822613036L;
+
+    /**
+     * 名称
+     */
+    @NotBlank(message = "名称不能为空!")
+    @Size(max=40, message = "名称长度不能大于40个字符!")
+    private String name;
+
+    /**
+     * 专场编号
+     */
+    @NotBlank(message = "名称不能为空!")
+    @Size(max=40, message = "名称长度不能大于40个字符!")
+    private String code;
+
+    /**
+     * 客户经理
+     */
+    @NotNull(message = "客户经理不能为空!")
+    private Long manager;
+
+    /**
+     * 专场主企业ID
+     */
+    @NotNull(message = "专场主企业不能为空!")
+    private Long entId;
+
+    /**
+     * 备注
+     */
+    @Size(max=200, message = "名称长度不能大于200个字符!")
+    private String remark;
+}

+ 59 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/model/vo/req/KwsSpecialUpdateReqVo.java

@@ -0,0 +1,59 @@
+package com.sckw.system.model.vo.req;
+
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Size;
+import lombok.Data;
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @desc 专场
+ * @author zk
+ * @date 2023/12/13 0013
+ */
+@Data
+public class KwsSpecialUpdateReqVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = -7285010332822613036L;
+
+    /**
+     * 主键ID
+     */
+    @NotNull(message = "主键ID不能为空!")
+    private Long id;
+
+    /**
+     * 名称
+     */
+    @NotBlank(message = "名称不能为空!")
+    @Size(max=40, message = "名称长度不能大于40个字符!")
+    private String name;
+
+    /**
+     * 专场编号
+     */
+    @NotBlank(message = "名称不能为空!")
+    @Size(max=40, message = "名称长度不能大于40个字符!")
+    private String code;
+
+    /**
+     * 客户经理
+     */
+    @NotNull(message = "客户经理不能为空!")
+    private Long manager;
+
+    /**
+     * 专场主企业ID
+     */
+    @NotNull(message = "专场主企业不能为空!")
+    private Long entId;
+
+    /**
+     * 备注
+     */
+    @Size(max=200, message = "名称长度不能大于200个字符!")
+    private String remark;
+
+}

+ 79 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/model/vo/res/KwsSpecialResVo.java

@@ -0,0 +1,79 @@
+package com.sckw.system.model.vo.res;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @desc 专场信息
+ * @author zk
+ * @date 2023/12/13 0013
+ */
+@Data
+public class KwsSpecialResVo  implements Serializable {
+
+    /**
+     * 主键ID
+     */
+    private Long id;
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 开户经理
+     */
+    private Long manager;
+
+    /**
+     * 开户经理
+     */
+    private String managerName;
+
+    /**
+     * 专场编号
+     */
+    private String code;
+
+    /**
+     * 专场主企业ID
+     */
+    private Long entId;
+
+    /**
+     * 专场主企业
+     */
+    private String firmName;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 状态:0正常/1锁定
+     */
+    private Integer status;
+
+    /**
+     * 创建人
+     */
+    private String createByName;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date updateTime;
+
+}

+ 249 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsSpecialService.java

@@ -1,7 +1,39 @@
 package com.sckw.system.service;
 
+import com.sckw.core.common.enums.enums.DictTypeEnum;
+import com.sckw.core.exception.SystemException;
+import com.sckw.core.model.constant.Global;
+import com.sckw.core.model.constant.NumberConstant;
+import com.sckw.core.model.enums.EntTypeEnum;
+import com.sckw.core.model.enums.SystemTypeEnum;
+import com.sckw.core.utils.BeanUtils;
+import com.sckw.core.utils.CollectionUtils;
+import com.sckw.core.utils.NumberUtils;
+import com.sckw.core.utils.StringUtils;
+import com.sckw.core.web.constant.HttpStatus;
+import com.sckw.core.web.context.LoginUserHolder;
+import com.sckw.core.web.response.HttpResult;
+import com.sckw.system.api.model.dto.res.EntCacheResDto;
+import com.sckw.system.api.model.dto.res.SysDictResDto;
+import com.sckw.system.api.model.dto.res.UserCacheResDto;
+import com.sckw.system.dao.KwsEntSpecialDao;
+import com.sckw.system.dao.KwsEnterpriseDao;
+import com.sckw.system.dao.KwsSpecialDao;
+import com.sckw.system.dao.KwsUserDao;
+import com.sckw.system.model.KwsEntSpecial;
+import com.sckw.system.model.KwsEnterprise;
+import com.sckw.system.model.KwsSpecial;
+import com.sckw.system.model.KwsUser;
+import com.sckw.system.model.vo.req.KwsSpecialAddReqVo;
+import com.sckw.system.model.vo.req.KwsSpecialUpdateReqVo;
+import com.sckw.system.model.vo.res.KwsSpecialResVo;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 /**
  * @desc 专场
  * @author zk
@@ -10,4 +42,221 @@ import org.springframework.stereotype.Service;
 @Service
 public class KwsSpecialService {
 
+    @Autowired
+    KwsSpecialDao kwsSpecialDao;
+
+    @Autowired
+    KwsEntSpecialDao kwsEntSpecialDao;
+
+    @Autowired
+    KwsUserDao kwsUserDao;
+
+    @Autowired
+    KwsEnterpriseDao kwsEnterpriseDao;
+
+    /**
+     * @param key 主键id
+     * @desc 根据主键查询
+     * @author zk
+     * @date 2023/12/13
+     **/
+    public KwsSpecial selectByKey(Long key) {
+        return kwsSpecialDao.selectById(key);
+    }
+
+    /**
+     * @param id 车辆档案ID
+     * @desc 专场详情
+     * @author zk
+     * @date 2023/12/13
+     **/
+    public KwsSpecialResVo detail(Long id){
+        //车辆信息
+        KwsSpecial special = kwsSpecialDao.selectById(id);
+        KwsSpecialResVo specialResVo = new KwsSpecialResVo();
+        BeanUtils.copyPropertiesValue(special, specialResVo);
+
+        //数据组装
+        if (special != null) {
+            //客户经理
+            KwsUser manager = kwsUserDao.selectByKey(special.getManager());
+            //创建人
+            KwsUser createBy = kwsUserDao.selectByKey(special.getCreateBy());
+            //专场企业
+            KwsEnterprise enterprise = kwsEnterpriseDao.selectByKey(special.getEntId());
+
+            specialResVo.setManagerName(manager != null ? manager.getName() : null);
+            specialResVo.setCreateByName(createBy != null ? createBy.getName() : null);
+            specialResVo.setFirmName(enterprise != null ? enterprise.getFirmName() : null);
+            return specialResVo;
+        }
+        return null;
+    }
+
+    /**
+     * @param params 分页参数
+     * @desc 分页查询
+     * @author zk
+     * @date 2023/12/13
+     **/
+    public List<KwsSpecialResVo> findPage(Map<String, Object> params) {
+        /*查询分页数据**/
+        List<KwsSpecialResVo> specials = kwsSpecialDao.findPage(params);
+        return specials;
+    }
+
+    /**
+     * @param params 查询参数
+     * @desc 查询
+     * @author zk
+     * @date 2023/12/13
+     **/
+    public List<KwsSpecial> findList(Map<String, Object> params) {
+        return kwsSpecialDao.findList(params);
+    }
+
+    /**
+     * @param params 参数
+     * @desc 新增专场
+     * @author zk
+     * @date 2023/12/13
+     **/
+    public HttpResult add(KwsSpecialAddReqVo params) {
+        /*校验*/
+        List<KwsSpecial> specials = kwsSpecialDao.findList(new HashMap<>(){{put("name", params.getName());}});
+        if (CollectionUtils.isNotEmpty(specials)) {
+            return HttpResult.error("专场名称已存在!");
+        }
+        specials = kwsSpecialDao.findList(new HashMap<>(){{put("code", params.getCode());}});
+        if (CollectionUtils.isNotEmpty(specials)) {
+            return HttpResult.error("专场编号已存在!");
+        }
+        specials = kwsSpecialDao.findList(new HashMap<>(){{put("entId", params.getEntId());}});
+        if (CollectionUtils.isNotEmpty(specials)) {
+            return HttpResult.error("企业已属专于专场主企业!");
+        }
+        List<KwsEntSpecial> entSpecials = kwsEntSpecialDao.findList(new HashMap<>(){{put("entId", params.getEntId());}});
+        if (CollectionUtils.isNotEmpty(entSpecials)) {
+            return HttpResult.error("企业已属于专场企业!");
+        }
+
+        /*数据更新*/
+        KwsSpecial special = new KwsSpecial();
+        BeanUtils.copyProperties(params, special);
+        int count = kwsSpecialDao.insert(special);
+        return count > 0 ? HttpResult.ok("专场信息新增成功!") : HttpResult.error("专场信息新增失败!");
+    }
+
+    /**
+     * @param params 参数
+     * @desc 修改专场
+     * @author zk
+     * @date 2023/12/13
+     **/
+    public HttpResult update(KwsSpecialUpdateReqVo params) {
+        /*校验*/
+        KwsSpecial special = kwsSpecialDao.selectById(params.getId());
+        if (special == null) {
+            return HttpResult.error("专场信息不存在!");
+        }
+        List<KwsSpecial> specials = kwsSpecialDao.findList(new HashMap<>(){{put("name", params.getName());}});
+        if (CollectionUtils.isNotEmpty(specials)) {
+            KwsSpecial special1 = specials.get(NumberConstant.ZERO);
+            if (!special1.getId().equals(special.getId())) {
+                return HttpResult.error("专场名称已存在!");
+            }
+        }
+        specials = kwsSpecialDao.findList(new HashMap<>(){{put("code", params.getCode());}});
+        if (CollectionUtils.isEmpty(specials)) {
+            KwsSpecial special1 = specials.get(NumberConstant.ZERO);
+            if (!special1.getId().equals(special.getId())) {
+                return HttpResult.error("专场编号已存在!");
+            }
+        }
+        specials = kwsSpecialDao.findList(new HashMap<>(){{put("entId", params.getEntId());}});
+        if (CollectionUtils.isNotEmpty(specials)) {
+            KwsSpecial special1 = specials.get(NumberConstant.ZERO);
+            if (!special1.getId().equals(special.getId())) {
+                return HttpResult.error("企业已属专于专场主企业!");
+            }
+        }
+        List<KwsEntSpecial> entSpecials = kwsEntSpecialDao.findList(new HashMap<>(){{put("entId", params.getEntId());}});
+        if (CollectionUtils.isNotEmpty(entSpecials)) {
+            return HttpResult.error("企业已属于专场企业!");
+        }
+
+        /*数据更新*/
+        BeanUtils.copyProperties(params, special);
+        int count = kwsSpecialDao.updateById(special);
+        return count > 0 ? HttpResult.ok("专场信息修改成功!") : HttpResult.error("专场信息修改失败!");
+    }
+
+    /**
+     * @param ids {ids:主键ID(多个以逗号隔开)}
+     * @desc 删除
+     * @author zk
+     * @date 2023/12/13
+     **/
+    public HttpResult del(String ids) {
+        /*数据校验**/
+        if (StringUtils.isBlank(ids)) {
+            return HttpResult.error("请选择要删除的数据!");
+        }
+
+        /*数据组装**/
+        String[] idArray = ids.split(",");
+        for (String id : idArray) {
+            KwsSpecial special = kwsSpecialDao.selectById(id);
+            if (special != null) {
+                special.setDelFlag(Global.YES);
+                if (kwsSpecialDao.updateById(special) <= 0) {
+                    throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.DELETE_FAIL);
+                }
+            } else {
+                return HttpResult.error("选择删除的数据已不存在!");
+            }
+        }
+        return HttpResult.ok("删除成功!");
+    }
+
+    /**
+     * @param params {}
+     * @desc 加入专场
+     * @author zk
+     * @date 2023/12/13
+     **/
+    public HttpResult joinSpecial(HashMap<String, Object> params) {
+        /*校验*/
+        if (StringUtils.isBlank(params.get("id")) || StringUtils.isBlank(params.get("entIds"))) {
+            return HttpResult.error("参数不能为空!");
+        }
+        Long id = NumberUtils.parseLong(params.get("id"));
+        String entIds = StringUtils.objectStr(params.get("entIds"));
+        String[] idArray = entIds.split(",");
+        for (String entId : idArray) {
+            List<KwsSpecial> specials = kwsSpecialDao.findList(new HashMap<>(){{put("entId", entId);}});
+            if (CollectionUtils.isNotEmpty(specials)) {
+                return HttpResult.error("企业已属专于专场主企业!");
+            }
+
+            List<KwsEntSpecial> entSpecials = kwsEntSpecialDao.findList(new HashMap<>(){{put("entId", entId);}});
+            if (CollectionUtils.isNotEmpty(entSpecials)) {
+                KwsEnterprise enterprise = kwsEnterpriseDao.selectByKey(Long.parseLong(entId));
+                if (enterprise != null) {
+                    return HttpResult.error(enterprise.getFirmName() + "已属于专场企业!");
+                }
+            }
+        }
+
+
+        /*数据组装存储*/
+        for (String entId : idArray) {
+            KwsEntSpecial entSpecial = new KwsEntSpecial();
+            entSpecial.setSpecialId(id);
+            entSpecial.setEntId(Long.parseLong(entId));
+            kwsEntSpecialDao.insert(entSpecial);
+        }
+
+        return HttpResult.ok("加入专场成功!");
+    }
 }

+ 20 - 0
sckw-modules/sckw-system/src/main/resources/mapper/KwsEntSpecialDao.xml

@@ -0,0 +1,20 @@
+<?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.sckw.system.dao.KwsEntSpecialDao">
+
+    <select id="findList" resultType="com.sckw.system.model.KwsEntSpecial" parameterType="java.util.Map" >
+        SELECT
+        id, special_id specialId, ent_id entId, remark, status, create_by createBy,
+        create_time createTime, update_by updateBy, update_time updateTime
+        from kws_ent_special
+        where del_flag = 0
+        <if test="entId != null and entId != ''">
+            and ent_id = #{entId, jdbcType=BIGINT}
+        </if>
+        <if test="specialId != null and specialId != ''">
+            and special_id = #{specialId, jdbcType=BIGINT}
+        </if>
+        ORDER BY create_time desc
+    </select>
+
+</mapper>

+ 53 - 0
sckw-modules/sckw-system/src/main/resources/mapper/KwsSpecialDao.xml

@@ -0,0 +1,53 @@
+<?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.sckw.system.dao.KwsSpecialDao">
+
+  <select id="findPage" resultType="com.sckw.system.model.vo.res.KwsSpecialResVo" parameterType="java.util.Map" >
+    SELECT
+      ks.id, ks.name, ks.manager, ks.code, ks.ent_id entId, ks.remark, ks.status, ks.create_by createBy,
+      ks.create_time createTime, ks.update_by updateBy, ks.update_time updateTime, ke.firm_name firmName,
+      ku.`name` createByName, ku1.`name` managerName
+    from kws_special ks
+    left join kws_enterprise ke on ke.id = ks.ent_id
+    left join kws_user ku on ku.id = ks.create_by
+    left join kws_user ku1 on ku1.id = ks.manager
+    where ks.del_flag = 0
+    <if test="name != null and name != ''">
+      and ks.name = #{name, jdbcType=VARCHAR}
+    </if>
+    <if test="code != null and code != ''">
+      and ks.code = #{code, jdbcType=VARCHAR}
+    </if>
+    <if test="keywords != null and keywords != ''">
+      and (
+        ks.name like concat('%', #{keywords}, '%')
+        or ks.code like concat('%', #{keywords}, '%')
+        or ke.firm_name like concat('%', #{keywords}, '%')
+        or ku.`name` like concat('%', #{keywords}, '%')
+      )
+    </if>
+    ORDER BY ks.create_time desc
+  </select>
+
+  <select id="findList" resultType="com.sckw.system.model.KwsSpecial" parameterType="java.util.Map" >
+    SELECT
+    id, name, manager, code, ent_id entId, remark, status, create_by createBy,
+    create_time createTime, update_by updateBy, update_time updateTime
+    from kws_special
+    where del_flag = 0
+    <if test="entId != null and entId != ''">
+      and ent_id = #{entId, jdbcType=VARCHAR}
+    </if>
+    <if test="name != null and name != ''">
+      and name = #{name, jdbcType=VARCHAR}
+    </if>
+    <if test="code != null and code != ''">
+      and code = #{code, jdbcType=VARCHAR}
+    </if>
+    <if test="manager != null and manager != ''">
+      and manager = #{manager, jdbcType=VARCHAR}
+    </if>
+    ORDER BY create_time desc
+  </select>
+
+</mapper>