feat: sp模块

feature/comment
ChenYan 2025-01-08 20:08:32 +08:00
parent a045ab58b6
commit 72a737eda7
34 changed files with 745 additions and 865 deletions

View File

@ -20,18 +20,8 @@ public class McWlApplication
{
public static void main(String[] args)
{
// System.setProperty("spring.devtools.restart.enabled", "false");
SpringApplication.run(McWlApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 魔创未来启动成功 ლ(´ڡ`ლ)゙ \n" +
" .-------. ____ __ \n" +
" | _ _ \\ \\ \\ / / \n" +
" | ( ' ) | \\ _. / ' \n" +
" |(_ o _) / _( )_ .' \n" +
" | (_,_).' __ ___(_ o _)' \n" +
" | |\\ \\ | || |(_,_)' \n" +
" | | \\ `' /| `-' / \n" +
" | | \\ / \\ / \n" +
" ''-' `'-' `-..-' ");
System.out.println("(♥◠‿◠)ノ゙ 魔创未来启动成功 ლ(´ڡ`ლ)゙ ");
}
// 序列化枚举值为前端返回值

View File

@ -1,77 +0,0 @@
package com.mcwl.web.controller.comment;
import com.mcwl.comment.domain.ProductCommentConditionEntity;
import com.mcwl.comment.domain.ProductCommentEntity;
import com.mcwl.comment.service.impl.CommentServiceImpl;
import com.mcwl.common.utils.ResponsePageEntity;
import com.mcwl.resource.domain.MallProduct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* @AuthorChenYan
* @ProjectMcWl
* @Packagecom.mcwl.web.controller.comment
* @FilenameCommentController
* @Description TODO
* @Date2025/1/4 18:56
*/
@RestController
@RequestMapping("/comment")
public class CommentController {
@Autowired
private CommentServiceImpl commentService;
/**
* id
*
* @param id ID
* @return
*/
@GetMapping("/findById")
public MallProduct findById(Long id) {
return commentService.findById(id);
}
/**
*
*
* @param productCommentEntity
* @return
*/
@PostMapping("/insert")
public int insert(@RequestBody ProductCommentEntity productCommentEntity) {
return commentService.insert(productCommentEntity);
}
/**
*
*
* @param productCommentEntity
* @return
*/
@PostMapping("/update")
public int update(@RequestBody ProductCommentEntity productCommentEntity) {
return commentService.update(productCommentEntity);
}
/**
*
*
* @param ids ID
* @return
*/
@PostMapping("/deleteByIds")
public int deleteByIds(@RequestBody @NotNull List<Long> ids) {
return commentService.deleteByIds(ids);
}
}

View File

@ -5,8 +5,7 @@ import com.mcwl.common.core.controller.BaseController;
import com.mcwl.common.core.domain.AjaxResult;
import com.mcwl.common.core.page.TableDataInfo;
import com.mcwl.common.domain.IdsParam;
import com.mcwl.common.utils.SecurityUtils;
import com.mcwl.resource.domain.MallProduct;
import com.mcwl.resource.domain.ModelProduct;
import com.mcwl.resource.domain.vo.MallProductVo;
import com.mcwl.resource.service.MallProductService;
import com.mcwl.web.controller.common.OssUtil;
@ -38,6 +37,7 @@ public class MallProductController extends BaseController {
}
/***
*
*
@ -86,11 +86,11 @@ public class MallProductController extends BaseController {
/**
*
*/
@GetMapping("/list")
public TableDataInfo list(MallProduct sysJob)
@PostMapping("/list")
public TableDataInfo list(@RequestBody ModelProduct mallProduct)
{
startPage();
List<MallProduct> list = mallProductRuleInfoService.selectMallProductList(sysJob);
List<ModelProduct> list = mallProductRuleInfoService.selectMallProductList(mallProduct);
return getDataTable(list);
}
@ -99,35 +99,33 @@ public class MallProductController extends BaseController {
*
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long jobId)
public AjaxResult getInfo(@PathVariable("id") Long Id)
{
return success(mallProductRuleInfoService.selectMallProductById(jobId));
return success(mallProductRuleInfoService.getById(Id));
}
/**
*
*/
@PostMapping("/add")
public AjaxResult add(@RequestBody MallProduct mallProduct)
public AjaxResult add(@RequestBody ModelProduct mallProduct)
{
mallProduct.setUserId(SecurityUtils.getUserId());
mallProduct.setCreateBy(getUsername());
return toAjax(mallProductRuleInfoService.insertMallProduct(mallProduct));
}
/**
*
*/
@PutMapping("/upda")
public AjaxResult edit(@RequestBody MallProduct mallProduct)
public AjaxResult edit(@RequestBody ModelProduct mallProduct)
{
mallProduct.setUpdateBy(getUsername());
return toAjax(mallProductRuleInfoService.updateMallProduct(mallProduct));
}
/**
*
*/
@ -145,7 +143,7 @@ public class MallProductController extends BaseController {
@PostMapping("/selectByUserId")
public AjaxResult selectByUserId(@RequestBody MallProductVo mallProductVo){
Page<MallProduct> mallProductList = mallProductRuleInfoService.selectByUserId(mallProductVo);
Page<ModelProduct> mallProductList = mallProductRuleInfoService.selectByUserId(mallProductVo);
return AjaxResult.success(mallProductList);
}

View File

@ -3,7 +3,7 @@ package com.mcwl.web.controller.resource;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mcwl.common.annotation.RepeatSubmit;
import com.mcwl.common.core.domain.AjaxResult;
import com.mcwl.resource.domain.MallProduct;
import com.mcwl.resource.domain.ModelProduct;
import com.mcwl.resource.domain.vo.MallProductVo;
import com.mcwl.resource.service.MallProductLikeService;
import org.springframework.beans.factory.annotation.Autowired;
@ -31,7 +31,7 @@ public class MallProductLikeController {
@PostMapping("/selectByUserLike")
public AjaxResult selectByUserLike(@RequestBody MallProductVo mallProductVo){
Page<MallProduct> mallProductPage = mallProductLikeService.selectByUserLike(mallProductVo);
Page<ModelProduct> mallProductPage = mallProductLikeService.selectByUserLike(mallProductVo);
return AjaxResult.success(mallProductPage);
}

View File

@ -1,53 +0,0 @@
package com.mcwl.comment.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.mcwl.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @AuthorChenYan
* @ProjectMcWl
* @Packagecom.mcwl.comment.domain
* @FilenameComment
* @Description
* @Date2025/1/4 18:47
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
@TableName("mall_product_comment")
public class Comment extends BaseEntity {
/**
* ID
*/
@TableId
private Long id;
/**
* ID
*/
private String parentId;
/**
* ID
*/
private String productId;
/**
* ID
*/
private String userId;
/**
*
*/
private String content;
/**
*
*/
private String rating;
/**
* 0 2
*/
private String delFlag;
}

View File

@ -1,56 +0,0 @@
package com.mcwl.comment.domain;
import lombok.Data;
import java.util.List;
/**
*
*/
@Data
public class ProductCommentConditionEntity extends RequestConditionEntity {
/**
* ID
*/
private List<Long> idList;
/**
* ID
*/
private Long id;
/**
* ID
*/
private Long parentId;
/**
* ID
*/
private Long productId;
/**
* ID
*/
private List<Long> productIdList;
/**
* ID
*/
private Long userId;
/**
*
*/
private String content;
/**
*
*/
private Integer rating;
/**
* 0 2
*/
private String delFlag;
// /**
// * 评论类型
// */
// private Integer type;
}

View File

@ -1,50 +0,0 @@
package com.mcwl.comment.domain;
import com.mcwl.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @AuthorChenYan
* @ProjectMcWl
* @Packagecom.mcwl.comment.domain
* @FilenameProductCommentEntity
* @Description
* @Date2025/1/6 13:21
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
public class ProductCommentEntity extends BaseEntity {
/**
* ID
*/
private Long parentId;
/**
* ID
*/
private Long productId;
/**
* ID
*/
private Long userId;
/**
*
*/
private String content;
/**
*
*/
private Integer rating;
// /**
// * 评论类型
// */
// private Integer type;
}

View File

@ -1,41 +0,0 @@
package com.mcwl.comment.domain;
import com.mcwl.common.utils.RequestPageEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
*
*/
@Data
public class RequestConditionEntity extends RequestPageEntity {
/**
*
*/
@ApiModelProperty("创建日期范围")
private List<String> betweenTime;
/**
*
*/
private String createBeginTime;
/**
*
*/
private String createEndTime;
/**
* excel
*/
private List<String> customizeColumnNameList;
/**
*
*/
private String blurry;
}

View File

@ -1,72 +0,0 @@
package com.mcwl.comment.domain;
import cn.hutool.core.collection.CollectionUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
/**
*
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
public class RequestPageEntity implements Serializable {
private static final int DEFAULT_PAGE_SIZE = 10;
/**
*
*/
private Integer pageNo = 1;
/**
* 10
*/
private Integer pageSize = DEFAULT_PAGE_SIZE;
/**
*
*/
private List<String> sortField;
/**
*
*
* @return
*/
public Integer getPageBegin() {
if (Objects.isNull(this.pageNo) || this.pageNo <= 0) {
this.pageNo = 1;
}
if (Objects.isNull(this.pageSize)) {
this.pageSize = DEFAULT_PAGE_SIZE;
}
return (this.pageNo - 1) * this.pageSize;
}
/**
*
*
* @return
*/
public String getSortString() {
List<String> sortField = this.getSortField();
if (CollectionUtil.isEmpty(sortField)) {
return null;
}
StringBuilder sortBuilder = new StringBuilder();
for (String field : sortField) {
String[] values = field.split(",");
sortBuilder.append(String.format("%s %s", values[0], values[1])).append(",");
}
return sortBuilder.deleteCharAt(sortBuilder.length() - 1).toString();
}
}

View File

@ -1,31 +0,0 @@
package com.mcwl.comment.mapper;
import com.mcwl.comment.domain.ProductCommentConditionEntity;
import com.mcwl.comment.domain.ProductCommentEntity;
import com.mcwl.common.web.BaseMapper;
import com.mcwl.resource.domain.MallProduct;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @AuthorChenYan
* @ProjectMcWl
* @Packagecom.mcwl.comment.mapper
* @FilenameCommentMapper
* @Description TODO
* @Date2025/1/4 19:04
*/
public interface CommentMapper extends BaseMapper<ProductCommentEntity, ProductCommentConditionEntity> {
MallProduct findById(@Param("id") Long id);
int insert(ProductCommentEntity productCommentEntity);
int upda(ProductCommentEntity productCommentEntity);
List<ProductCommentEntity> findByIds(List<Long> ids);
int deleteByIds(List<Long> ids, ProductCommentEntity productCommentEntity);
}

View File

@ -1,88 +0,0 @@
package com.mcwl.comment.service.impl;
import com.mcwl.comment.domain.ProductCommentConditionEntity;
import com.mcwl.comment.domain.ProductCommentEntity;
import com.mcwl.comment.mapper.CommentMapper;
import com.mcwl.common.core.domain.AjaxResult;
import com.mcwl.common.utils.AssertUtil;
import com.mcwl.common.utils.FillUserUtil;
import com.mcwl.common.utils.ResponsePageEntity;
import com.mcwl.common.utils.SecurityUtils;
import com.mcwl.common.utils.bean.BaseService;
import com.mcwl.common.web.BaseMapper;
import com.mcwl.resource.domain.MallProduct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
import static com.mcwl.common.utils.SecurityUtils.getUsername;
/**
* @AuthorChenYan
* @ProjectMcWl
* @Packagecom.mcwl.comment.service.impl
* @FilenameCommentServiceImpl
* @Description TODO
* @Date2025/1/4 19:04
*/
@Service
public class CommentServiceImpl extends BaseService<ProductCommentEntity, ProductCommentConditionEntity> {
@Autowired
private CommentMapper commentMapper;
public MallProduct findById(Long id) {
return commentMapper.findById(id);
}
public int insert(ProductCommentEntity productCommentEntity) {
// 获取当前用户
Long userId = SecurityUtils.getUserId();
productCommentEntity.setUserId(userId);
productCommentEntity.setCreateBy(getUsername());
checkParam(productCommentEntity);
return commentMapper.insert(productCommentEntity);
}
public int update(ProductCommentEntity productCommentEntity) {
// 获取当前用户
Long userId = SecurityUtils.getUserId();
productCommentEntity.setUserId(userId);
productCommentEntity.setUpdateBy(getUsername());
checkParam(productCommentEntity);
return commentMapper.upda(productCommentEntity);
}
public int deleteByIds(List<Long> ids) {
List<ProductCommentEntity> entities = commentMapper.findByIds(ids);
AssertUtil.notEmpty(entities, "商品评论已被删除");
ProductCommentEntity entity = new ProductCommentEntity();
FillUserUtil.fillUpdateUserInfo(entity);
return commentMapper.deleteByIds(ids, entity);
}
private void checkParam(ProductCommentEntity productCommentEntity) {
if (Objects.nonNull(productCommentEntity.getParentId()) && productCommentEntity.getParentId() > 0) {
MallProduct productEntity = commentMapper.findById(productCommentEntity.getParentId());
AssertUtil.notNull(productEntity, "该父评论在系统中不存在");
}
MallProduct userEntity = commentMapper.findById(productCommentEntity.getUserId());
AssertUtil.notNull(userEntity, "该用户在系统中不存在");
MallProduct productEntity = commentMapper.findById(productCommentEntity.getProductId());
AssertUtil.notNull(productEntity, "该商品在系统中不存在");
}
@Override
protected BaseMapper getBaseMapper() {
return commentMapper;
}
}

View File

@ -9,67 +9,30 @@
values (#{id}, #{parentId}, #{productId}, #{userId}, #{content}, #{rating}, #{createBy}, #{createTime},
#{updateBy}, #{updateTime}, #{remark}, #{delFlag})
</insert>
<update id="upda">
update mall_product_comment
<set>
<if test="parentId != null">
parent_id = #{parentId},
</if>
<if test="productId != null">
product_id = #{productId},
</if>
<if test="userId != null">
user_id = #{userId},
</if>
<if test="content != null">
content = #{content},
</if>
<if test="rating !=null">
rating = #{rating},
</if>
<if test="createBy != null">
create_by = #{createBy},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateBy != null">
update_by = #{updateBy},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="remark != null">
remark = #{remark},
</if>
<if test="delFlag != null">
del_flag = #{delFlag},
</if>
</set>
where id = #{id}
</update>
<update id="upda"></update>
<delete id="deleteByIds">
delete
from mall_product_comment
from model
where id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="findById" resultType="com.mcwl.resource.domain.MallProduct">
select productId,
userId,
productName,
detail,
model,
amount,
status,
name,
url,
zipUrl,
delFlag
from mall_product
<select id="findById" resultType="com.mcwl.resource.domain.ModelProduct">
select
id,
parent_id,
product_id,
user_id,
content,
create_by,
create_time,
update_by,
update_time,
remark,
del_flag
from model
where id = #{id}
</select>
<select id="findByIds" resultType="com.mcwl.comment.domain.ProductCommentEntity">
@ -79,7 +42,6 @@
product_id,
user_id,
content,
rating,
create_by,
create_time,
update_by,

View File

@ -0,0 +1,12 @@
package com.mcwl.common.constant;
public class ShopCodeConstants {
/**
*
*/
public static final String MODEL = "model-";
/**
* cf
*/
public static final String CF = "cf-";
}

View File

@ -58,6 +58,9 @@ public class SysUser extends BaseEntity
/** 密码 */
private String password;
/** 钱包 */
private Long wallet;
/** 帐号状态0正常 1停用 */
@Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
private String status;

View File

@ -32,6 +32,10 @@
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>${mybatis-plus.version}</version>
</dependency>
<dependency>
<groupId>com.mcwl</groupId>
<artifactId>mcwl-system</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -3,7 +3,9 @@ package com.mcwl.pay.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mcwl.common.domain.IdsParam;
import com.mcwl.pay.domain.OrderTrade;
import com.mcwl.pay.domain.PaymentResult;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
@ -23,6 +25,4 @@ public interface OrderTradeService extends IService<OrderTrade> {
int updateMallProduct(OrderTrade orderTrade);
}

View File

@ -3,6 +3,7 @@ package com.mcwl.pay.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mcwl.common.core.domain.entity.SysUser;
import com.mcwl.common.domain.IdsParam;
import com.mcwl.common.utils.StringUtils;
import com.mcwl.pay.domain.OrderTrade;
@ -10,11 +11,13 @@ import com.mcwl.pay.domain.PaymentResult;
import com.mcwl.pay.domain.enums.PaymentStatus;
import com.mcwl.pay.mapper.OrderTradeMapper;
import com.mcwl.pay.service.OrderTradeService;
import com.mcwl.system.service.impl.SysUserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
/**
* @AuthorChenYan
@ -27,6 +30,12 @@ import java.util.List;
@Service
public class OrderTradeServiceImpl extends ServiceImpl<OrderTradeMapper, OrderTrade> implements OrderTradeService {
@Autowired
private SysUserServiceImpl userExtensionService;
@Autowired
private OrderTradeService orderTradeService;
@Autowired
private OrderTradeMapper orderTradeMapper;
@ -73,19 +82,8 @@ public class OrderTradeServiceImpl extends ServiceImpl<OrderTradeMapper, OrderTr
@Override
public int insertMallProduct(OrderTrade orderTrade) {
PaymentResult paymentResult = orderTradeMapper.chargeCard(orderTrade.getTotalAmount(), orderTrade.getPaymentMethod());
if (paymentResult.isSuccess()) {
// 支付成功后的处理:更新订单状态、生成激活码、更新用户权限等
orderTrade.setOrderStatus(PaymentStatus.COMPLETED.ordinal());
// 保存订单
return orderTradeMapper.insert(orderTrade);
} else {
// 支付失败处理...
orderTrade.setOrderStatus(PaymentStatus.FAILED.ordinal());
}
return 0;
// 保存订单
return orderTradeMapper.insert(orderTrade);
}
@Override
@ -100,5 +98,4 @@ public class OrderTradeServiceImpl extends ServiceImpl<OrderTradeMapper, OrderTr
}

View File

@ -0,0 +1,11 @@
<?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.mcwl.pay.mapper.OrderTradeMapper">
<update id="chargeCard">
</update>
</mapper>

View File

@ -0,0 +1,62 @@
package com.mcwl.resource.domain;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @AuthorChenYan
* @ProjectMcWl
* @Packagecom.mcwl.resource.domain
* @FilenameModelImage
* @Description
* @Date2025/1/8 19:35
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
@TableName("model_image")
public class ModelImage {
/**
* ID
*/
private Long id;
/**
* 8
*/
private Long image_paths;
/**
*
*/
private Long has_watermark;
/**
*
*/
private Long is_member_download;
/**
*
*/
private Long is_not_downloadable;
/**
*
*/
private Long hide_gen_info;
/**
* 30
*/
private Long title;
/**
*
*/
private Long tags;
/**
* 500
*/
private Long description;
/**
* 0 2
*/
private Long del_flag;
}

View File

@ -10,70 +10,73 @@ import lombok.NoArgsConstructor;
import java.math.BigDecimal;
/**
*
* @AuthorChenYan
* @ProjectMcWl
* @Packagecom.mcwl.common.domain.resource
* @FilenameMallProduct
* @Description TODO
* @Description
* @Date2024/12/30 17:22
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
@TableName("mall_product")
public class MallProduct extends BaseEntity {
private static final long serialVersionUID = 1L;
@TableName("model")
public class ModelProduct extends BaseEntity {
/**
* ID
* ID
*/
@TableId
private Long productId;
private Long id;
/**
* ID
*
*/
private String modelName;
/***
* id
*/
private Long userId;
/**
*
* ID
*/
private String productName;
private Long modelTypeId;
/**
*
*
*/
private String detail;
private String category;
/**
*
*
*/
private String model;
private String functions;
/**
*
*
*/
private BigDecimal amount;
private String tags;
/**
* (0 1 2 3 4)
*
*/
private String status;
private String activityParticipation;
/**
*
*
*/
private String name;
private Integer isOriginal;
/**
* url
*
*/
private String url;
private String originalAuthorName;
/**
* url
*
*/
private String zipUrl;
private Integer real;
/**
*
*/
private Integer number;
/**
* 0 2
*/
private String delFlag;
/**
*
*/
private Long number;
}

View File

@ -0,0 +1,101 @@
package com.mcwl.resource.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.mcwl.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.locationtech.jts.noding.SegmentString;
/**
*
* @AuthorChenYan
* @ProjectMcWl
* @Packagecom.mcwl.resource.domain
* @FilenameModelVersion
* @Description TODO
* @Date2025/1/8 19:25
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
@TableName("model_version")
public class ModelVersion extends BaseEntity {
/**
* ID
*/
@TableId
private Long id;
/**
*
*/
private String versionName;
/**
* ID
*/
private Long modelTypeId;
/**
*
*/
private String filePath;
/**
*
*/
private String versionDescription;
/**
*
*/
private String triggerWords;
/**
*
*/
private Integer isPublic;
/**
* 线使
*/
private Integer isOnlineUse;
/**
*
*/
private Integer allowDownloadImage;
/**
* 使
*/
private Integer allowSoftwareUse;
/**
*
*/
private Integer allowFusion;
/**
*
*/
private Integer allowCommercialUse;
/**
* 使
*/
private Integer allowUsage;
/**
*
*/
private Integer isExclusiveModel;
/**
* 使
*/
private String sampleImagePaths;
/**
*
*/
private Integer hideImageGenInfo;
/**
*
*/
private String status;
/**
* 0 2
*/
private String delFlag;
}

View File

@ -0,0 +1,30 @@
package com.mcwl.resource.domain;
import com.baomidou.mybatisplus.annotation.TableName;
import com.mcwl.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @AuthorChenYan
* @ProjectMcWl
* @Packagecom.mcwl.resource.domain
* @FilenameToActivity
* @Description TODO
* @Date2025/1/8 19:23
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
@TableName("to_activity")
public class ToActivity extends BaseEntity {
/**
*
*/
private Long id;
/**
*
*/
private String activityName;
}

View File

@ -0,0 +1,59 @@
package com.mcwl.resource.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
*
* @AuthorChenYan
* @ProjectMcWl
* @Packagecom.mcwl.resource.domain
* @FilenameWorkFlow
* @Description
* @Version1.0
* @Date2025/1/8 19:38
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
@TableName("work_flow")
public class WorkFlow {
/**
* ID
*/
@TableId
private Long id;
/**
* 30
*/
private String workflowName;
/**
*
*/
private String category;
/**
*
*/
private String theme;
/**
*
*/
private String style;
/**
*
*/
private String functions;
/**
*
*/
private String activityParticipation;
/**
* 0 2
*/
private String del_flag;
}

View File

@ -0,0 +1,52 @@
package com.mcwl.resource.domain;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @AuthorChenYan
* @ProjectMcWl
* @Packagecom.mcwl.resource.domain
* @FilenameWorkFlow
* @Description TODO
* @Date2025/1/8 19:38
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
@TableName("work_flow_version")
public class WorkFlowVersion {
/**
* ID
*/
@TableId
private Long id;
/**
*
*/
private String versionName;
/**
*
*/
private String versionDescription;
/**
*
*/
private String filePath;
/**
* 20,
*/
private String imagePaths;
/**
*
*/
private String hideGenInfo;
/**
* 0 2
*/
private String delFlag;
}

View File

@ -0,0 +1,23 @@
package com.mcwl.resource.domain.enums;
/**
* @AuthorChenYan
* @ProjectMcWl
* @Packagecom.mcwl.resource.domain
* @FilenameOrderTypeEnum
* @Description TODO
* @Date2025/1/6 19:51
*/
public enum OrderTypeEnum {
TIME("time"), NUM("num");
private final String name;
OrderTypeEnum(String name) {
this.name = name;
}
public String getName() {
return name;
}
}

View File

@ -1,10 +1,13 @@
package com.mcwl.resource.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mcwl.resource.domain.MallProduct;
import com.mcwl.resource.domain.ModelProduct;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
/**
* @AuthorChenYan
* @ProjectMcWl
@ -14,10 +17,12 @@ import org.apache.ibatis.annotations.Param;
* @Date2024/12/30 18:23
*/
@Mapper
public interface MallProductMapper extends BaseMapper<MallProduct> {
public interface MallProductMapper extends BaseMapper<ModelProduct> {
String selectMallProductById(@Param("mallProductId") Long mallProductId);
Long sumNumber(@Param("userId") Long userId);
}

View File

@ -2,7 +2,7 @@ package com.mcwl.resource.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mcwl.common.core.domain.AjaxResult;
import com.mcwl.resource.domain.MallProduct;
import com.mcwl.resource.domain.ModelProduct;
import com.mcwl.resource.domain.vo.MallProductVo;
/**
@ -12,7 +12,7 @@ import com.mcwl.resource.domain.vo.MallProductVo;
*/
public interface MallProductLikeService {
Page<MallProduct> selectByUserLike(MallProductVo mallProductVo);
Page<ModelProduct> selectByUserLike(MallProductVo mallProductVo);
AjaxResult addLike(Long productId);

View File

@ -3,7 +3,7 @@ package com.mcwl.resource.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mcwl.common.domain.IdsParam;
import com.mcwl.resource.domain.MallProduct;
import com.mcwl.resource.domain.ModelProduct;
import com.mcwl.resource.domain.vo.MallProductVo;
import java.util.List;
@ -16,21 +16,23 @@ import java.util.List;
* @Description TODO
* @Date2024/12/30 18:20
*/
public interface MallProductService extends IService<MallProduct> {
public interface MallProductService extends IService<ModelProduct> {
List<MallProduct> selectMallProductList(MallProduct sysJob);
String selectMallProductById(Long mallProductId);
List<ModelProduct> selectMallProductList(ModelProduct sysJob);
int insertMallProduct(MallProduct mallProduct);
int updateMallProduct(MallProduct mallProduct);
int insertMallProduct(ModelProduct mallProduct);
int updateMallProduct(ModelProduct mallProduct);
void deleteMallProductByIds(IdsParam ids);
Page<MallProduct> selectByUserId(MallProductVo mallProductVo);
Page<ModelProduct> selectByUserId(MallProductVo mallProductVo);
Page<ModelProduct> pageLike(MallProductVo mallProductVo, List<Long> list);
Page<MallProduct> pageLike(MallProductVo mallProductVo, List<Long> list);
}

View File

@ -3,10 +3,11 @@ package com.mcwl.resource.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mcwl.common.core.domain.AjaxResult;
import com.mcwl.common.utils.SecurityUtils;
import com.mcwl.resource.domain.MallProduct;
import com.mcwl.resource.domain.MallProductLike;
import com.mcwl.resource.domain.ModelProduct;
import com.mcwl.resource.domain.vo.MallProductVo;
import com.mcwl.resource.mapper.MallProductLikeMapper;
import com.mcwl.resource.mapper.MallProductMapper;
import com.mcwl.resource.service.MallProductLikeService;
import com.mcwl.resource.service.MallProductService;
import org.springframework.beans.factory.annotation.Autowired;
@ -31,12 +32,11 @@ public class MallProductLikeServiceImpl implements MallProductLikeService {
private MallProductService mallProductService;
@Override
public Page<MallProduct> selectByUserLike(MallProductVo mallProductVo) {
public Page<ModelProduct> selectByUserLike(MallProductVo mallProductVo) {
//获取登录人
Long userId = SecurityUtils.getUserId();
List<Long> list = mallProductLikeMapper.selectByUserId(userId);
//分页查询作品数据
return mallProductService.pageLike(mallProductVo, list);
}

View File

@ -4,9 +4,10 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mcwl.common.core.redis.RedisCache;
import com.mcwl.common.domain.IdsParam;
import com.mcwl.common.utils.SecurityUtils;
import com.mcwl.resource.domain.MallProduct;
import com.mcwl.resource.domain.ModelProduct;
import com.mcwl.resource.mapper.MallProductMapper;
import com.mcwl.resource.service.MallProductService;
import com.mcwl.resource.domain.vo.MallProductVo;
@ -25,33 +26,30 @@ import java.util.List;
* @Date2024/12/30 18:22
*/
@Service
public class MallProductServiceImpl extends ServiceImpl<MallProductMapper,MallProduct> implements MallProductService {
public class MallProductServiceImpl extends ServiceImpl<MallProductMapper,ModelProduct> implements MallProductService {
@Autowired
private RedisCache redisCache;
@Autowired
private MallProductMapper postMapper;
@Override
public List<MallProduct> selectMallProductList(MallProduct mallProduct) {
QueryWrapper<MallProduct> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(MallProduct::getProductName, mallProduct.getProductName());
queryWrapper.lambda().eq(MallProduct::getName, mallProduct.getName());
queryWrapper.lambda().eq(MallProduct::getAmount, mallProduct.getAmount());
public List<ModelProduct> selectMallProductList(ModelProduct mallProduct) {
QueryWrapper<ModelProduct> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(ModelProduct::getModelName, mallProduct.getModelName());
queryWrapper.lambda().eq(ModelProduct::getOriginalAuthorName, mallProduct.getOriginalAuthorName());
return postMapper.selectList(queryWrapper);
}
@Override
public String selectMallProductById(Long mallProductId) {
return postMapper.selectMallProductById(mallProductId);
}
@Override
public int insertMallProduct(MallProduct mallProduct) {
public int insertMallProduct(ModelProduct mallProduct) {
return postMapper.insert(mallProduct);
}
@Override
public int updateMallProduct(MallProduct mallProduct) {
public int updateMallProduct(ModelProduct mallProduct) {
return postMapper.updateById(mallProduct);
}
@ -61,60 +59,55 @@ public class MallProductServiceImpl extends ServiceImpl<MallProductMapper,MallPr
}
@Override
public Page<MallProduct> selectByUserId(MallProductVo mallProductVo) {
public Page<ModelProduct> selectByUserId(MallProductVo mallProductVo) {
// 创建分页对象
Page<MallProduct> mallProductPage = new Page<>(mallProductVo.getPageNumber(), mallProductVo.getPageSize());
Page<ModelProduct> mallProductPage = new Page<>(mallProductVo.getPageNumber(), mallProductVo.getPageSize());
//获取当前登录人ID
Long userId = SecurityUtils.getUserId();
LambdaQueryWrapper<MallProduct> mallProductLambdaQueryWrapper = new LambdaQueryWrapper<>();
LambdaQueryWrapper<ModelProduct> mallProductLambdaQueryWrapper = new LambdaQueryWrapper<>();
mallProductLambdaQueryWrapper.eq(MallProduct::getUserId,userId);
mallProductLambdaQueryWrapper.eq(MallProduct::getDelFlag,0);
mallProductLambdaQueryWrapper.eq(ModelProduct::getUserId,userId);
mallProductLambdaQueryWrapper.eq(ModelProduct::getDelFlag,0);
if (mallProductVo.getStatus() != 0){
mallProductLambdaQueryWrapper.eq(MallProduct::getStatus,mallProductVo.getStatus());
}
if (mallProductVo.getOrder() == 1){
mallProductLambdaQueryWrapper.orderByDesc(MallProduct::getProductId);
}else {
mallProductLambdaQueryWrapper.orderByDesc(MallProduct::getNumber);
}
// 开始时间和结束时间过滤
if (mallProductVo.getStartTime() != null && mallProductVo.getEndTime() != null) {
// 查询开始时间和结束时间之间的商品
mallProductLambdaQueryWrapper.between(MallProduct::getCreateTime, mallProductVo.getStartTime(), mallProductVo.getEndTime());
mallProductLambdaQueryWrapper.between(ModelProduct::getCreateTime, mallProductVo.getStartTime(), mallProductVo.getEndTime());
} else if (mallProductVo.getStartTime() != null) {
// 只有开始时间,查询大于等于开始时间的商品
mallProductLambdaQueryWrapper.ge(MallProduct::getCreateTime, mallProductVo.getStartTime());
mallProductLambdaQueryWrapper.ge(ModelProduct::getCreateTime, mallProductVo.getStartTime());
} else if (mallProductVo.getEndTime() != null) {
// 只有结束时间,查询小于等于结束时间的商品
mallProductLambdaQueryWrapper.le(MallProduct::getCreateTime, mallProductVo.getEndTime());
mallProductLambdaQueryWrapper.le(ModelProduct::getCreateTime, mallProductVo.getEndTime());
}
return postMapper.selectPage(mallProductPage, mallProductLambdaQueryWrapper);
}
@Override
public Page<MallProduct> pageLike(MallProductVo mallProductVo, List<Long> list) {
public Page<ModelProduct> pageLike(MallProductVo mallProductVo, List<Long> list) {
// 创建分页对象
Page<MallProduct> mallProductPage = new Page<>(mallProductVo.getPageNumber(), mallProductVo.getPageSize());
Page<ModelProduct> mallProductPage = new Page<>(mallProductVo.getPageNumber(), mallProductVo.getPageSize());
LambdaQueryWrapper<MallProduct> mallProductLambdaQueryWrapper = new LambdaQueryWrapper<>();
mallProductLambdaQueryWrapper.in(MallProduct::getProductId,list);
LambdaQueryWrapper<ModelProduct> mallProductLambdaQueryWrapper = new LambdaQueryWrapper<>();
mallProductLambdaQueryWrapper.in(ModelProduct::getModelTypeId,list);
if (mallProductVo.getOrder() == 1){
mallProductLambdaQueryWrapper.orderByDesc(MallProduct::getProductId);
mallProductLambdaQueryWrapper.orderByDesc(ModelProduct::getModelTypeId);
}else {
mallProductLambdaQueryWrapper.orderByDesc(MallProduct::getNumber);
mallProductLambdaQueryWrapper.orderByDesc(ModelProduct::getNumber);
}
return postMapper.selectPage(mallProductPage,mallProductLambdaQueryWrapper);
}
}

View File

@ -5,27 +5,8 @@
<mapper namespace="com.mcwl.resource.mapper.MallProductMapper">
<select id="selectMallProductById" resultType="java.lang.String">
select product_id,
user_id,
product_name,
detail,
model,
amount,
name,
status,
zip_url,
url,
create_by,
create_time,
update_by,
update_time,
remark,
del_flag
from mall_product where product_id =#{mallProductId}
</select>
<select id="sumNumber" resultType="java.lang.Long">
SELECT sum(number)sum FROM mall_product where user_id = #{userId} ORDER BY(user_id);
SELECT sum(number)sum FROM model where user_id = #{userId} ORDER BY(user_id);
</select>
</mapper>

View File

@ -1,5 +1,6 @@
package com.mcwl.system.mapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.mcwl.common.core.domain.entity.SysUser;
import org.apache.ibatis.annotations.Param;
@ -132,4 +133,5 @@ public interface SysUserMapper
SysUser selectUserInfoById(@Param("userId") Long userId);
}

View File

@ -1,5 +1,6 @@
package com.mcwl.system.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.mcwl.common.annotation.DataScope;
import com.mcwl.common.constant.UserConstants;
import com.mcwl.common.core.domain.entity.SysRole;
@ -617,4 +618,5 @@ public class SysUserServiceImpl implements ISysUserService
return sb.toString();
}
}

View File

@ -1,237 +1,293 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mcwl.system.mapper.SysUserMapper">
<resultMap type="SysUser" id="SysUserResult">
<id property="userId" column="user_id" />
<result property="deptId" column="dept_id" />
<result property="userName" column="user_name" />
<result property="nickName" column="nick_name" />
<result property="email" column="email" />
<result property="phonenumber" column="phonenumber" />
<result property="sex" column="sex" />
<result property="avatar" column="avatar" />
<result property="password" column="password" />
<result property="status" column="status" />
<result property="delFlag" column="del_flag" />
<result property="loginIp" column="login_ip" />
<result property="loginDate" column="login_date" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<association property="dept" javaType="SysDept" resultMap="deptResult" />
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
<id property="userId" column="user_id"/>
<result property="deptId" column="dept_id"/>
<result property="userName" column="user_name"/>
<result property="nickName" column="nick_name"/>
<result property="email" column="email"/>
<result property="phonenumber" column="phonenumber"/>
<result property="sex" column="sex"/>
<result property="avatar" column="avatar"/>
<result property="password" column="password"/>
<result property="wallet" column="wallet"/>
<result property="status" column="status"/>
<result property="delFlag" column="del_flag"/>
<result property="loginIp" column="login_ip"/>
<result property="loginDate" column="login_date"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
<association property="dept" javaType="SysDept" resultMap="deptResult"/>
<collection property="roles" javaType="java.util.List" resultMap="RoleResult"/>
</resultMap>
<resultMap id="deptResult" type="SysDept">
<id property="deptId" column="dept_id" />
<result property="parentId" column="parent_id" />
<result property="deptName" column="dept_name" />
<result property="ancestors" column="ancestors" />
<result property="orderNum" column="order_num" />
<result property="leader" column="leader" />
<result property="status" column="dept_status" />
<id property="deptId" column="dept_id"/>
<result property="parentId" column="parent_id"/>
<result property="deptName" column="dept_name"/>
<result property="ancestors" column="ancestors"/>
<result property="orderNum" column="order_num"/>
<result property="leader" column="leader"/>
<result property="status" column="dept_status"/>
</resultMap>
<resultMap id="RoleResult" type="SysRole">
<id property="roleId" column="role_id" />
<result property="roleName" column="role_name" />
<result property="roleKey" column="role_key" />
<result property="roleSort" column="role_sort" />
<result property="dataScope" column="data_scope" />
<result property="status" column="role_status" />
<id property="roleId" column="role_id"/>
<result property="roleName" column="role_name"/>
<result property="roleKey" column="role_key"/>
<result property="roleSort" column="role_sort"/>
<result property="dataScope" column="data_scope"/>
<result property="status" column="role_status"/>
</resultMap>
<sql id="selectUserVo">
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
<sql id="selectUserVo">
select u.user_id,
u.dept_id,
u.user_name,
u.nick_name,
u.email,
u.avatar,
u.phonenumber,
u.password,
u.sex,
u.wallet,
u.status,
u.del_flag,
u.login_ip,
u.login_date,
u.create_by,
u.create_time,
u.remark,
d.dept_id,
d.parent_id,
d.ancestors,
d.dept_name,
d.order_num,
d.leader,
d.status as dept_status,
r.role_id,
r.role_name,
r.role_key,
r.role_sort,
r.data_scope,
r.status as role_status
from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
left join sys_user_role ur on u.user_id = ur.user_id
left join sys_role r on r.role_id = ur.role_id
left join sys_dept d on u.dept_id = d.dept_id
left join sys_user_role ur on u.user_id = ur.user_id
left join sys_role r on r.role_id = ur.role_id
</sql>
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
where u.del_flag = '0'
<if test="userId != null and userId != 0">
AND u.user_id = #{userId}
</if>
<if test="userName != null and userName != ''">
AND u.user_name like concat('%', #{userName}, '%')
</if>
<if test="status != null and status != ''">
AND u.status = #{status}
</if>
<if test="phonenumber != null and phonenumber != ''">
AND u.phonenumber like concat('%', #{phonenumber}, '%')
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(u.create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(u.create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
</if>
<if test="deptId != null and deptId != 0">
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</select>
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status,
u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user
u
left join sys_dept d on u.dept_id = d.dept_id
where u.del_flag = '0'
<if test="userId != null and userId != 0">
AND u.user_id = #{userId}
</if>
<if test="userName != null and userName != ''">
AND u.user_name like concat('%', #{userName}, '%')
</if>
<if test="status != null and status != ''">
AND u.status = #{status}
</if>
<if test="phonenumber != null and phonenumber != ''">
AND u.phonenumber like concat('%', #{phonenumber}, '%')
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(u.create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(u.create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
</if>
<if test="deptId != null and deptId != 0">
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId},
ancestors) ))
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</select>
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
left join sys_user_role ur on u.user_id = ur.user_id
left join sys_role r on r.role_id = ur.role_id
where u.del_flag = '0' and r.role_id = #{roleId}
<if test="userName != null and userName != ''">
AND u.user_name like concat('%', #{userName}, '%')
</if>
<if test="phonenumber != null and phonenumber != ''">
AND u.phonenumber like concat('%', #{phonenumber}, '%')
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</select>
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
left join sys_user_role ur on u.user_id = ur.user_id
left join sys_role r on r.role_id = ur.role_id
where u.del_flag = '0' and r.role_id = #{roleId}
<if test="userName != null and userName != ''">
AND u.user_name like concat('%', #{userName}, '%')
</if>
<if test="phonenumber != null and phonenumber != ''">
AND u.phonenumber like concat('%', #{phonenumber}, '%')
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</select>
<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
left join sys_user_role ur on u.user_id = ur.user_id
left join sys_role r on r.role_id = ur.role_id
where u.del_flag = '0' and (r.role_id != #{roleId} or r.role_id IS NULL)
and u.user_id not in (select u.user_id from sys_user u inner join sys_user_role ur on u.user_id = ur.user_id and ur.role_id = #{roleId})
<if test="userName != null and userName != ''">
AND u.user_name like concat('%', #{userName}, '%')
</if>
<if test="phonenumber != null and phonenumber != ''">
AND u.phonenumber like concat('%', #{phonenumber}, '%')
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</select>
<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
left join sys_user_role ur on u.user_id = ur.user_id
left join sys_role r on r.role_id = ur.role_id
where u.del_flag = '0' and (r.role_id != #{roleId} or r.role_id IS NULL)
and u.user_id not in (select u.user_id from sys_user u inner join sys_user_role ur on u.user_id = ur.user_id and
ur.role_id = #{roleId})
<if test="userName != null and userName != ''">
AND u.user_name like concat('%', #{userName}, '%')
</if>
<if test="phonenumber != null and phonenumber != ''">
AND u.phonenumber like concat('%', #{phonenumber}, '%')
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</select>
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
<include refid="selectUserVo"/>
where u.user_name = #{userName} and u.del_flag = '0'
</select>
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
<include refid="selectUserVo"/>
where u.user_name = #{userName} and u.del_flag = '0'
</select>
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
<include refid="selectUserVo"/>
where u.user_id = #{userId}
</select>
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
<include refid="selectUserVo"/>
where u.user_id = #{userId}
</select>
<select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult">
select user_id, user_name from sys_user where user_name = #{userName} and del_flag = '0' limit 1
</select>
<select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult">
select user_id, user_name
from sys_user
where user_name = #{userName}
and del_flag = '0' limit 1
</select>
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and del_flag = '0' limit 1
</select>
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
select user_id, phonenumber
from sys_user
where phonenumber = #{phonenumber}
and del_flag = '0' limit 1
</select>
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1
</select>
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
select user_id, email
from sys_user
where email = #{email}
and del_flag = '0' limit 1
</select>
<select id="selectUserByPhone" resultMap="SysUserResult">
<include refid="selectUserVo"/>
where u.phonenumber = #{phone} and u.del_flag = '0'
</select>
<select id="selectUserByPhone" resultMap="SysUserResult">
<include refid="selectUserVo"/>
where u.phonenumber = #{phone} and u.del_flag = '0'
</select>
<select id="selectUserInfoById" resultType="com.mcwl.common.core.domain.entity.SysUser">
select user_id,avatar,brief,nick_name from sys_user where user_id = #{userId}
</select>
<select id="selectUserInfoById" resultType="com.mcwl.common.core.domain.entity.SysUser">
select user_id, avatar, brief, nick_name
from sys_user
where user_id = #{userId}
</select>
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
insert into sys_user(
<if test="userId != null and userId != 0">user_id,</if>
<if test="deptId != null and deptId != 0">dept_id,</if>
<if test="userName != null and userName != ''">user_name,</if>
<if test="nickName != null and nickName != ''">nick_name,</if>
<if test="email != null and email != ''">email,</if>
<if test="avatar != null and avatar != ''">avatar,</if>
<if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
<if test="sex != null and sex != ''">sex,</if>
<if test="password != null and password != ''">password,</if>
<if test="status != null and status != ''">status,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="remark != null and remark != ''">remark,</if>
create_time
)values(
<if test="userId != null and userId != ''">#{userId},</if>
<if test="deptId != null and deptId != ''">#{deptId},</if>
<if test="userName != null and userName != ''">#{userName},</if>
<if test="nickName != null and nickName != ''">#{nickName},</if>
<if test="email != null and email != ''">#{email},</if>
<if test="avatar != null and avatar != ''">#{avatar},</if>
<if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
<if test="sex != null and sex != ''">#{sex},</if>
<if test="password != null and password != ''">#{password},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="remark != null and remark != ''">#{remark},</if>
sysdate()
)
</insert>
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
insert into sys_user(
<if test="userId != null and userId != 0">user_id,</if>
<if test="deptId != null and deptId != 0">dept_id,</if>
<if test="userName != null and userName != ''">user_name,</if>
<if test="nickName != null and nickName != ''">nick_name,</if>
<if test="email != null and email != ''">email,</if>
<if test="avatar != null and avatar != ''">avatar,</if>
<if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
<if test="sex != null and sex != ''">sex,</if>
<if test="password != null and password != ''">password,</if>
<if test="wallet != null and wallet != ''">wallet,</if>
<if test="status != null and status != ''">status,</if>
<update id="updateUser" parameterType="SysUser">
update sys_user
<set>
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
<if test="userName != null and userName != ''">user_name = #{userName},</if>
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
<if test="email != null ">email = #{email},</if>
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
<if test="sex != null and sex != ''">sex = #{sex},</if>
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
<if test="password != null and password != ''">password = #{password},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
<if test="loginDate != null">login_date = #{loginDate},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
update_time = sysdate()
</set>
where user_id = #{userId}
</update>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="remark != null and remark != ''">remark,</if>
create_time
)values(
<if test="userId != null and userId != ''">#{userId},</if>
<if test="deptId != null and deptId != ''">#{deptId},</if>
<if test="userName != null and userName != ''">#{userName},</if>
<if test="nickName != null and nickName != ''">#{nickName},</if>
<if test="email != null and email != ''">#{email},</if>
<if test="avatar != null and avatar != ''">#{avatar},</if>
<if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
<if test="sex != null and sex != ''">#{sex},</if>
<if test="password != null and password != ''">#{password},</if>
<if test="wallet != null and wallet != ''">#{wallet},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="remark != null and remark != ''">#{remark},</if>
sysdate()
)
</insert>
<update id="updateUserStatus" parameterType="SysUser">
update sys_user set status = #{status} where user_id = #{userId}
</update>
<update id="updateUser" parameterType="SysUser">
update sys_user
<set>
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
<if test="userName != null and userName != ''">user_name = #{userName},</if>
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
<if test="email != null ">email = #{email},</if>
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
<if test="sex != null and sex != ''">sex = #{sex},</if>
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
<if test="password != null and password != ''">password = #{password},</if>
<if test="wallet != null and wallet != ''">wallet = #{wallet},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
<if test="loginDate != null">login_date = #{loginDate},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
update_time = sysdate()
</set>
where user_id = #{userId}
</update>
<update id="updateUserAvatar" parameterType="SysUser">
update sys_user set avatar = #{avatar} where user_name = #{userName}
</update>
<update id="updateUserStatus" parameterType="SysUser">
update sys_user
set status = #{status}
where user_id = #{userId}
</update>
<update id="resetUserPwd" parameterType="SysUser">
update sys_user set password = #{password} where user_name = #{userName}
</update>
<update id="updateUserAvatar" parameterType="SysUser">
update sys_user
set avatar = #{avatar}
where user_name = #{userName}
</update>
<update id="updateUserInfo">
update sys_user set nick_name = #{nickName},
avatar = #{avatar},
brief = #{brief}
where user_id = #{userId}
</update>
<update id="resetUserPwd" parameterType="SysUser">
update sys_user
set password = #{password}
where user_name = #{userName}
</update>
<delete id="deleteUserById" parameterType="Long">
update sys_user set del_flag = '2' where user_id = #{userId}
</delete>
<update id="updateUserInfo">
update sys_user
set nick_name = #{nickName},
avatar = #{avatar},
brief = #{brief}
where user_id = #{userId}
</update>
<delete id="deleteUserByIds" parameterType="Long">
update sys_user set del_flag = '2' where user_id in
<foreach collection="array" item="userId" open="(" separator="," close=")">
#{userId}
<delete id="deleteUserById" parameterType="Long">
update sys_user
set del_flag = '2'
where user_id = #{userId}
</delete>
<delete id="deleteUserByIds" parameterType="Long">
update sys_user set del_flag = '2' where user_id in
<foreach collection="array" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
</delete>
</mapper>