|
@@ -208,16 +208,36 @@ order by a.shift_date desc
|
|
</if>
|
|
</if>
|
|
</select>
|
|
</select>
|
|
<select id="getMothsUserShift" resultType="java.util.Map">
|
|
<select id="getMothsUserShift" resultType="java.util.Map">
|
|
- select a.shift_id as 'id', a.user_id as 'userid',b.shift_type as 'type', ifnull(b.name,'休息') as 'name',date_format(b.start_date,'%H:%i:%s') as 'startDate',date_format(b.end_date,'%H:%i:%s') as 'endDate',date_format(b.start2_date,'%H:%i:%s') as 'start2Date',date_format(b.end2_date,'%H:%i:%s') as 'end2Date',DAYOFMONTH(a.shift_date) as 'shiftDate'
|
|
|
|
|
|
+ select a.shift_id as 'id', a.user_id as 'userid',b.shift_type as 'type', ifnull(b.name,'休') as 'name',date_format(b.start_date,'%H:%i:%s') as 'startDate',date_format(b.end_date,'%H:%i:%s') as 'endDate',date_format(b.start2_date,'%H:%i:%s') as 'start2Date',date_format(b.end2_date,'%H:%i:%s') as 'end2Date',DAYOFMONTH(a.shift_date) as 'shiftDate'
|
|
from geke_user_shift a left join geke_shift b on a.shift_id=b.id
|
|
from geke_user_shift a left join geke_shift b on a.shift_id=b.id
|
|
- where 1=1
|
|
|
|
|
|
+ where a.shift_id not in('0','1')
|
|
<if test="userid!=null and ''!=userid">
|
|
<if test="userid!=null and ''!=userid">
|
|
and a.user_id=#{userid}
|
|
and a.user_id=#{userid}
|
|
</if>
|
|
</if>
|
|
<if test="date!=null and ''!=date">
|
|
<if test="date!=null and ''!=date">
|
|
and date_format(a.shift_date,'%Y-%m')=date_format(#{date},'%Y-%m')
|
|
and date_format(a.shift_date,'%Y-%m')=date_format(#{date},'%Y-%m')
|
|
</if>
|
|
</if>
|
|
- order by date_format(b.start_date,'%H:%i:%s') asc
|
|
|
|
|
|
+ UNION ALL
|
|
|
|
+ select a.shift_id as 'id', a.user_id as 'userid','0' as 'type', '休' as 'name',date_format(b.start_date,'%H:%i:%s') as 'startDate',date_format(b.end_date,'%H:%i:%s') as 'endDate',date_format(b.start2_date,'%H:%i:%s') as 'start2Date',date_format(b.end2_date,'%H:%i:%s') as 'end2Date',DAYOFMONTH(a.shift_date) as 'shiftDate'
|
|
|
|
+ from geke_user_shift a left join geke_shift b on a.shift_id=b.id
|
|
|
|
+ where a.shift_id='0'
|
|
|
|
+ <if test="userid!=null and ''!=userid">
|
|
|
|
+ and a.user_id=#{userid}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="date!=null and ''!=date">
|
|
|
|
+ and date_format(a.shift_date,'%Y-%m')=date_format(#{date},'%Y-%m')
|
|
|
|
+ </if>
|
|
|
|
+ UNION ALL
|
|
|
|
+ select a.shift_id as 'id', a.user_id as 'userid','0' as 'type', '法' as 'name',date_format(b.start_date,'%H:%i:%s') as 'startDate',date_format(b.end_date,'%H:%i:%s') as 'endDate',date_format(b.start2_date,'%H:%i:%s') as 'start2Date',date_format(b.end2_date,'%H:%i:%s') as 'end2Date',DAYOFMONTH(a.shift_date) as 'shiftDate'
|
|
|
|
+ from geke_user_shift a left join geke_shift b on a.shift_id=b.id
|
|
|
|
+ where a.shift_id='1'
|
|
|
|
+ <if test="userid!=null and ''!=userid">
|
|
|
|
+ and a.user_id=#{userid}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="date!=null and ''!=date">
|
|
|
|
+ and date_format(a.shift_date,'%Y-%m')=date_format(#{date},'%Y-%m')
|
|
|
|
+ </if>
|
|
|
|
+
|
|
</select>
|
|
</select>
|
|
<select id="getUserId" resultType="java.util.Map">
|
|
<select id="getUserId" resultType="java.util.Map">
|
|
select id,category from sys_user where 1=1
|
|
select id,category from sys_user where 1=1
|