| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?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.management.platform.mapper.VisitPlanMapper">
- <sql id="baseColumns">
- id, plan_name, custom_id, custom_name, incharger_id, visit_goal, visit_time, remark, remind_type
- , remind_time, finish_state, create_by, company_id,final_remind_time,corpwx_userid
- </sql>
- <select id="getPageVisitPlan" resultType="com.management.platform.entity.vo.VisitPlanVO">
- select vs.id, vs.plan_name, vs.custom_id, vs.custom_name
- , vs.incharger_id, u.name as inchargerName
- , vs.visit_goal,sd1.name as visitGoalName
- , vs.visit_time, vs.remark
- , vs.remind_type, case remind_type when -1 then '自定义时间' else sd2.name end as remindTypeName
- ,vs.remind_time, vs.finish_state
- , vs.create_by
- from visit_plan vs
- left join user u on vs.incharger_id = u.id
- left join (select * from sys_dict where code = 'VisitGoal') sd1 on vs.visit_goal = sd1.id
- left join (select * from sys_dict where code = 'RemindType') sd2 on vs.remind_type = sd2.id
- where vs.create_by = #{query.userId} and date_format(vs.visit_time,'%Y-%m-%d') = #{query.calenderDate}
- </select>
- <select id="getListVisitPlan" resultType="com.management.platform.entity.vo.VisitPlanVO">
- select vs.id, vs.plan_name, vs.custom_id, vs.custom_name
- , vs.incharger_id, u.name as inchargerName
- , vs.visit_goal,sd1.name as visitGoalName
- , vs.visit_time, vs.remark
- , vs.remind_type, case remind_type when -1 then '自定义时间' else sd2.name end as remindTypeName
- ,vs.remind_time, vs.finish_state
- , vs.create_by,c.tel_phone
- from visit_plan vs
- left join user u on vs.incharger_id = u.id
- left join (select * from sys_dict where code = 'VisitGoal') sd1 on vs.visit_goal = sd1.id
- left join (select * from sys_dict where code = 'RemindType') sd2 on vs.remind_type = sd2.id
- left join custom c on vs.custom_id = c.id
- where vs.create_by = #{query.userId} and date_format(vs.visit_time,'%Y-%m-%d') = #{query.calenderDate}
- order by vs.visit_time asc
- </select>
- <select id="getDetail" resultType="com.management.platform.entity.vo.VisitPlanDetailVO">
- select vs.id, vs.plan_name, vs.custom_id, vs.custom_name
- , vs.incharger_id, u.name as inchargerName
- , vs.visit_goal,sd1.name as visitGoalName
- , vs.visit_time, vs.remark
- , vs.remind_type, case remind_type when -1 then '自定义时间' else sd2.name end as remindTypeName
- ,vs.remind_time, vs.finish_state
- , vs.create_by,c.tel_phone
- from visit_plan vs
- left join user u on vs.incharger_id = u.id
- left join (select * from sys_dict where code = 'VisitGoal') sd1 on vs.visit_goal = sd1.id
- left join (select * from sys_dict where code = 'RemindType') sd2 on vs.remind_type = sd2.id
- left join custom c on vs.custom_id = c.id
- where vs.id = #{planId}
- </select>
- <select id="getMinuteVisitPlans" resultType="com.management.platform.entity.VisitPlan">
- select <include refid="baseColumns"></include>
- from visit_plan
- where
- finish_state != 1
- and date_format(final_remind_time,'%Y-%m-%d %H:%i')=date_format(#{queryDate},'%Y-%m-%d %H:%i')
- </select>
- </mapper>
|