|
|
@@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<resultMap type="MaProject" id="MaProjectResult">
|
|
|
<result property="id" column="id" />
|
|
|
+ <result property="projectId" column="project_id" />
|
|
|
<result property="projectName" column="project_name" />
|
|
|
<result property="projectDescribe" column="project_describe" />
|
|
|
<result property="projectDuration" column="project_duration" />
|
|
|
@@ -15,8 +16,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="projectMasterImage" column="project_master_image" />
|
|
|
<result property="projectDetailImage" column="project_detail_image" />
|
|
|
<result property="projectIsEnable" column="project_is_enable" />
|
|
|
- <result property="createUser" column="create_user" />
|
|
|
- <result property="updateUser" column="update_user" />
|
|
|
+ <result property="merchantId" column="merchant_id" />
|
|
|
+ <result property="auditStatus" column="audit_status" />
|
|
|
+ <result property="applyReason" column="apply_reason" />
|
|
|
+ <result property="reason" column="reason" />
|
|
|
+ <result property="applyTime" column="apply_time" />
|
|
|
+ <result property="approveTime" column="approve_time" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
<result property="createTime" column="create_time" />
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
<result property="isDelete" column="is_delete" />
|
|
|
@@ -44,6 +51,178 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
+ <resultMap type="com.ylx.massage.domain.vo.MaProjectAuditListVO" id="MaProjectAuditListResult">
|
|
|
+ <result property="projectAuditId" column="project_audit_id"/>
|
|
|
+ <result property="projectId" column="project_id"/>
|
|
|
+ <result property="projectName" column="project_name"/>
|
|
|
+ <result property="merchantId" column="merchant_id"/>
|
|
|
+ <result property="merchantName" column="merchant_name"/>
|
|
|
+ <result property="merchantNickName" column="merchant_nick_name"/>
|
|
|
+ <result property="merchantSex" column="merchant_sex"/>
|
|
|
+ <result property="merchantSexName" column="merchant_sex_name"/>
|
|
|
+ <result property="merchantAvatar" column="merchant_avatar"/>
|
|
|
+ <result property="merchantPhone" column="merchant_phone"/>
|
|
|
+ <result property="techType" column="tech_type"/>
|
|
|
+ <result property="techTypeName" column="tech_type_name"/>
|
|
|
+ <result property="applyTime" column="apply_time"/>
|
|
|
+ <result property="approveTime" column="approve_time"/>
|
|
|
+ <result property="registerTime" column="register_time"/>
|
|
|
+ <result property="auditStatus" column="audit_status"/>
|
|
|
+ <result property="auditStatusName" column="audit_status_name"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!-- 查询技能审核列表 -->
|
|
|
+ <select id="selectProjectAuditList" resultMap="MaProjectAuditListResult">
|
|
|
+ SELECT
|
|
|
+ p.id AS project_audit_id,
|
|
|
+ p.project_id,
|
|
|
+ p.project_name,
|
|
|
+ p.merchant_id,
|
|
|
+ t.te_name AS merchant_name,
|
|
|
+ t.te_nick_name AS merchant_nick_name,
|
|
|
+ t.te_sex AS merchant_sex,
|
|
|
+ CASE t.te_sex
|
|
|
+ WHEN 0 THEN '女'
|
|
|
+ WHEN 1 THEN '男'
|
|
|
+ ELSE ''
|
|
|
+ END AS merchant_sex_name,
|
|
|
+ t.avatar AS merchant_avatar,
|
|
|
+ t.te_phone AS merchant_phone,
|
|
|
+ t.tech_type,
|
|
|
+ CASE t.tech_type
|
|
|
+ WHEN 0 THEN '真实用户'
|
|
|
+ WHEN 1 THEN '虚拟用户'
|
|
|
+ ELSE ''
|
|
|
+ END AS tech_type_name,
|
|
|
+ COALESCE(p.apply_time, p.create_time) AS apply_time,
|
|
|
+ p.approve_time,
|
|
|
+ t.create_time AS register_time,
|
|
|
+ p.audit_status,
|
|
|
+ CASE p.audit_status
|
|
|
+ WHEN 0 THEN '待审核'
|
|
|
+ WHEN 1 THEN '审核通过'
|
|
|
+ WHEN 2 THEN '审核驳回'
|
|
|
+ ELSE ''
|
|
|
+ END AS audit_status_name
|
|
|
+ FROM ma_project p
|
|
|
+ INNER JOIN ma_technician t ON t.id = p.merchant_id
|
|
|
+ <where>
|
|
|
+ IFNULL(p.is_delete, 0) = 0
|
|
|
+ AND IFNULL(t.is_delete, 0) = 0
|
|
|
+ <if test="dto != null">
|
|
|
+ <choose>
|
|
|
+ <when test="dto.auditStatus != null">
|
|
|
+ AND p.audit_status = #{dto.auditStatus}
|
|
|
+ </when>
|
|
|
+
|
|
|
+ <when test="dto.auditStatusGroup != null and dto.auditStatusGroup == 0">
|
|
|
+ AND p.audit_status = 0
|
|
|
+ </when>
|
|
|
+ <when test="dto.auditStatusGroup != null and dto.auditStatusGroup == 1">
|
|
|
+ AND p.audit_status IN (1, 2)
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
+ <!-- 商户名称 -->
|
|
|
+ <if test="dto.merchantName != null and dto.merchantName != ''">
|
|
|
+ AND t.te_name LIKE CONCAT('%', #{dto.merchantName}, '%')
|
|
|
+ </if>
|
|
|
+ <!-- 商户昵称 -->
|
|
|
+ <if test="dto.merchantNickName != null and dto.merchantNickName != ''">
|
|
|
+ AND t.te_nick_name LIKE CONCAT('%', #{dto.merchantNickName}, '%')
|
|
|
+ </if>
|
|
|
+ <!-- 商户类型 -->
|
|
|
+ <if test="dto.techType != null">
|
|
|
+ AND t.tech_type = #{dto.techType}
|
|
|
+ </if>
|
|
|
+ <!-- 商户电话 -->
|
|
|
+ <if test="dto.merchantPhone != null and dto.merchantPhone != ''">
|
|
|
+ AND t.te_phone LIKE CONCAT('%', #{dto.merchantPhone}, '%')
|
|
|
+ </if>
|
|
|
+ <!-- 申请开始时间 -->
|
|
|
+ <if test="dto.beginApplyTime != null and dto.beginApplyTime != ''">
|
|
|
+ AND COALESCE(p.apply_time, p.create_time) >= #{dto.beginApplyTime}
|
|
|
+ </if>
|
|
|
+ <!-- 申请结束时间 -->
|
|
|
+ <if test="dto.endApplyTime != null and dto.endApplyTime != ''">
|
|
|
+ AND COALESCE(p.apply_time, p.create_time) <= #{dto.endApplyTime}
|
|
|
+ </if>
|
|
|
+ <!-- 商户性别 -->
|
|
|
+ <if test="dto.merchantSex != null">
|
|
|
+ AND t.te_sex = #{dto.merchantSex}
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ORDER BY COALESCE(p.apply_time, p.create_time) DESC, p.id DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <resultMap type="com.ylx.massage.domain.vo.MaProjectOpenServiceVO" id="MaProjectOpenServiceResult">
|
|
|
+ <result property="projectAuditId" column="project_audit_id"/>
|
|
|
+ <result property="projectId" column="project_id"/>
|
|
|
+ <result property="projectName" column="project_name"/>
|
|
|
+ <result property="applyReason" column="apply_reason"/>
|
|
|
+ <result property="applyTime" column="apply_time"/>
|
|
|
+ <result property="auditStatus" column="audit_status"/>
|
|
|
+ <result property="auditStatusName" column="audit_status_name"/>
|
|
|
+ <result property="remark" column="remark"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!-- 查询商户申请开通的项目列表 -->
|
|
|
+ <select id="selectMerchantOpenProjectList" resultMap="MaProjectOpenServiceResult">
|
|
|
+ SELECT
|
|
|
+ p.id AS project_audit_id,
|
|
|
+ p.project_id,
|
|
|
+ COALESCE(NULLIF(p.project_name, ''), base_project.title, '') AS project_name,
|
|
|
+ p.apply_reason,
|
|
|
+ COALESCE(p.apply_time, p.create_time) AS apply_time,
|
|
|
+ p.audit_status,
|
|
|
+ CASE p.audit_status
|
|
|
+ WHEN 0 THEN '待审核'
|
|
|
+ WHEN 1 THEN '审核通过'
|
|
|
+ WHEN 2 THEN '审核驳回'
|
|
|
+ ELSE ''
|
|
|
+ END AS audit_status_name,
|
|
|
+ p.reason AS remark
|
|
|
+ FROM ma_project p
|
|
|
+ LEFT JOIN project base_project ON base_project.id = p.project_id
|
|
|
+ WHERE p.merchant_id = #{merchantId}
|
|
|
+ AND IFNULL(p.is_delete, 0) = 0
|
|
|
+ ORDER BY COALESCE(p.apply_time, p.create_time) DESC, p.id DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询技能审核记录 -->
|
|
|
+ <select id="selectProjectAuditById" resultMap="MaProjectResult">
|
|
|
+ SELECT
|
|
|
+ id,
|
|
|
+ project_id,
|
|
|
+ project_name,
|
|
|
+ merchant_id,
|
|
|
+ audit_status,
|
|
|
+ project_is_enable,
|
|
|
+ reason,
|
|
|
+ approve_time,
|
|
|
+ is_delete,
|
|
|
+ create_time,
|
|
|
+ update_time
|
|
|
+ FROM ma_project
|
|
|
+ WHERE id = #{projectAuditId}
|
|
|
+ AND is_delete = 0
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 提交技能开通审核 -->
|
|
|
+ <update id="submitProjectAudit">
|
|
|
+ UPDATE ma_project
|
|
|
+ SET
|
|
|
+ audit_status = #{maProject.auditStatus},
|
|
|
+ reason = #{maProject.reason},
|
|
|
+ approve_time = #{maProject.approveTime},
|
|
|
+ project_is_enable = #{maProject.projectIsEnable},
|
|
|
+ update_by = #{maProject.updateBy},
|
|
|
+ update_time = #{maProject.updateTime}
|
|
|
+ WHERE id = #{maProject.id}
|
|
|
+ AND IFNULL(is_delete, 0) = 0
|
|
|
+ AND audit_status = 0
|
|
|
+ </update>
|
|
|
+
|
|
|
<select id="selectMaProjectById" parameterType="Long" resultMap="MaProjectResult">
|
|
|
<include refid="selectMaProjectVo"/>
|
|
|
where is_delete !=1 and id = #{id}
|