‘liusuyi’
2023-10-07 75b1a93d2c447b3c9fc1de95270694ebdac6faca
ard-work/src/main/resources/mapper/app/ArdAppPatrolplanMapper.xml
@@ -144,4 +144,25 @@
        </where>
        group by ard_app_patrolplan.id
    </select>
    <select id="oncePlan" parameterType="recordMonthExParam" resultMap="ArdAppPatrolplanResult">
        select plan.* from ard_app_patrolplan plan
        LEFT JOIN ard_app_patroluser users on users.patrolplan_id = plan."id"
        where users.app_user_id = #{userId} and cycle = 'once' and patro_begin_time &gt;= #{begin} and plan.del_name is null and plan.del_time is null ;
    </select>
    <select id="dayPlan" parameterType="recordMonthExParam" resultMap="ArdAppPatrolplanResult">
        select plan.* from ard_app_patrolplan plan
                               LEFT JOIN ard_app_patroluser users on users.patrolplan_id = plan."id"
        where users.app_user_id = #{userId} and cycle = 'day' and create_time &lt; #{end} and del_name is null and del_time is null ;
    </select>
    <select id="planUser" parameterType="String" resultMap="ArdAppPatrolplanResult">
        select s.nick_name, plan.plan_name from ard_app_patrolplan plan
         LEFT JOIN ard_app_patroluser users on users.patrolplan_id = plan."id"
         left join sys_user s on plan.user_id = s.user_id
        where users.app_user_id = #{userId} and son is null
            and plan.create_time &gt;= #{beforeTime} and  plan.create_time &lt;= #{time}
          and del_name is null and del_time is null order by plan.create_time desc;
    </select>
</mapper>