Эх сурвалжийг харах

开发商户管理相关的接口

jinshihui 1 долоо хоног өмнө
parent
commit
c99721be0e
16 өөрчлөгдсөн 1004 нэмэгдсэн , 119 устгасан
  1. 53 15
      nightFragrance-admin/src/main/java/com/ylx/web/controller/massage/MaTechnicianController.java
  2. 1 1
      nightFragrance-admin/src/main/java/com/ylx/web/controller/massage/WeChatController.java
  3. 64 25
      nightFragrance-massage/src/main/java/com/ylx/massage/domain/MaProject.java
  4. 25 0
      nightFragrance-massage/src/main/java/com/ylx/massage/domain/MaTeProject.java
  5. 118 46
      nightFragrance-massage/src/main/java/com/ylx/massage/domain/MaTechnician.java
  6. 63 0
      nightFragrance-massage/src/main/java/com/ylx/massage/domain/dto/MaTechnicianMerchantAddDTO.java
  7. 73 0
      nightFragrance-massage/src/main/java/com/ylx/massage/domain/dto/MaTechnicianMerchantQueryDTO.java
  8. 138 0
      nightFragrance-massage/src/main/java/com/ylx/massage/domain/vo/MaTechnicianMerchantListVO.java
  9. 3 2
      nightFragrance-massage/src/main/java/com/ylx/massage/mapper/MaProjectMapper.java
  10. 21 0
      nightFragrance-massage/src/main/java/com/ylx/massage/mapper/MaTeProjectMapper.java
  11. 14 2
      nightFragrance-massage/src/main/java/com/ylx/massage/mapper/MaTechnicianMapper.java
  12. 24 1
      nightFragrance-massage/src/main/java/com/ylx/massage/service/IMaTechnicianService.java
  13. 209 15
      nightFragrance-massage/src/main/java/com/ylx/massage/service/impl/MaTechnicianServiceImpl.java
  14. 2 5
      nightFragrance-massage/src/main/java/com/ylx/project/domain/Project.java
  15. 12 0
      nightFragrance-massage/src/main/resources/mapper/massage/MaTeProjectMapper.xml
  16. 184 7
      nightFragrance-massage/src/main/resources/mapper/massage/MaTechnicianMapper.xml

+ 53 - 15
nightFragrance-admin/src/main/java/com/ylx/web/controller/massage/MaTechnicianController.java

@@ -3,7 +3,13 @@ package com.ylx.web.controller.massage;
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ylx.common.core.domain.R;
+import com.ylx.common.core.domain.model.LoginUser;
+import com.ylx.massage.domain.dto.MaTechnicianMerchantAddDTO;
+import com.ylx.massage.domain.dto.MaTechnicianMerchantQueryDTO;
 import com.ylx.massage.domain.vo.MaTechnicianAppAddVo;
+import com.ylx.massage.domain.vo.MaTechnicianMerchantListVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -34,8 +40,7 @@ import com.ylx.common.core.page.TableDataInfo;
 @Api("技师管理")
 @RestController
 @RequestMapping("/technician/technician")
-public class MaTechnicianController extends BaseController
-{
+public class MaTechnicianController extends BaseController {
     @Autowired
     private IMaTechnicianService maTechnicianService;
 
@@ -44,8 +49,7 @@ public class MaTechnicianController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('technician:technician:list')")
     @GetMapping("/list")
-    public TableDataInfo list(MaTechnician maTechnician)
-    {
+    public TableDataInfo list(MaTechnician maTechnician) {
         startPage();
         List<MaTechnician> list = maTechnicianService.selectMaTechnicianList(maTechnician);
         return getDataTable(list);
@@ -57,8 +61,7 @@ public class MaTechnicianController extends BaseController
     @PreAuthorize("@ss.hasPermi('technician:technician:export')")
     @Log(title = "技师", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, MaTechnician maTechnician)
-    {
+    public void export(HttpServletResponse response, MaTechnician maTechnician) {
         List<MaTechnician> list = maTechnicianService.selectMaTechnicianList(maTechnician);
         ExcelUtil<MaTechnician> util = new ExcelUtil<MaTechnician>(MaTechnician.class);
         util.exportExcel(response, list, "技师数据");
@@ -69,8 +72,7 @@ public class MaTechnicianController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('technician:technician:query')")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
         return success(maTechnicianService.selectMaTechnicianById(id));
     }
 
@@ -81,19 +83,56 @@ public class MaTechnicianController extends BaseController
     @PreAuthorize("@ss.hasPermi('technician:technician:add')")
     @Log(title = "技师", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody MaTechnicianAppAddVo maTechnicianAppAddVo)
-    {
+    public AjaxResult add(@RequestBody MaTechnicianAppAddVo maTechnicianAppAddVo) {
         return toAjax(maTechnicianService.insertMaTechnician(maTechnicianAppAddVo));
     }
 
+    /**
+     * 后台新增商户
+     *
+     * @param dto 商户新增DTO
+     * @return AjaxResult 结果
+     */
+    @ApiOperation("后台新增商户")
+    @PreAuthorize("@ss.hasPermi('technician:technician:add')")
+    @Log(title = "商户", businessType = BusinessType.INSERT)
+    @PostMapping("/merchant")
+    public AjaxResult addMerchant(@RequestBody MaTechnicianMerchantAddDTO dto) {
+        try {
+            LoginUser loginUser = getLoginUser();
+            return toAjax(maTechnicianService.insertMerchant(dto, loginUser));
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+    }
+
+    /**
+     * 查询商户列表
+     *
+     * @param page  分页参数
+     * @param dto 商户查询DTO
+     * @return Page 商户分页列表
+     */
+    @ApiOperation("后台查询商户列表")
+    @PreAuthorize("@ss.hasPermi('technician:technician:list')")
+    @GetMapping("/merchant/list")
+    public R<Page<MaTechnicianMerchantListVO>> merchantList(Page<MaTechnicianMerchantListVO> page, MaTechnicianMerchantQueryDTO dto) {
+        try {
+            return R.ok(maTechnicianService.selectMerchantList(page, dto));
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+    }
+
     /**
      * 修改技师
      */
     @PreAuthorize("@ss.hasPermi('technician:technician:edit')")
     @Log(title = "技师", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody MaTechnicianAppAddVo maTechnicianAppAddVo)
-    {
+    public AjaxResult edit(@RequestBody MaTechnicianAppAddVo maTechnicianAppAddVo) {
         return toAjax(maTechnicianService.updateMaTechnician(maTechnicianAppAddVo));
     }
 
@@ -102,9 +141,8 @@ public class MaTechnicianController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('technician:technician:remove')")
     @Log(title = "技师", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(maTechnicianService.deleteMaTechnicianByIds(ids));
     }
 }

+ 1 - 1
nightFragrance-admin/src/main/java/com/ylx/web/controller/massage/WeChatController.java

@@ -660,7 +660,7 @@ public class WeChatController extends BaseController {
         try {
             SMSVerificationCode smsVerificationCode = new SMSVerificationCode(String.valueOf(randNumber));
             String jsonString = JSON.toJSONString(smsVerificationCode);
-            sendSms.sendSms(phone, SendSmsEnum.SMS_220650023, jsonString);
+            sendSms.sendSms(phone, SendSmsEnum.SMS_220650024, jsonString);
             return R.ok("发送成功");
         } catch (Exception e) {
             e.printStackTrace();

+ 64 - 25
nightFragrance-massage/src/main/java/com/ylx/massage/domain/MaProject.java

@@ -16,99 +16,138 @@ import com.ylx.common.core.domain.BaseEntity;
  */
 @ApiModel(value = "MaProject", description = "服务项目")
 @Data
-public class MaProject extends BaseEntity
-{
+public class MaProject extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** id */
+    /**
+     * id
+     */
     @ApiModelProperty("id")
     private Long id;
-    /** 项目ID */
+    /**
+     * 项目ID
+     */
     @Excel(name = "项目ID")
     @ApiModelProperty("项目ID")
-    private String  projectId;
-    /** 项目名称 */
+    private String projectId;
+    /**
+     * 项目名称
+     */
     @Excel(name = "项目名称")
     @ApiModelProperty("项目名称")
     private String projectName;
 
-    /** 项目描述 */
+    /**
+     * 项目描述
+     */
     @Excel(name = "项目描述")
     @ApiModelProperty("项目描述")
     private String projectDescribe;
 
-    /** 项目时长(分) */
+    /**
+     * 项目时长(分)
+     */
     @Excel(name = "项目时长(分)")
     @ApiModelProperty("项目时长(分)")
     private Long projectDuration;
 
-    /** 项目选择人数 */
+    /**
+     * 项目选择人数
+     */
     @Excel(name = "项目选择人数")
     @ApiModelProperty("项目选择人数")
     private Long projectUsersNum;
 
-    /** 项目原价 */
+    /**
+     * 项目原价
+     */
     @Excel(name = "项目原价")
     @ApiModelProperty("项目原价")
     private BigDecimal projectOriginalPrice;
 
 
-    /** 项目价格上限 */
+    /**
+     * 项目价格上限
+     */
     @Excel(name = "项目价格上限")
     @ApiModelProperty("项目价格上限")
     private BigDecimal projectMaxPrice;
 
-    /** 项目价格下限 */
+    /**
+     * 项目价格下限
+     */
     @Excel(name = "项目价格下限")
     @ApiModelProperty("项目价格下限")
     private BigDecimal projectLowestPrice;
 
-    /** 我的售价 */
+    /**
+     * 我的售价
+     */
     @Excel(name = "我的售价")
     @ApiModelProperty("我的售价")
     private BigDecimal projectCurrentPrice;
-    /** 商户手机号 */
+    /**
+     * 商户手机号
+     */
     @Excel(name = "商户手机号")
     @ApiModelProperty("商户手机号")
     private String merchantPhone;
 
-    /** 项目主图 */
+    /**
+     * 项目主图
+     */
     @Excel(name = "项目主图")
     @ApiModelProperty("项目主图")
     private String projectMasterImage;
-    /** 商户类型:0-上门按摩,1-同城陪玩 */
+    /**
+     * 商户类型:0-上门按摩,1-同城陪玩
+     */
     @Excel(name = "商户类型:0-上门按摩,1-同城陪玩")
     @ApiModelProperty("商户类型:0-上门按摩,1-同城陪玩")
     private String merchantType;
 
-    /** 项目详情图 */
+    /**
+     * 项目详情图
+     */
     @Excel(name = "项目详情图")
     @ApiModelProperty("项目详情图")
     private String projectDetailImage;
 
-    /** 是否启用(0否1是) */
+    /**
+     * 是否启用(0否1是)
+     */
     @Excel(name = "是否启用(0否1是)")
     @ApiModelProperty("是否启用(0否1是)")
     private Long projectIsEnable;
-    /** 商户ID */
+    /**
+     * 商户ID
+     */
     @Excel(name = "商户ID")
     @ApiModelProperty("商户ID")
-    private String  userId;
-    /** 审核状态:0-待审核,1-审核通过,2-审核驳回 */
+    private String userId;
+    /**
+     * 审核状态:0-待审核,1-审核通过,2-审核驳回
+     */
     @Excel(name = "审核状态:0-待审核,1-审核通过,2-审核驳回")
     @ApiModelProperty("审核状态:0-待审核,1-审核通过,2-审核驳回")
-    private Integer  auditStatus;
-    /** 创建人 */
+    private Integer auditStatus;
+    /**
+     * 创建人
+     */
     @Excel(name = "创建人")
     @ApiModelProperty("创建人")
     private Long createUser;
 
-    /** 修改人 */
+    /**
+     * 修改人
+     */
     @Excel(name = "修改人")
     @ApiModelProperty("修改人")
     private Long updateUser;
 
-    /** 是否删除(0否1是) */
+    /**
+     * 是否删除(0否1是)
+     */
     @ApiModelProperty("是否删除(0否1是)")
     @Excel(name = "是否删除(0否1是)")
     private Long isDelete;

+ 25 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/domain/MaTeProject.java

@@ -0,0 +1,25 @@
+package com.ylx.massage.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+/**
+ * 商户服务项目关联对象 ma_te_project
+ */
+@Data
+@TableName("ma_te_project")
+public class MaTeProject {
+
+    /**
+     * 商户ID
+     */
+    @TableField("te_id")
+    private Long teId;
+
+    /**
+     * 项目ID
+     */
+    @TableField("project_id")
+    private Long projectId;
+}

+ 118 - 46
nightFragrance-massage/src/main/java/com/ylx/massage/domain/MaTechnician.java

@@ -14,7 +14,7 @@ import java.util.Date;
 
 
 /**
- * 技师对象 ma_technician
+ * 商户对象
  *
  * @author ylx
  * @date 2024-03-22
@@ -23,19 +23,24 @@ import java.util.Date;
 @Data
 @TableName("ma_technician")
 @Accessors(chain = true)
-public class MaTechnician extends BaseEntity
-{
+public class MaTechnician extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** id */
-    @TableId(type = IdType.ASSIGN_ID)
-    private String id;
+    /**
+     * id
+     */
+    @TableId(type = IdType.AUTO)
+    private Long id;
 
-    /** 姓名 */
+    /**
+     * 姓名
+     */
     @TableField("te_name")
     @Excel(name = "姓名")
     private String teName;
-    /** 昵称 */
+    /**
+     * 昵称
+     */
     @Excel(name = "昵称")
     @TableField("te_nick_name")
     private String teNickName;
@@ -45,7 +50,9 @@ public class MaTechnician extends BaseEntity
     @TableField("c_session_key")
     @ApiModelProperty("微信小程序登录会话密钥")
     private String cSessionKey;
-    /** 密码 */
+    /**
+     * 密码
+     */
     @Excel(name = "密码")
     @TableField("te_pass_word")
     private String tePassword;
@@ -55,17 +62,23 @@ public class MaTechnician extends BaseEntity
     @TableField("c_openid")
     @ApiModelProperty("用户的openId")
     private String cOpenid;
-    /** 性别(0女1男) */
+    /**
+     * 性别(0女1男)
+     */
     @Excel(name = "性别(0女1男)")
     @TableField("te_sex")
     private Integer teSex;
 
-    /** 电话 */
+    /**
+     * 电话
+     */
     @Excel(name = "电话")
     @TableField("te_phone")
     private String tePhone;
 
-    /** 合作意向城市 */
+    /**
+     * 合作意向城市
+     */
     @Excel(name = "合作意向城市")
     @TableField("te_address")
     private String teAddress;
@@ -78,103 +91,155 @@ public class MaTechnician extends BaseEntity
     /**
      * 年龄
      */
-    /** 年龄 */
+    /**
+     * 年龄
+     */
     @Excel(name = "年龄")
     @TableField("te_age")
     private Integer teAge;
 
-    /** 头像 */
+    /**
+     * 头像
+     */
     @Excel(name = "头像")
     @TableField("te_avatar")
     private String teAvatar;
-    /** 开通服务:1-上门按摩 2-同城玩乐 */
+    /**
+     * 开通服务:1-上门按摩 2-同城玩乐
+     */
     @Excel(name = "开通服务:1-上门按摩 2-同城玩乐")
     @TableField("openService")
     private Integer openService;
-    /** 生活照 */
+
+    /**
+     * 可服务项目
+     */
+    @TableField("te_project")
+    private String teProject;
+
+    /**
+     * 生活照
+     */
     @Excel(name = "生活照")
     @TableField("life_photos")
     private String lifePhotos;
 
-    /** 形象照 */
+    /**
+     * 形象照
+     */
     @Excel(name = "形象照")
     @TableField("avatar")
     private String avatar;
 
-    /** 身份证 */
+    /**
+     * 身份证
+     */
     @Excel(name = "身份证")
     @TableField("id_card")
     private String idCard;
 
-    /** 健康证 */
+    /**
+     * 健康证
+     */
     @Excel(name = "健康证")
     @TableField("health_certificate")
     private String healthCertificate;
 
-    /** 从业资格证 */
+    /**
+     * 从业资格证
+     */
     @Excel(name = "从业资格证")
     @TableField("qualification_certificate")
     private String qualificationCertificate;
 
-    /** 无犯罪证明 */
+    /**
+     * 无犯罪证明
+     */
     @Excel(name = "无犯罪证明")
     @TableField("no_crime_record")
     private String noCrimeRecord;
-    /** 宣传视频 */
+    /**
+     * 宣传视频
+     */
     @Excel(name = "宣传视频")
     @TableField("c_mr_address_id")
-    private String  promoVideo;
-    /** 承诺书 */
+    private String promoVideo;
+    /**
+     * 承诺书
+     */
     @Excel(name = "承诺书")
     @TableField("commitment_pdf")
     private String commitmentPdf;
-    /** 承诺录音 */
+    /**
+     * 承诺录音
+     */
     @Excel(name = "承诺录音")
     @TableField("commitment_audio")
     private String commitmentAudio;
-    /** 承诺录像 */
+    /**
+     * 承诺录像
+     */
     @Excel(name = "承诺录像")
     @TableField("commitment_video")
     private String commitmentVideo;
 
-    /** 简介 */
+    /**
+     * 简介
+     */
     @Excel(name = "简介")
     @TableField("te_brief")
     private String teBrief;
 
-    /** 服务状态(0服务中,1可服务) */
+    /**
+     * 服务状态(0服务中,1可服务)
+     */
     @Excel(name = "服务状态(0服务中,1可服务)")
     private Integer serviceState;
-    /** 上岗状态 (-1:未上岗 0:已上岗 1:已申请) */
+
+    /**
+     * 上岗状态 (-1:未上岗 0:已上岗 1:已申请)
+     */
     @Excel(name = "上岗状态 (-1:未上岗 0:已上岗 1:已申请)")
-    private Integer  nsStatus2;
-    /** 商户管理状态: 0-正常, 1-限制接单, 2-冻结, 3-注销 */
+    private Integer nStatus2;
+
+    /**
+     * 商户管理状态: 0-正常, 1-限制接单, 2-冻结, 3-注销
+     */
     @Excel(name = "商户管理状态: 0-正常, 1-限制接单, 2-冻结, 3-注销")
-    private String  merchantStatus;
-    /** 商户状态(0休息中1在线接单) */
+    private String merchantStatus;
+    /**
+     * 商户状态(0休息中1在线接单)
+     */
     @Excel(name = "商户状态(0休息中1在线接单)")
     private Integer postState;
-    /** 商户类型(0:真实商户 1:虚拟商户) */
+
+    /**
+     * 商户类型(0:真实商户 1:虚拟商户)
+     */
     @Excel(name = "商户类型(0:真实商户 1:虚拟商户)")
-    private Integer  techType;
-    /** 是否启用(0否1是) */
+    private Integer techType;
+
+    /**
+     * 是否启用(0否1是)
+     */
     @Excel(name = "是否启用(0否1是)")
     private Integer teIsEnable;
-    /** 审核状态:-1-申请入住,0-待入驻,1-待审核,2-审核通过,3-审核驳回*/
+
+    /**
+     * 审核状态:-1-申请入住,0-待入驻,1-待审核,2-审核通过,3-审核驳回
+     */
     @Excel(name = "审核状态:-1-申请入住,0-待入驻,1-待审核,2-审核通过,3-审核驳回")
     private Integer auditStatus;
-    /** 审批时间 */
+
+    /**
+     * 审批时间
+     */
     @Excel(name = "审批时间")
     private Date approveTime;
-    /** 创建人 */
-    @Excel(name = "创建人")
-    private Long createUser;
-
-    /** 修改人 */
-    @Excel(name = "修改人")
-    private Long updateUser;
 
-    /** 是否删除(0否1是) */
+    /**
+     * 是否删除(0否1是)
+     */
     @Excel(name = "是否删除(0否1是)")
     private Long isDelete;
 
@@ -193,5 +258,12 @@ public class MaTechnician extends BaseEntity
     @ApiModelProperty("已服务订单数量")
     private Integer nNum;
 
+    /**
+     * 是否推荐(0否1是)
+     */
+    @Excel(name = "是否推荐(0否1是)")
+    @TableField("is_recommend")
+    @ApiModelProperty("是否推荐")
+    private Integer isRecommend;
 
 }

+ 63 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/domain/dto/MaTechnicianMerchantAddDTO.java

@@ -0,0 +1,63 @@
+package com.ylx.massage.domain.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 后台新增商户请求参数
+ */
+@ApiModel(value = "MaTechnicianMerchantAddDTO", description = "后台新增商户请求参数")
+@Data
+public class MaTechnicianMerchantAddDTO {
+
+    /**
+     * 商户真实姓名。
+     */
+    @ApiModelProperty("姓名")
+    private String teName;
+
+    /**
+     * 商户在平台对外展示的昵称。
+     */
+    @ApiModelProperty("昵称")
+    private String teNickName;
+
+    /**
+     * 商户性别:0-女,1-男。
+     */
+    @ApiModelProperty("性别(0女1男)")
+    private Integer teSex;
+
+    /**
+     * 商户联系电话。
+     */
+    @ApiModelProperty("电话")
+    private String tePhone;
+
+    /**
+     * 商户开通的服务类目:1-上门按摩,2-陪玩
+     */
+    @ApiModelProperty("服务类目:1-上门按摩 2-陪玩")
+    private Integer openService;
+
+    /**
+     * 商户开通的服务项目ID集合。
+     */
+    @ApiModelProperty("服务项目ID集合")
+    private List<Long> projectIds;
+
+    /**
+     * 商户类型:0-真实商户,1-虚拟商户。
+     */
+    @ApiModelProperty("商户类型(0:真实商户 1:虚拟商户)")
+    private Integer techType;
+
+    /**
+     * 首页是否推荐:0-否,1-是
+     */
+    @ApiModelProperty("是否推荐(0否1是)")
+    private Integer isRecommend;
+}

+ 73 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/domain/dto/MaTechnicianMerchantQueryDTO.java

@@ -0,0 +1,73 @@
+package com.ylx.massage.domain.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 后台商户列表查询参数
+ */
+@ApiModel(value = "MaTechnicianMerchantQueryDTO", description = "后台商户列表查询参数")
+@Data
+public class MaTechnicianMerchantQueryDTO {
+
+    /**
+     * 商户姓名,支持模糊查询。
+     */
+    @ApiModelProperty("姓名")
+    private String teName;
+
+    /**
+     * 商户昵称,支持模糊查询。
+     */
+    @ApiModelProperty("昵称")
+    private String teNickName;
+
+    /**
+     * 服务类目:1-上门按摩,2-同城玩乐。
+     */
+    @ApiModelProperty("服务类目:1-上门按摩 2-同城玩乐")
+    private Integer openService;
+
+    /**
+     * 商户电话,支持模糊查询。
+     */
+    @ApiModelProperty("商户电话")
+    private String tePhone;
+
+    /**
+     * 注册开始时间,格式:yyyy-MM-dd HH:mm:ss。
+     */
+    @ApiModelProperty("注册开始时间")
+    private String beginCreateTime;
+
+    /**
+     * 注册结束时间,格式:yyyy-MM-dd HH:mm:ss。
+     */
+    @ApiModelProperty("注册结束时间")
+    private String endCreateTime;
+
+    /**
+     * 上架状态:0-下架,1-上架。
+     */
+    @ApiModelProperty("上架状态:0-下架 1-上架")
+    private Integer postState;
+
+    /**
+     * 性别:0-女,1-男。
+     */
+    @ApiModelProperty("性别:0-女 1-男")
+    private Integer teSex;
+
+    /**
+     * 服务状态:0-服务中,1-待接单,2-休息中。
+     */
+    @ApiModelProperty("服务状态:0-服务中 1-待接单 2-休息中")
+    private Integer serviceState;
+
+    /**
+     * 用户类型:0-正式用户,1-虚拟用户。
+     */
+    @ApiModelProperty("用户类型:0-正式用户 1-虚拟用户")
+    private Integer techType;
+}

+ 138 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/domain/vo/MaTechnicianMerchantListVO.java

@@ -0,0 +1,138 @@
+package com.ylx.massage.domain.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 后台商户列表展示对象
+ */
+@ApiModel(value = "MaTechnicianMerchantListVO", description = "后台商户列表展示对象")
+@Data
+public class MaTechnicianMerchantListVO {
+
+    /**
+     * 商户唯一标识。
+     */
+    @ApiModelProperty("商户ID")
+    private Long merchantId;
+
+    /**
+     * 商户真实姓名。
+     */
+    @ApiModelProperty("姓名")
+    private String teName;
+
+    /**
+     * 商户在平台对外展示的昵称。
+     */
+    @ApiModelProperty("昵称")
+    private String teNickName;
+
+    /**
+     * 商户性别编码:0-女,1-男。
+     */
+    @ApiModelProperty("性别:0-女 1-男")
+    private Integer teSex;
+
+    /**
+     * 商户性别展示名称。
+     */
+    @ApiModelProperty("性别名称")
+    private String teSexName;
+
+    /**
+     * 商户头像地址。
+     */
+    @ApiModelProperty("头像")
+    private String teAvatar;
+
+    /**
+     * 商户联系电话。
+     */
+    @ApiModelProperty("电话")
+    private String tePhone;
+
+    /**
+     * 平台评分。
+     */
+    @ApiModelProperty("评分")
+    private BigDecimal nStar;
+
+    /**
+     * 服务状态编码:0-服务中,1-待接单,2-休息中。
+     */
+    @ApiModelProperty("服务状态:0-服务中 1-待接单 2-休息中")
+    private Integer serviceState;
+
+    /**
+     * 服务状态展示名称。
+     */
+    @ApiModelProperty("服务状态名称")
+    private String serviceStateName;
+
+    /**
+     * 累计已服务订单数量。
+     */
+    @ApiModelProperty("已服务数量")
+    private Integer nNum;
+
+    /**
+     * 累计在线时长,单位:分钟。
+     */
+    @ApiModelProperty("累计在线时长,单位:分钟")
+    private Integer onlineTime;
+
+    /**
+     * 商户开通的服务类目或服务项目名称。
+     */
+    @ApiModelProperty("服务类目")
+    private String teProject;
+
+    /**
+     * 上架状态编码:0-下架,1-上架。
+     */
+    @ApiModelProperty("上架状态:0-下架 1-上架")
+    private Integer postState;
+
+    /**
+     * 首页是否推荐:0-否,1-是。
+     */
+    @ApiModelProperty("是否推荐:0-否 1-是")
+    private Integer isRecommend;
+
+    /**
+     * 用户类型编码:0-正式用户,1-虚拟用户。
+     */
+    @ApiModelProperty("用户类型:0-正式用户 1-虚拟用户")
+    private Integer techType;
+
+    /**
+     * 用户类型展示名称。
+     */
+    @ApiModelProperty("用户类型名称")
+    private String techTypeName;
+
+    /**
+     * 商户管理状态编码:0-正常,1-限制接单,2-冻结,3-注销。
+     */
+    @ApiModelProperty("管理状态:0-正常 1-限制接单 2-冻结 3-注销")
+    private String merchantStatus;
+
+    /**
+     * 商户管理状态展示名称。
+     */
+    @ApiModelProperty("管理状态名称")
+    private String merchantStatusName;
+
+    /**
+     * 商户创建时间。
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty("创建时间")
+    private Date createTime;
+}

+ 3 - 2
nightFragrance-massage/src/main/java/com/ylx/massage/mapper/MaProjectMapper.java

@@ -1,6 +1,8 @@
 package com.ylx.massage.mapper;
 
 import java.util.List;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ylx.massage.domain.MaProject;
 
 /**
@@ -9,8 +11,7 @@ import com.ylx.massage.domain.MaProject;
  * @author ylx
  * @date 2024-03-20
  */
-public interface MaProjectMapper
-{
+public interface MaProjectMapper extends BaseMapper<MaProject> {
     /**
      * 查询服务项目
      *

+ 21 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/mapper/MaTeProjectMapper.java

@@ -0,0 +1,21 @@
+package com.ylx.massage.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ylx.massage.domain.MaTeProject;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 商户服务项目关联Mapper接口
+ */
+public interface MaTeProjectMapper extends BaseMapper<MaTeProject> {
+
+    /**
+     * 批量新增商户服务项目关联
+     *
+     * @param entities 关联集合
+     * @return 影响行数
+     */
+    int insertBatch(@Param("entities") List<MaTeProject> entities);
+}

+ 14 - 2
nightFragrance-massage/src/main/java/com/ylx/massage/mapper/MaTechnicianMapper.java

@@ -3,8 +3,11 @@ package com.ylx.massage.mapper;
 import java.util.List;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ylx.massage.domain.MaTechnician;
+import com.ylx.massage.domain.dto.MaTechnicianMerchantQueryDTO;
 import com.ylx.massage.domain.dto.MassageRecommendDto;
+import com.ylx.massage.domain.vo.MaTechnicianMerchantListVO;
 import com.ylx.massage.domain.vo.MerchantVo;
 import org.apache.ibatis.annotations.Param;
 
@@ -14,8 +17,7 @@ import org.apache.ibatis.annotations.Param;
  * @author ylx
  * @date 2024-03-22
  */
-public interface MaTechnicianMapper extends BaseMapper<MaTechnician>
-{
+public interface MaTechnicianMapper extends BaseMapper<MaTechnician> {
     /**
      * 查询技师
      *
@@ -64,5 +66,15 @@ public interface MaTechnicianMapper extends BaseMapper<MaTechnician>
      */
     public int deleteMaTechnicianByIds(Long[] ids);
 
+    /**
+     * 后台查询商户列表
+     *
+     * @param page 分页参数
+     * @param dto 查询条件
+     * @return 商户分页列表
+     */
+    Page<MaTechnicianMerchantListVO> selectMerchantList(Page<MaTechnicianMerchantListVO> page,
+                                                        @Param("dto") MaTechnicianMerchantQueryDTO dto);
+
     List<MerchantVo> getMerchantRecommend(@Param("dto") MassageRecommendDto dto);
 }

+ 24 - 1
nightFragrance-massage/src/main/java/com/ylx/massage/service/IMaTechnicianService.java

@@ -1,10 +1,14 @@
 package com.ylx.massage.service;
 
 import java.util.List;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ylx.common.core.domain.model.LoginUser;
 import com.ylx.massage.domain.MaTechnician;
 import com.ylx.massage.domain.dto.MassageRecommendDto;
+import com.ylx.massage.domain.dto.MaTechnicianMerchantAddDTO;
+import com.ylx.massage.domain.dto.MaTechnicianMerchantQueryDTO;
 import com.ylx.massage.domain.vo.MaTechnicianAppAddVo;
-import com.ylx.massage.domain.vo.MassageRecommendVo;
+import com.ylx.massage.domain.vo.MaTechnicianMerchantListVO;
 import com.ylx.massage.domain.vo.MerchantVo;
 
 /**
@@ -39,6 +43,25 @@ public interface IMaTechnicianService
      */
     public int insertMaTechnician(MaTechnicianAppAddVo maTechnicianAppAddVo);
 
+    /**
+     * 后台新增商户
+     *
+     * @param dto 新增商户参数
+     * @param loginUser 当前登录用户
+     * @return 结果
+     */
+    public int insertMerchant(MaTechnicianMerchantAddDTO dto, LoginUser loginUser);
+
+    /**
+     * 后台查询商户列表
+     *
+     * @param page 分页参数
+     * @param dto 查询条件
+     * @return 商户分页列表
+     */
+    public Page<MaTechnicianMerchantListVO> selectMerchantList(Page<MaTechnicianMerchantListVO> page,
+                                                               MaTechnicianMerchantQueryDTO dto);
+
     /**
      * 修改技师
      *

+ 209 - 15
nightFragrance-massage/src/main/java/com/ylx/massage/service/impl/MaTechnicianServiceImpl.java

@@ -1,12 +1,29 @@
 package com.ylx.massage.service.impl;
 
+import java.util.ArrayList;
+import java.util.LinkedHashSet;
 import java.util.List;
+import java.util.Set;
 
+import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ylx.common.core.domain.model.LoginUser;
+import com.ylx.common.exception.ServiceException;
+import com.ylx.common.utils.DateUtils;
+import com.ylx.common.utils.StringUtils;
+import com.ylx.massage.domain.MaProject;
+import com.ylx.massage.domain.MaTeProject;
+import com.ylx.massage.domain.dto.MaTechnicianMerchantAddDTO;
+import com.ylx.massage.domain.dto.MaTechnicianMerchantQueryDTO;
 import com.ylx.massage.domain.dto.MassageRecommendDto;
 import com.ylx.massage.domain.vo.MaTechnicianAppAddVo;
-import com.ylx.massage.domain.vo.MassageRecommendVo;
+import com.ylx.massage.domain.vo.MaTechnicianMerchantListVO;
 import com.ylx.massage.domain.vo.MerchantVo;
+import com.ylx.massage.mapper.MaProjectMapper;
+import com.ylx.massage.mapper.MaTeProjectMapper;
+import com.ylx.project.domain.Project;
+import com.ylx.project.mapper.ProjectMapper;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -24,11 +41,24 @@ import org.springframework.transaction.annotation.Transactional;
 @Service
 public class MaTechnicianServiceImpl implements IMaTechnicianService
 {
+    private static final int SERVICE_STATE_AVAILABLE = 1;
+    private static final int POST_STATE_OFFLINE = 0;
+    private static final int ENABLED = 1;
+    private static final int DEFAULT_AGE = 18;
+    private static final int AUDIT_APPROVED = 2;
+    private static final int NS_STATUS_NOT_ON_DUTY = -1;
+    private static final int DEFAULT_STAT_VALUE = 0;
+    private static final long NOT_DELETED = 0L;
+    private static final String MERCHANT_STATUS_NORMAL = "0";
+
     @Autowired
     private MaTechnicianMapper maTechnicianMapper;
 
+    @Autowired
+    private MaTeProjectMapper maTeProjectMapper;
 
-
+    @Autowired
+    private ProjectMapper projectMapper;
 
     /**
      * 查询技师
@@ -64,22 +94,82 @@ public class MaTechnicianServiceImpl implements IMaTechnicianService
     @Transactional(rollbackFor = Exception.class)
     public int insertMaTechnician(MaTechnicianAppAddVo maTechnicianAppAddVo)
     {
-        int i = 0;
         MaTechnician maTechnician = new MaTechnician();
         BeanUtils.copyProperties(maTechnicianAppAddVo, maTechnician);
-        maTechnicianMapper.insertMaTechnician(maTechnician);
-        if (!maTechnicianAppAddVo.getProjectIds().isEmpty()) {
-//            ArrayList<MaTeProject> objects = Lists.newArrayList();
-//            ArrayList<Long> projectIds = maTechnicianAppAddVo.getProjectIds();
-//            projectIds.forEach(id->{
-//                MaTeProject maTeProject = new MaTeProject();
-//                maTeProject.setTeId(maTechnician.getId());
-//                maTeProject.setProjectId(id);
-//                objects.add(maTeProject);
-//            });
-//            i = maTeProjectMapper.insertBatch(objects);
+        int rows = maTechnicianMapper.insertMaTechnician(maTechnician);
+        if (maTechnicianAppAddVo.getProjectIds() != null && !maTechnicianAppAddVo.getProjectIds().isEmpty()) {
+            insertProjectRelations(maTechnician.getId(), new LinkedHashSet<>(maTechnicianAppAddVo.getProjectIds()));
         }
-        return i;
+        return rows;
+    }
+
+    /**
+     * 后台新增商户
+     *
+     * @param dto 新增商户参数
+     * @param loginUser 当前登录用户
+     * @return 结果
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public int insertMerchant(MaTechnicianMerchantAddDTO dto, LoginUser loginUser) {
+        Set<Long> projectIds = checkMerchantAddParam(dto);
+        String userName = loginUser.getUser().getUserName();
+
+        MaTechnician maTechnician = new MaTechnician();
+        maTechnician.setTeName(dto.getTeName().trim());
+        maTechnician.setTeNickName(dto.getTeNickName().trim());
+        maTechnician.setTeSex(dto.getTeSex());
+        maTechnician.setTePhone(dto.getTePhone().trim());
+        maTechnician.setOpenService(dto.getOpenService());
+        dto.getProjectIds().forEach(projectId -> {
+            Project project = projectMapper.selectById(projectId);
+            if (project != null) {
+                maTechnician.setTeProject(project.getTitle() + ",");
+            }
+        });
+        //移除末尾的逗号
+        maTechnician.setTeProject(StrUtil.removeSuffix(maTechnician.getTeProject(), ","));
+
+        maTechnician.setTechType(dto.getTechType());
+        maTechnician.setIsRecommend(normalizeSwitchValue(dto.getIsRecommend(), "是否推荐"));
+
+        maTechnician.setServiceState(SERVICE_STATE_AVAILABLE);
+        maTechnician.setPostState(POST_STATE_OFFLINE);
+        maTechnician.setTeIsEnable(ENABLED);
+        //上岗状态:默认-1 未上岗
+        maTechnician.setNStatus2(NS_STATUS_NOT_ON_DUTY);
+        maTechnician.setMerchantStatus(MERCHANT_STATUS_NORMAL);
+        //审核状态
+        maTechnician.setAuditStatus(AUDIT_APPROVED);
+        maTechnician.setTeAddress("");
+        maTechnician.setNStar(DEFAULT_STAT_VALUE);
+        maTechnician.setNNum(DEFAULT_STAT_VALUE);
+        maTechnician.setCreateBy(userName);
+        maTechnician.setUpdateBy(userName);
+        maTechnician.setCreateTime(DateUtils.getNowDate());
+        maTechnician.setUpdateTime(DateUtils.getNowDate());
+
+        int rows = maTechnicianMapper.insert(maTechnician);
+        if (rows <= 0) {
+            throw new ServiceException("新增商户失败");
+        }
+        insertProjectRelations(maTechnician.getId(), projectIds);
+        return rows;
+    }
+
+    /**
+     * 后台查询商户列表
+     *
+     * @param page 分页参数
+     * @param dto 查询条件
+     * @return 商户分页列表
+     */
+    @Override
+    public Page<MaTechnicianMerchantListVO> selectMerchantList(Page<MaTechnicianMerchantListVO> page,
+                                                               MaTechnicianMerchantQueryDTO dto) {
+        Page<MaTechnicianMerchantListVO> pageParam = page == null ? new Page<>(1, 10) : page;
+        return maTechnicianMapper.selectMerchantList(pageParam, dto);
     }
 
     /**
@@ -143,4 +233,108 @@ public class MaTechnicianServiceImpl implements IMaTechnicianService
     public List<MerchantVo> getMerchantRecommend(MassageRecommendDto dto) {
         return maTechnicianMapper.getMerchantRecommend(dto);
     }
+
+    private Set<Long> checkMerchantAddParam(MaTechnicianMerchantAddDTO dto) {
+        if (dto == null) {
+            throw new ServiceException("商户参数不能为空");
+        }
+        checkRequiredText(dto.getTeName(), "姓名", 10);
+        checkRequiredText(dto.getTeNickName(), "昵称", 10);
+        checkRequiredText(dto.getTePhone(), "电话", 11);
+        checkEnumValue(dto.getTeSex(), "性别", 0, 1);
+        //checkEnumValue(dto.getOpenService(), "服务类目", 1, 2);
+        //校验服务类名不能为空
+        if (dto.getOpenService() == null) {
+            throw new ServiceException("服务类目不能为空");
+        }
+        checkEnumValue(dto.getTechType(), "商户类型", 0, 1);
+        if (dto.getIsRecommend() != null) {
+            checkEnumValue(dto.getIsRecommend(), "是否推荐", 0, 1);
+        }
+        return checkProjectIds(dto.getProjectIds());
+    }
+
+    private void checkRequiredText(String value, String fieldName, int maxLength) {
+        if (StringUtils.isBlank(value)) {
+            throw new ServiceException(fieldName + "不能为空");
+        }
+        if (value.trim().length() > maxLength) {
+            throw new ServiceException(fieldName + "长度不能超过" + maxLength + "个字符");
+        }
+    }
+
+    private void checkEnumValue(Integer value, String fieldName, int... allowedValues) {
+        if (value == null) {
+            throw new ServiceException(fieldName + "不能为空");
+        }
+        for (int allowedValue : allowedValues) {
+            if (value == allowedValue) {
+                return;
+            }
+        }
+        throw new ServiceException(fieldName + "值不正确");
+    }
+
+    private Integer normalizeSwitchValue(Integer value, String fieldName) {
+        if (value == null) {
+            return 0;
+        }
+        checkEnumValue(value, fieldName, 0, 1);
+        return value;
+    }
+
+    /**
+     * 校验服务项目ID集合
+     * @param projectIds
+     * @return 有效服务项目ID集合
+     */
+    private Set<Long> checkProjectIds(List<Long> projectIds) {
+        if (projectIds == null || projectIds.isEmpty()) {
+            throw new ServiceException("服务项目不能为空");
+        }
+
+        Set<Long> distinctProjectIds = new LinkedHashSet<>();
+        for (Long projectId : projectIds) {
+            if (projectId == null) {
+                throw new ServiceException("服务项目ID不能为空");
+            }
+            distinctProjectIds.add(projectId);
+        }
+
+        /*int validCount = 0;
+        for (Long projectId : distinctProjectIds) {
+            MaProject project = maProjectMapper.selectMaProjectById(projectId);
+            if (project != null && (project.getIsDelete() == null || project.getIsDelete() != 1)) {
+                validCount++;
+            }
+        }
+        if (validCount != distinctProjectIds.size()) {
+            throw new ServiceException("服务项目不存在或已删除");
+        }*/
+        return distinctProjectIds;
+    }
+
+    /**
+     * 新增商户与服务项目关联关系
+     *
+     * @param technicianId
+     * @param projectIds
+     */
+    private void insertProjectRelations(Long technicianId, Set<Long> projectIds) {
+        if (technicianId == null) {
+            throw new ServiceException("商户ID不能为空");
+        }
+
+        List<MaTeProject> relations = new ArrayList<>();
+        for (Long projectId : projectIds) {
+            MaTeProject relation = new MaTeProject();
+            relation.setTeId(technicianId);
+            relation.setProjectId(projectId);
+            relations.add(relation);
+        }
+        int rows = maTeProjectMapper.insertBatch(relations);
+        if (rows != relations.size()) {
+            throw new ServiceException("新增商户服务项目失败");
+        }
+    }
 }

+ 2 - 5
nightFragrance-massage/src/main/java/com/ylx/project/domain/Project.java

@@ -1,9 +1,6 @@
 package com.ylx.project.domain;
 
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableLogic;
-import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.*;
 import com.ylx.common.core.domain.BaseEntity;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -24,7 +21,7 @@ public class Project extends BaseEntity {
      * 主键ID。
      */
     @ApiModelProperty("id")
-    @TableId("id")
+    @TableId(value = "id", type = IdType.AUTO)
     private Integer id;
 
     /**

+ 12 - 0
nightFragrance-massage/src/main/resources/mapper/massage/MaTeProjectMapper.xml

@@ -0,0 +1,12 @@
+<?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.ylx.massage.mapper.MaTeProjectMapper">
+
+    <insert id="insertBatch">
+        insert into ma_te_project(te_id, project_id)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.teId}, #{entity.projectId})
+        </foreach>
+    </insert>
+</mapper>

+ 184 - 7
nightFragrance-massage/src/main/resources/mapper/massage/MaTechnicianMapper.xml

@@ -7,41 +7,63 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap type="MaTechnician" id="MaTechnicianResult">
         <result property="id"    column="id"    />
         <result property="teName"    column="te_name"    />
+        <result property="teNickName"    column="te_nick_name"    />
         <result property="teSex"    column="te_sex"    />
         <result property="tePhone"    column="te_phone"    />
         <result property="teAddress"    column="te_address"    />
+        <result property="teAreaCode"    column="te_area_code"    />
         <result property="teAge"    column="te_age"    />
         <result property="teAvatar"    column="te_avatar"    />
+        <result property="openService"    column="openService"    />
         <result property="lifePhotos"    column="life_photos"    />
+        <result property="avatar"    column="avatar"    />
         <result property="teBrief"    column="te_brief"    />
         <result property="serviceState"    column="service_state"    />
+        <result property="nStatus2"    column="n_status2"    />
+        <result property="merchantStatus"    column="merchant_status"    />
         <result property="postState"    column="post_state"    />
+        <result property="techType"    column="tech_type"    />
         <result property="teIsEnable"    column="te_is_enable"    />
+        <result property="auditStatus"    column="audit_status"    />
         <result property="createUser"    column="create_user"    />
         <result property="updateUser"    column="update_user"    />
         <result property="createTime"    column="create_time"    />
         <result property="updateTime"    column="update_time"    />
         <result property="isDelete"    column="is_delete"    />
+        <result property="nStar"    column="n_star"    />
+        <result property="nNum"    column="n_num"    />
+        <result property="isRecommend"    column="is_recommend"    />
     </resultMap>
 
     <sql id="selectMaTechnicianVo">
-        select id, te_name, te_sex, te_phone, te_address, te_age, te_avatar, life_photos, te_brief, service_state, post_state, te_is_enable, create_user, update_user, create_time, update_time, is_delete from ma_technician
+        select id, te_name, te_nick_name, te_sex, te_phone, te_address, te_area_code, te_age, te_avatar,
+               openService, life_photos, avatar, te_brief, service_state, ns_status2, merchant_status,
+               post_state, tech_type, te_is_enable, audit_status, create_user, update_user, create_time,
+               update_time, is_delete, n_star, n_num, is_recommend
+        from ma_technician
     </sql>
 
     <select id="selectMaTechnicianList" parameterType="MaTechnician" resultMap="MaTechnicianResult">
         <include refid="selectMaTechnicianVo"/>
         <where>
             <if test="teName != null  and teName != ''"> and te_name like concat('%', #{teName}, '%')</if>
+            <if test="teNickName != null  and teNickName != ''"> and te_nick_name like concat('%', #{teNickName}, '%')</if>
             <if test="teSex != null "> and te_sex = #{teSex}</if>
             <if test="tePhone != null  and tePhone != ''"> and te_phone = #{tePhone}</if>
             <if test="teAddress != null  and teAddress != ''"> and te_address = #{teAddress}</if>
+            <if test="openService != null "> and openService = #{openService}</if>
             <if test="teAge != null "> and te_age = #{teAge}</if>
             <if test="teAvatar != null  and teAvatar != ''"> and te_avatar = #{teAvatar}</if>
             <if test="lifePhotos != null  and lifePhotos != ''"> and life_photos = #{lifePhotos}</if>
             <if test="teBrief != null  and teBrief != ''"> and te_brief = #{teBrief}</if>
             <if test="serviceState != null "> and service_state = #{serviceState}</if>
+            <if test="nsStatus2 != null "> and ns_status2 = #{nsStatus2}</if>
+            <if test="merchantStatus != null  and merchantStatus != ''"> and merchant_status = #{merchantStatus}</if>
             <if test="postState != null "> and post_state = #{postState}</if>
+            <if test="techType != null "> and tech_type = #{techType}</if>
             <if test="teIsEnable != null "> and te_is_enable = #{teIsEnable}</if>
+            <if test="auditStatus != null "> and audit_status = #{auditStatus}</if>
+            <if test="isRecommend != null "> and is_recommend = #{isRecommend}</if>
             <if test="createUser != null "> and create_user = #{createUser}</if>
             <if test="updateUser != null "> and update_user = #{updateUser}</if>
             <if test="isDelete != null "> and is_delete = #{isDelete}</if>
@@ -57,39 +79,63 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         insert into ma_technician
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="teName != null and teName != ''">te_name,</if>
+            <if test="teNickName != null and teNickName != ''">te_nick_name,</if>
             <if test="teSex != null">te_sex,</if>
             <if test="tePhone != null and tePhone != ''">te_phone,</if>
-            <if test="teAddress != null and teAddress != ''">te_address,</if>
+            <if test="teAddress != null">te_address,</if>
+            <if test="teAreaCode != null and teAreaCode != ''">te_area_code,</if>
             <if test="teAge != null">te_age,</if>
             <if test="teAvatar != null and teAvatar != ''">te_avatar,</if>
+            <if test="openService != null">openService,</if>
+            <if test="teProject != null and teProject != ''">te_project,</if>
             <if test="lifePhotos != null and lifePhotos != ''">life_photos,</if>
+            <if test="avatar != null and avatar != ''">avatar,</if>
             <if test="teBrief != null and teBrief != ''">te_brief,</if>
             <if test="serviceState != null">service_state,</if>
+            <if test="nStatus2 != null">n_status2,</if>
+            <if test="merchantStatus != null and merchantStatus != ''">merchant_status,</if>
             <if test="postState != null">post_state,</if>
+            <if test="techType != null">tech_type,</if>
             <if test="teIsEnable != null">te_is_enable,</if>
-            <if test="createUser != null">create_user,</if>
-            <if test="updateUser != null">update_user,</if>
+            <if test="auditStatus != null">audit_status,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="updateBy != null">update_by,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="isDelete != null">is_delete,</if>
+            <if test="nStar != null">n_star,</if>
+            <if test="nNum != null">n_num,</if>
+            <if test="isRecommend != null">is_recommend,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="teName != null and teName != ''">#{teName},</if>
+            <if test="teNickName != null and teNickName != ''">#{teNickName},</if>
             <if test="teSex != null">#{teSex},</if>
             <if test="tePhone != null and tePhone != ''">#{tePhone},</if>
-            <if test="teAddress != null and teAddress != ''">#{teAddress},</if>
+            <if test="teAddress != null">#{teAddress},</if>
+            <if test="teAreaCode != null and teAreaCode != ''">#{teAreaCode},</if>
             <if test="teAge != null">#{teAge},</if>
             <if test="teAvatar != null and teAvatar != ''">#{teAvatar},</if>
+            <if test="openService != null">#{openService},</if>
+            <if test="teProject != null and teProject != ''">#{teProject},</if>
             <if test="lifePhotos != null and lifePhotos != ''">#{lifePhotos},</if>
+            <if test="avatar != null and avatar != ''">#{avatar},</if>
             <if test="teBrief != null and teBrief != ''">#{teBrief},</if>
             <if test="serviceState != null">#{serviceState},</if>
+            <if test="nStatus2 != null">#{nStatus2},</if>
+            <if test="merchantStatus != null and merchantStatus != ''">#{merchantStatus},</if>
             <if test="postState != null">#{postState},</if>
+            <if test="techType != null">#{techType},</if>
             <if test="teIsEnable != null">#{teIsEnable},</if>
-            <if test="createUser != null">#{createUser},</if>
-            <if test="updateUser != null">#{updateUser},</if>
+            <if test="auditStatus != null">#{auditStatus},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="updateBy != null">#{updateBy},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="isDelete != null">#{isDelete},</if>
+            <if test="nStar != null">#{nStar},</if>
+            <if test="nNum != null">#{nNum},</if>
+            <if test="isRecommend != null">#{isRecommend},</if>
          </trim>
     </insert>
 
@@ -97,21 +143,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         update ma_technician
         <trim prefix="SET" suffixOverrides=",">
             <if test="teName != null and teName != ''">te_name = #{teName},</if>
+            <if test="teNickName != null and teNickName != ''">te_nick_name = #{teNickName},</if>
             <if test="teSex != null">te_sex = #{teSex},</if>
             <if test="tePhone != null and tePhone != ''">te_phone = #{tePhone},</if>
             <if test="teAddress != null and teAddress != ''">te_address = #{teAddress},</if>
+            <if test="teAreaCode != null and teAreaCode != ''">te_area_code = #{teAreaCode},</if>
             <if test="teAge != null">te_age = #{teAge},</if>
             <if test="teAvatar != null and teAvatar != ''">te_avatar = #{teAvatar},</if>
+            <if test="openService != null">openService = #{openService},</if>
             <if test="lifePhotos != null and lifePhotos != ''">life_photos = #{lifePhotos},</if>
+            <if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
             <if test="teBrief != null and teBrief != ''">te_brief = #{teBrief},</if>
             <if test="serviceState != null">service_state = #{serviceState},</if>
+            <if test="nsStatus2 != null">ns_status2 = #{nsStatus2},</if>
+            <if test="merchantStatus != null and merchantStatus != ''">merchant_status = #{merchantStatus},</if>
             <if test="postState != null">post_state = #{postState},</if>
+            <if test="techType != null">tech_type = #{techType},</if>
             <if test="teIsEnable != null">te_is_enable = #{teIsEnable},</if>
+            <if test="auditStatus != null">audit_status = #{auditStatus},</if>
             <if test="createUser != null">create_user = #{createUser},</if>
             <if test="updateUser != null">update_user = #{updateUser},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="isDelete != null">is_delete = #{isDelete},</if>
+            <if test="nStar != null">n_star = #{nStar},</if>
+            <if test="nNum != null">n_num = #{nNum},</if>
+            <if test="isRecommend != null">is_recommend = #{isRecommend},</if>
         </trim>
         where id = #{id}
     </update>
@@ -126,6 +183,126 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </delete>
+
+    <resultMap type="com.ylx.massage.domain.vo.MaTechnicianMerchantListVO" id="MaTechnicianMerchantListResult">
+        <result property="merchantId" column="merchant_id"/>
+        <result property="teName" column="te_name"/>
+        <result property="teNickName" column="te_nick_name"/>
+        <result property="teSex" column="te_sex"/>
+        <result property="teSexName" column="te_sex_name"/>
+        <result property="teAvatar" column="te_avatar"/>
+        <result property="tePhone" column="te_phone"/>
+        <result property="nStar" column="n_star"/>
+        <result property="serviceState" column="service_state"/>
+        <result property="serviceStateName" column="service_state_name"/>
+        <result property="nNum" column="n_num"/>
+        <result property="onlineTime" column="online_time"/>
+        <result property="teProject" column="te_project"/>
+        <result property="postState" column="post_state"/>
+        <result property="isRecommend" column="is_recommend"/>
+        <result property="techType" column="tech_type"/>
+        <result property="techTypeName" column="tech_type_name"/>
+        <result property="merchantStatus" column="merchant_status"/>
+        <result property="merchantStatusName" column="merchant_status_name"/>
+        <result property="createTime" column="create_time"/>
+    </resultMap>
+
+    <select id="selectMerchantList" resultMap="MaTechnicianMerchantListResult">
+        SELECT
+            t.id AS merchant_id,
+            t.te_name,
+            t.te_nick_name,
+            t.te_sex,
+            CASE t.te_sex
+                WHEN 0 THEN '女'
+                WHEN 1 THEN '男'
+                ELSE ''
+            END AS te_sex_name,
+            t.te_avatar,
+            t.te_phone,
+            t.n_star,
+            t.service_state,
+            CASE t.service_state
+                WHEN 0 THEN '服务中'
+                WHEN 1 THEN '待接单'
+                WHEN 2 THEN '休息中'
+                ELSE ''
+            END AS service_state_name,
+            t.n_num,
+            IFNULL(sign_data.online_time, 0) AS online_time,
+            t.te_project,
+            t.post_state,
+            t.is_recommend,
+            t.tech_type,
+            CASE t.tech_type
+                WHEN 0 THEN '正式用户'
+                WHEN 1 THEN '虚拟用户'
+                ELSE ''
+            END AS tech_type_name,
+            t.merchant_status,
+            CASE t.merchant_status
+                WHEN '0' THEN '正常'
+                WHEN '1' THEN '限制接单'
+                WHEN '2' THEN '冻结'
+                WHEN '3' THEN '注销'
+                ELSE ''
+            END AS merchant_status_name,
+            t.create_time
+        FROM ma_technician t
+        LEFT JOIN (
+            SELECT js_id, SUM(IFNULL(online_time, 0)) AS online_time
+            FROM t_sign
+            WHERE is_delete = 0
+            GROUP BY js_id
+        ) sign_data ON sign_data.js_id = t.id
+        <where>
+            t.is_delete = 0
+            <if test="dto != null">
+                <!-- 商户姓名 -->
+                <if test="dto.teName != null and dto.teName != ''">
+                    AND t.te_name LIKE CONCAT('%', #{dto.teName}, '%')
+                </if>
+                <!-- 商户昵称 -->
+                <if test="dto.teNickName != null and dto.teNickName != ''">
+                    AND t.te_nick_name LIKE CONCAT('%', #{dto.teNickName}, '%')
+                </if>
+                <!-- 服务类目 -->
+                <if test="dto.openService != null">
+                    AND t.openService = #{dto.openService}
+                </if>
+                <!-- 手机号 -->
+                <if test="dto.tePhone != null and dto.tePhone != ''">
+                    AND t.te_phone LIKE CONCAT('%', #{dto.tePhone}, '%')
+                </if>
+                <!-- 注册开始时间 -->
+                <if test="dto.beginCreateTime != null and dto.beginCreateTime != ''">
+                    AND t.create_time &gt;= #{dto.beginCreateTime}
+                </if>
+                <!-- 注册结束时间 -->
+                <if test="dto.endCreateTime != null and dto.endCreateTime != ''">
+                    AND t.create_time &lt;= #{dto.endCreateTime}
+                </if>
+                <!-- 上架状态 -->
+                <if test="dto.postState != null">
+                    AND t.post_state = #{dto.postState}
+                </if>
+                <!-- 性别 -->
+                <if test="dto.teSex != null">
+                    AND t.te_sex = #{dto.teSex}
+                </if>
+                <!-- 服务状态 -->
+                <if test="dto.serviceState != null">
+                    AND t.service_state = #{dto.serviceState}
+                </if>
+                <!-- 用户类型 -->
+                <if test="dto.techType != null">
+                    AND t.tech_type = #{dto.techType}
+                </if>
+            </if>
+        </where>
+        ORDER BY t.create_time DESC
+    </select>
+
      <!-- 首页按摩商户推荐列表-->
     <select id="getMerchantRecommend" resultType="com.ylx.massage.domain.vo.MerchantVo">
         SELECT