Newer
Older
huludao / src / main / resources / mapper / MeetScheduleMapper.xml
<?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.newfiber.api.pc.dao.MeetScheduleMapper">
  <resultMap id="BaseResultMap" type="com.newfiber.api.pc.model.meet.MeetSchedule">

    <id column="id" jdbcType="BIGINT" property="id" />
    <id column="task_id" jdbcType="BIGINT" property="taskId" />
    <id column="task_type" jdbcType="BIGINT" property="taskType" />
    <result column="task_time" jdbcType="TIMESTAMP" property="taskTime" />
    <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
    <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
    <result column="user_id" jdbcType="BIGINT" property="userId" />
    <result column="user_name" jdbcType="VARCHAR" property="userName" />
    <result column="status" jdbcType="TINYINT" property="status" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  </resultMap>
  <sql id="Base_Column_List">
    id,task_id,task_type,task_time, start_time, end_time, user_id, user_name, status, create_time, update_time
  </sql>

  <select id="selectListByTime" resultType="com.newfiber.api.pc.model.vo.MeetScheduleVo">
    select
    msc.id,msc.task_id,msc.task_type,msc.task_time, msc.start_time, msc.end_time, msc.user_id,
    msc.user_name, msc.status, msc.create_time, msc.update_time,sui.phone_num as phone
    from meet_schedule msc
    left join sys_user_info sui on msc.user_id = sui.id
    left join meet_people mpe on mpe.p_id=msc.user_id
    where 1=1
    <if test="taskId != null and taskId != ''">
      and task_id = #{taskId}
    </if>
    <if test="taskType != null">
      and task_type = #{taskType}
    </if>
    <if test="userName != null and userName != ''">
      and user_name like concat('%',#{userName},'%')
    </if>
    <if test="startTime != null">
      and start_time &gt;= #{startTime}
    </if>
    <if test="endTime != null">
      and start_time &lt;= #{endTime}
    </if>
    order by msc.start_time asc
  </select>

  <select id="getOne" resultType="com.newfiber.api.pc.model.vo.MeetScheduleVo">
    select
    msc.id,msc.task_id,msc.task_type,msc.task_time, msc.start_time, msc.end_time, msc.user_id,
    msc.user_name, msc.status, msc.create_time, msc.update_time,mpe.job,
    mpe.area_name,sui.phone_num as phone
    from meet_schedule msc
    left join meet_people mpe on mpe.p_id=msc.user_id
    left join sys_user_info sui on msc.user_id = sui.id
    left join meet_task mt on mt.id=msc.task_id where mt.`name`="防汛排班任务"
    <if test="startTime != null">
      and msc.start_time &gt;= #{startTime}
    </if>
    <if test="endTime != null">
      and msc.start_time &lt;= #{endTime}
    </if>
    limit 1
  </select>

</mapper>