<?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.ruoyi.production.mapper.ProductionSchedulingMapper">
|
|
<select id="pageProductionScheduling" resultType="com.ruoyi.production.dto.ProductionSchedulingDto">
|
select t.*, w.name as workshop_name, pt.team_name
|
from production_scheduling t
|
left join workshop w on t.workshop_id = w.id
|
left join production_team pt on t.team_id = pt.id
|
<where>
|
<if test="c.startDate != null">
|
and t.work_date >= #{c.startDate}
|
</if>
|
<if test="c.endDate != null">
|
and t.work_date <= #{c.endDate}
|
</if>
|
<if test="c.workshopId != null">
|
and t.workshop_id = #{c.workshopId}
|
</if>
|
<if test="c.teamId != null">
|
and t.team_id = #{c.teamId}
|
</if>
|
<if test="c.status != null">
|
and t.status = #{c.status}
|
</if>
|
</where>
|
order by t.work_date desc, t.id desc
|
</select>
|
|
<select id="todayByTeam" resultType="com.ruoyi.production.dto.ProductionSchedulingDto">
|
select t.*, w.name as workshop_name, pt.team_name
|
from production_scheduling t
|
left join workshop w on t.workshop_id = w.id
|
left join production_team pt on t.team_id = pt.id
|
where t.team_id = #{teamId} and t.work_date = #{workDate}
|
order by t.id desc
|
limit 1
|
</select>
|
</mapper>
|