You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
85 lines
3.5 KiB
85 lines
3.5 KiB
<?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.xujie.sys.modules.scheduling.mapper.SchedulingMapper">
|
|
|
|
<insert id="insertClassesData">
|
|
insert into tpm_classes(code,description,site,bu_no)
|
|
values (#{code}, #{description}, #{site}, #{buNo})
|
|
</insert>
|
|
<insert id="saveSchedulingHeader" parameterType="com.xujie.sys.modules.scheduling.entity.SchedulingData" useGeneratedKeys="true" keyProperty="id">
|
|
insert into tpm_scheduling(site, bu_no,date,classes_code)
|
|
values (#{site},#{buNo},#{date},#{classesCode})
|
|
</insert>
|
|
<insert id="saveSchedulingRecord">
|
|
insert into tpm_scheduling_record(admin_id,admin_name,head_id,isHoliday)
|
|
values (#{adminId}, #{adminName}, #{headId},#{isHoliday})
|
|
</insert>
|
|
<update id="updateClassesData">
|
|
update tpm_classes set description = #{description}
|
|
where code = #{code} and site = #{site} and bu_no = #{buNo}
|
|
</update>
|
|
<update id="editSaveSchedulingRecord">
|
|
update tpm_scheduling_record set isHoliday = #{isHoliday}
|
|
where id = #{id}
|
|
</update>
|
|
<delete id="delScheduling">
|
|
delete from tpm_classes
|
|
where code = #{code} and site = #{site} and bu_no = #{buNo}
|
|
</delete>
|
|
<delete id="deleteSchedulingRecord">
|
|
delete from tpm_scheduling_record
|
|
where id = #{id}
|
|
</delete>
|
|
<select id="getSchedulingDataList" resultType="com.xujie.sys.modules.scheduling.entity.ClassesData">
|
|
select * from tpm_classes
|
|
<where>
|
|
<if test="code != null and code != ''">
|
|
and code like concat('%', #{code}, '%')
|
|
</if>
|
|
<if test="description != null and description != ''">
|
|
and description like concat('%', #{description}, '%')
|
|
</if>
|
|
<if test="site != null and site != ''">
|
|
and site = #{site}
|
|
</if>
|
|
<if test="buNo != null and buNo != ''">
|
|
and bu_no = #{buNo}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
<select id="getSchedulingDataCount" resultType="java.lang.Integer">
|
|
select count(*) from tpm_classes
|
|
where code = #{code}
|
|
</select>
|
|
<select id="getClassesList" resultType="com.xujie.sys.modules.scheduling.entity.ClassesData">
|
|
select * from tpm_classes
|
|
</select>
|
|
<select id="querySchedulingList" resultType="com.xujie.sys.modules.scheduling.entity.SchedulingData">
|
|
select tpm_scheduling.*,
|
|
tc.description as classesDescription
|
|
from tpm_scheduling
|
|
left join tpm_classes tc on tpm_scheduling.classes_code = tc.code
|
|
<where>
|
|
<if test="site != null and site != ''">
|
|
and site = #{site}
|
|
</if>
|
|
<if test="buNo != null and buNo != ''">
|
|
and bu_no = #{buNo}
|
|
</if>
|
|
<if test="classesCode != null and classesCode != ''">
|
|
and classes_code = #{classesCode}
|
|
</if>
|
|
<if test="startDate != null">
|
|
and date >= #{startDate}
|
|
</if>
|
|
<if test="endDate != null">
|
|
and date <![CDATA[<=]]> #{endDate}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
<select id="querySaveSchedulingRecord" resultType="com.xujie.sys.modules.scheduling.entity.SchedulingRecordData">
|
|
select * from tpm_scheduling_record
|
|
where head_id = #{id}
|
|
</select>
|
|
</mapper>
|