MaTechnicianMapper.java 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. package com.ylx.massage.mapper;
  2. import java.util.List;
  3. import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  4. import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  5. import com.ylx.massage.domain.MaTechnician;
  6. import com.ylx.massage.domain.dto.MaTechnicianAuditQueryDTO;
  7. import com.ylx.massage.domain.dto.MaTechnicianMerchantQueryDTO;
  8. import com.ylx.massage.domain.dto.MassageMerchantRecommendDto;
  9. import com.ylx.massage.domain.vo.MaTechnicianAuditListVO;
  10. import com.ylx.massage.domain.vo.MaTechnicianMerchantDetailVO;
  11. import com.ylx.massage.domain.vo.MaTechnicianMerchantListVO;
  12. import com.ylx.massage.domain.vo.MassageProjectRecommendVo;
  13. import com.ylx.massage.domain.vo.MerchantVo;
  14. import org.apache.ibatis.annotations.Param;
  15. import org.mapstruct.Mapper;
  16. import org.apache.ibatis.annotations.Select;
  17. /**
  18. * 技师Mapper接口
  19. *
  20. * @author ylx
  21. * @date 2024-03-22
  22. */
  23. @Mapper
  24. public interface MaTechnicianMapper extends BaseMapper<MaTechnician>
  25. {
  26. /**
  27. * 查询技师
  28. *
  29. * @param id 技师主键
  30. * @return 技师
  31. */
  32. public MaTechnician selectMaTechnicianById(Long id);
  33. /**
  34. * 查询技师列表
  35. *
  36. * @param maTechnician 技师
  37. * @return 技师集合
  38. */
  39. List<MaTechnician> selectMaTechnicianList(MaTechnician maTechnician);
  40. /**
  41. * 新增技师
  42. *
  43. * @param maTechnician 技师
  44. * @return 结果
  45. */
  46. public int insertMaTechnician(MaTechnician maTechnician);
  47. /**
  48. * 修改技师
  49. *
  50. * @param maTechnician 技师
  51. * @return 结果
  52. */
  53. public int updateMaTechnician(MaTechnician maTechnician);
  54. /**
  55. * 删除技师
  56. *
  57. * @param id 技师主键
  58. * @return 结果
  59. */
  60. public int deleteMaTechnicianById(Long id);
  61. /**
  62. * 批量删除技师
  63. *
  64. * @param ids 需要删除的数据主键集合
  65. * @return 结果
  66. */
  67. public int deleteMaTechnicianByIds(Long[] ids);
  68. /**
  69. * 后台查询商户列表
  70. *
  71. * @param page 分页参数
  72. * @param dto 查询条件
  73. * @return 商户分页列表
  74. */
  75. Page<MaTechnicianMerchantListVO> selectMerchantList(Page<MaTechnicianMerchantListVO> page,
  76. @Param("dto") MaTechnicianMerchantQueryDTO dto);
  77. /**
  78. * 后台查询商户入驻审核列表
  79. *
  80. * @param page 分页参数
  81. * @param dto 查询条件
  82. * @return 商户入驻审核分页列表
  83. */
  84. Page<MaTechnicianAuditListVO> selectMerchantAuditList(Page<MaTechnicianAuditListVO> page,
  85. @Param("dto") MaTechnicianAuditQueryDTO dto);
  86. /**
  87. * 后台查询商户详情
  88. *
  89. * @param id 商户ID
  90. * @return 商户详情
  91. */
  92. MaTechnicianMerchantDetailVO selectMerchantDetailById(@Param("id") Long id);
  93. /**
  94. * 根据商户ID查询商户。
  95. *
  96. * @param id 商户ID
  97. * @return 商户信息
  98. */
  99. default MaTechnician selectMerchantById(Integer id) {
  100. return selectById(id);
  101. }
  102. /**
  103. * 根据商户ID更新商户。
  104. *
  105. * @param maTechnician 商户信息
  106. * @return 影响行数
  107. */
  108. default int updateMerchantById(MaTechnician maTechnician) {
  109. return updateById(maTechnician);
  110. }
  111. /**
  112. * 根据商户ID更新合同文件。
  113. *
  114. * @param maTechnician 商户合同文件信息
  115. * @return 影响行数
  116. */
  117. default int updateMerchantContractById(MaTechnician maTechnician) {
  118. return updateById(maTechnician);
  119. }
  120. List<MerchantVo> getMerchantRecommend(@Param("dto") MassageMerchantRecommendDto dto);
  121. /**
  122. * 查询该城市是否有商户提供服务
  123. * @param areaCode
  124. * @return
  125. */
  126. @Select("SELECT EXISTS (" +
  127. " SELECT 1" +
  128. " FROM ma_technician t" +
  129. " INNER JOIN ma_project p ON t.id = p.merchant_id" +
  130. " WHERE t.te_area_code = #{areaCode}" +
  131. " AND t.is_delete = 0" +
  132. " AND t.audit_status = 2" +
  133. " AND t.n_status2 = 0" +
  134. " AND t.merchant_status = 0" +
  135. " AND p.is_delete = 0" +
  136. " AND p.audit_status = 1" +
  137. " AND p.merchant_type = 0" +
  138. " AND p.project_is_enable = 1" +
  139. ") AS has_merchant_with_service")
  140. Boolean isHasMerchantCity(@Param("areaCode") String areaCode);
  141. }