|
@@ -0,0 +1,53 @@
|
|
|
+<?xml version="1.0" encoding="UTF-8"?>
|
|
|
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+<mapper namespace="org.springblade.manager.mapper.ServicePlanMapper">
|
|
|
+
|
|
|
+ <!-- 通用查询映射结果 -->
|
|
|
+ <resultMap id="servicePlanResultMap" type="org.springblade.manager.entity.ServicePlan">
|
|
|
+ <result column="id" property="id"/>
|
|
|
+ <result column="status" property="status"/>
|
|
|
+ <result column="create_user" property="createUser"/>
|
|
|
+ <result column="create_time" property="createTime"/>
|
|
|
+ <result column="update_user" property="updateUser"/>
|
|
|
+ <result column="update_time" property="updateTime"/>
|
|
|
+ <result column="file_in_type" property="fileInType"/>
|
|
|
+ <result column="plan_start_time" property="planStartTime"/>
|
|
|
+ <result column="plan_end_time" property="planEndTime"/>
|
|
|
+ <result column="send_user" property="sendUser"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="selectServicePlanPage" resultMap="servicePlanResultMap">
|
|
|
+ select * from m_service_plan where is_deleted = 0 and project_id = #{servicePlan.projectId} and contract_id = #{servicePlan.contractId}
|
|
|
+ and (FIND_IN_SET(write_user,#{servicePlan.userId}) or FIND_IN_SET(send_user,#{servicePlan.userId}))
|
|
|
+ <if test="servicePlan.fileInType != null">
|
|
|
+ and file_in_type = #{servicePlan.fileInType}
|
|
|
+ </if>
|
|
|
+ <if test="servicePlan.status!=null">
|
|
|
+ and status = #{servicePlan.status}
|
|
|
+ </if>
|
|
|
+ <if test="servicePlan.writeUser!=null">
|
|
|
+ and FIND_IN_SET(write_user,#{servicePlan.writeUser})
|
|
|
+ </if>
|
|
|
+ <if test="servicePlan.sendUser!=null">
|
|
|
+ and FIND_IN_SET(send_user,#{servicePlan.sendUser})
|
|
|
+ </if>
|
|
|
+ <if test="servicePlan.planStartTime != null and servicePlan.planEndTime != null">
|
|
|
+ and (
|
|
|
+ (#{servicePlan.planStartTime} between plan_start_time and plan_end_time)
|
|
|
+ or (#{servicePlan.planEndTime} between plan_start_time and plan_end_time)
|
|
|
+ or (plan_start_time between #{servicePlan.planStartTime} and #{servicePlan.planEndTime})
|
|
|
+ or (plan_end_time between #{servicePlan.planStartTime} and #{servicePlan.planEndTime})
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="getUserID" resultType="java.lang.String">
|
|
|
+ <if test="type == 1">
|
|
|
+ select send_user from m_service_plan where is_deleted = 0 and project_id = #{projectId} and contract_id = #{contractId}
|
|
|
+ </if>
|
|
|
+ <if test="type == 2">
|
|
|
+ select write_user from m_service_plan where is_deleted = 0 and project_id = #{projectId} and contract_id = #{contractId}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|