| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509 |
- <?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.xunmei.system.mapper.SysWorkTimeSetMapper">
- <resultMap type="com.xunmei.system.domain.SysWorkTimeSet" id="SysWorkTimeSetResult">
- <result property="id" column="id"/>
- <result property="orgId" column="org_id"/>
- <result property="orgName" column="org_name"/>
- <result property="monthEnable" column="month_enable"/>
- <result property="monday" column="monday"/>
- <result property="tuesday" column="tuesday"/>
- <result property="wednesday" column="wednesday"/>
- <result property="thursday" column="thursday"/>
- <result property="friday" column="friday"/>
- <result property="saturday" column="saturday"/>
- <result property="sunday" column="sunday"/>
- <result property="workTime" column="work_time"/>
- <result property="openTime" column="open_time"/>
- <result property="noonbreakStart" column="noonbreak_start"/>
- <result property="noonbreakEnd" column="noonbreak_end"/>
- <result property="closeTime" column="close_time"/>
- <result property="workOffTime" column="work_off_time"/>
- <result property="createTime" column="create_time"/>
- <result property="modifiedId" column="modified_id"/>
- <result property="modifiedName" column="modified_name"/>
- <result property="updateTime" column="update_time"/>
- <result property="year" column="year"/>
- <result property="deleted" column="deleted"/>
- <result property="effectiveDate" column="effective_date"/>
- </resultMap>
- <sql id="selectSysWorkTimeSetVo">
- select id, org_id, org_name, month_enable, monday, tuesday, wednesday, thursday, friday, saturday, sunday, work_time, open_time, noonbreak_start, noonbreak_end, close_time, work_off_time, create_time, modified_id, modified_name, update_time, year, deleted, effective_date
- from sys_work_time_set
- </sql>
- <select id="selectSysWorkTimeSetList" parameterType="com.xunmei.system.domain.SysWorkTimeSet"
- resultMap="SysWorkTimeSetResult">
- <include refid="selectSysWorkTimeSetVo"/>
- <where>
- <if test="orgId != null ">
- and org_id = #{orgId}
- </if>
- <if test="orgName != null and orgName != ''">
- and org_name like concat('%', #{orgName}, '%')
- </if>
- <if test="monthEnable != null ">
- and month_enable = #{monthEnable}
- </if>
- <if test="monday != null ">
- and monday = #{monday}
- </if>
- <if test="tuesday != null ">
- and tuesday = #{tuesday}
- </if>
- <if test="wednesday != null ">
- and wednesday = #{wednesday}
- </if>
- <if test="thursday != null ">
- and thursday = #{thursday}
- </if>
- <if test="friday != null ">
- and friday = #{friday}
- </if>
- <if test="saturday != null ">
- and saturday = #{saturday}
- </if>
- <if test="sunday != null ">
- and sunday = #{sunday}
- </if>
- <if test="workTime != null and workTime != ''">
- and work_time = #{workTime}
- </if>
- <if test="openTime != null and openTime != ''">
- and open_time = #{openTime}
- </if>
- <if test="noonbreakStart != null and noonbreakStart != ''">
- and noonbreak_start = #{noonbreakStart}
- </if>
- <if test="noonbreakEnd != null and noonbreakEnd != ''">
- and noonbreak_end = #{noonbreakEnd}
- </if>
- <if test="closeTime != null and closeTime != ''">
- and close_time = #{closeTime}
- </if>
- <if test="workOffTime != null and workOffTime != ''">
- and work_off_time = #{workOffTime}
- </if>
- <if test="modifiedId != null ">
- and modified_id = #{modifiedId}
- </if>
- <if test="modifiedName != null and modifiedName != ''">
- and modified_name like concat('%', #{modifiedName}, '%')
- </if>
- <if test="year != null ">
- and year = #{year}
- </if>
- <if test="deleted != null ">
- and deleted = #{deleted}
- </if>
- <if test="effectiveDate != null ">
- and effective_date = #{effectiveDate}
- </if>
- </where>
- </select>
- <select id="selectSysWorkTimeSetById" parameterType="Long"
- resultMap="SysWorkTimeSetResult">
- <include refid="selectSysWorkTimeSetVo"/>
- where id = #{id}
- </select>
- <select id="selectSysWorkTimeSetByOrgId" parameterType="Long"
- resultMap="SysWorkTimeSetResult">
- <include refid="selectSysWorkTimeSetVo"/>
- where org_id = #{orgId}
- </select>
- <select id="selectSysWorkTimeSetByOrgIdLimit1" parameterType="Long"
- resultMap="SysWorkTimeSetResult">
- <include refid="selectSysWorkTimeSetVo"/>
- where org_id = #{orgId} limit 1
- </select>
- <select id="selectByPage" resultType="com.xunmei.system.domain.SysWorkTimeSet">
- select * from sys_work_time_set
- </select>
- <select id="findWorkTimeForOrgIdsAndErrectiveDate" resultType="com.xunmei.system.domain.SysWorkTimeSet">
- select s.* from sys_work_time_set s where s.org_id in
- <foreach item="orgId" collection="orgIds" open="(" separator="," close=")">
- #{orgId}
- </foreach>
- and s.effective_date = #{effectiveDate} and s.deleted = false
- </select>
- <select id="checkData" resultType="java.lang.Integer">
- select count(*) from sys_work_time a
- where a.is_manual=1
- <if test="request.orgIds!=null and request.orgIds.size()>0">
- and a.org_id in
- <foreach collection="request.orgIds" item="orgId" open="(" close=")" separator=",">
- #{orgId}
- </foreach>
- </if>
- <if test="request.effectiveDate!=null">
- and ymd_date >= #{request.effectiveDate}
- </if>
- </select>
- <select id="selectWorkTimeSetList" resultType="com.xunmei.system.domain.SysWorkTimeSet">
- select a.*,b.name as orgName from sys_work_time_set a left join sys_org b on a.org_id=b.id where a.deleted=0 and
- a.org_id in
- <foreach collection="request.orgIds" item="orgId" open="(" close=")" separator=",">
- #{orgId}
- </foreach>
- </select>
- <select id="selectWorkTimeSetPage" resultType="com.xunmei.system.domain.SysWorkTimeSet">
- SELECT
- t.*
- FROM
- sys_work_time_set t
- LEFT JOIN sys_org o ON t.org_id = o.id
- ${ew.customSqlSegment}
- </select>
- <insert id="insertSysWorkTimeSet" parameterType="com.xunmei.system.domain.SysWorkTimeSet" useGeneratedKeys="true" keyProperty="id">
- insert into sys_work_time_set
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="orgId != null">org_id,
- </if>
- <if test="orgName != null">org_name,
- </if>
- <if test="monthEnable != null">month_enable,
- </if>
- <if test="monday != null">monday,
- </if>
- <if test="tuesday != null">tuesday,
- </if>
- <if test="wednesday != null">wednesday,
- </if>
- <if test="thursday != null">thursday,
- </if>
- <if test="friday != null">friday,
- </if>
- <if test="saturday != null">saturday,
- </if>
- <if test="sunday != null">sunday,
- </if>
- <if test="workTime != null">work_time,
- </if>
- <if test="openTime != null">open_time,
- </if>
- <if test="noonbreakStart != null">noonbreak_start,
- </if>
- <if test="noonbreakEnd != null">noonbreak_end,
- </if>
- <if test="closeTime != null">close_time,
- </if>
- <if test="workOffTime != null">work_off_time,
- </if>
- <if test="createTime != null">create_time,
- </if>
- <if test="modifiedId != null">modified_id,
- </if>
- <if test="modifiedName != null">modified_name,
- </if>
- <if test="updateTime != null">update_time,
- </if>
- <if test="year != null">year,
- </if>
- <if test="deleted != null">deleted,
- </if>
- <if test="effectiveDate != null">effective_date,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="orgId != null">#{orgId},
- </if>
- <if test="orgName != null">#{orgName},
- </if>
- <if test="monthEnable != null">#{monthEnable},
- </if>
- <if test="monday != null">#{monday},
- </if>
- <if test="tuesday != null">#{tuesday},
- </if>
- <if test="wednesday != null">#{wednesday},
- </if>
- <if test="thursday != null">#{thursday},
- </if>
- <if test="friday != null">#{friday},
- </if>
- <if test="saturday != null">#{saturday},
- </if>
- <if test="sunday != null">#{sunday},
- </if>
- <if test="workTime != null">#{workTime},
- </if>
- <if test="openTime != null">#{openTime},
- </if>
- <if test="noonbreakStart != null">#{noonbreakStart},
- </if>
- <if test="noonbreakEnd != null">#{noonbreakEnd},
- </if>
- <if test="closeTime != null">#{closeTime},
- </if>
- <if test="workOffTime != null">#{workOffTime},
- </if>
- <if test="createTime != null">#{createTime},
- </if>
- <if test="modifiedId != null">#{modifiedId},
- </if>
- <if test="modifiedName != null">#{modifiedName},
- </if>
- <if test="updateTime != null">#{updateTime},
- </if>
- <if test="year != null">#{year},
- </if>
- <if test="deleted != null">#{deleted},
- </if>
- <if test="effectiveDate != null">#{effectiveDate},
- </if>
- </trim>
- </insert>
- <update id="updateSysWorkTimeSet" parameterType="com.xunmei.system.domain.SysWorkTimeSet">
- update sys_work_time_set
- <trim prefix="SET" suffixOverrides=",">
- <if test="orgId != null">org_id =
- #{orgId},
- </if>
- <if test="orgName != null">org_name =
- #{orgName},
- </if>
- <if test="monthEnable != null">month_enable =
- #{monthEnable},
- </if>
- <if test="monday != null">monday =
- #{monday},
- </if>
- <if test="tuesday != null">tuesday =
- #{tuesday},
- </if>
- <if test="wednesday != null">wednesday =
- #{wednesday},
- </if>
- <if test="thursday != null">thursday =
- #{thursday},
- </if>
- <if test="friday != null">friday =
- #{friday},
- </if>
- <if test="saturday != null">saturday =
- #{saturday},
- </if>
- <if test="sunday != null">sunday =
- #{sunday},
- </if>
- <if test="workTime != null">work_time =
- #{workTime},
- </if>
- <if test="openTime != null">open_time =
- #{openTime},
- </if>
- <if test="noonbreakStart != null">noonbreak_start =
- #{noonbreakStart},
- </if>
- <if test="noonbreakEnd != null">noonbreak_end =
- #{noonbreakEnd},
- </if>
- <if test="closeTime != null">close_time =
- #{closeTime},
- </if>
- <if test="workOffTime != null">work_off_time =
- #{workOffTime},
- </if>
- <if test="createTime != null">create_time =
- #{createTime},
- </if>
- <if test="modifiedId != null">modified_id =
- #{modifiedId},
- </if>
- <if test="modifiedName != null">modified_name =
- #{modifiedName},
- </if>
- <if test="updateTime != null">update_time =
- #{updateTime},
- </if>
- <if test="year != null">year =
- #{year},
- </if>
- <if test="deleted != null">deleted =
- #{deleted},
- </if>
- <if test="effectiveDate != null">effective_date =
- #{effectiveDate},
- </if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteSysWorkTimeSetById" parameterType="Long">
- delete
- from sys_work_time_set where id = #{id}
- </delete>
- <delete id="deleteSysWorkTimeSetByIds" parameterType="String">
- delete from sys_work_time_set where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <insert id="batchInsertByXML">
- INSERT INTO sys_work_time_set (
- id,
- org_id,
- org_name,
- month_enable,
- monday,
- tuesday,
- wednesday,
- thursday,
- friday,
- saturday,
- sunday,
- work_time,
- open_time,
- noonbreak_start,
- noonbreak_end,
- close_time,
- work_off_time,
- create_time,
- modified_id,
- modified_name,
- update_time,
- year,
- deleted,
- effective_date,
- create_by,
- update_by
- ) VALUES
- <foreach item="item" index="index" collection="list" separator=",">
- (#{item.id},
- #{item.orgId},
- #{item.orgName},
- #{item.monthEnable},
- #{item.monday},
- #{item.tuesday},
- #{item.wednesday},
- #{item.thursday},
- #{item.friday},
- #{item.saturday},
- #{item.sunday},
- #{item.workTime},
- #{item.openTime},
- #{item.noonbreakStart},
- #{item.noonbreakEnd},
- #{item.closeTime},
- #{item.workOffTime},
- #{item.createTime},
- #{item.modifiedId},
- #{item.modifiedName},
- #{item.updateTime},
- #{item.year},
- #{item.deleted},
- #{item.effectiveDate},
- #{item.createBy},
- #{item.updateBy})
- </foreach>
- </insert>
- <update id="batchUpdateByXML">
- <foreach item="item" index="index" collection="list" separator=";">
- UPDATE sys_work_time_set
- <set>
- <if test="item.orgId != null">
- org_id = #{item.orgId},
- </if>
- <if test="item.orgName != null">
- org_name = #{item.orgName},
- </if>
- <if test="item.monthEnable != null">
- month_enable = #{item.monthEnable},
- </if>
- <if test="item.monday != null">
- monday = #{item.monday},
- </if>
- <if test="item.tuesday != null">
- tuesday = #{item.tuesday},
- </if>
- <if test="item.wednesday != null">
- wednesday = #{item.wednesday},
- </if>
- <if test="item.thursday != null">
- thursday = #{item.thursday},
- </if>
- <if test="item.friday != null">
- friday = #{item.friday},
- </if>
- <if test="item.saturday != null">
- saturday = #{item.saturday},
- </if>
- <if test="item.sunday != null">
- sunday = #{item.sunday},
- </if>
- <if test="item.workTime != null and item.workTime != ''">
- work_time = #{item.workTime},
- </if>
- <if test="item.openTime != null and item.openTime != ''">
- open_time = #{item.openTime},
- </if>
- <if test="item.noonbreakStart != null and item.noonbreakStart != ''">
- noonbreak_start = #{item.noonbreakStart},
- </if>
- <if test="item.noonbreakEnd != null and item.noonbreakEnd != ''">
- noonbreak_end = #{item.noonbreakEnd},
- </if>
- <if test="item.closeTime != null and item.closeTime != ''">
- close_time = #{item.closeTime},
- </if>
- <if test="item.workOffTime != null and item.workOffTime != ''">
- work_off_time = #{item.workOffTime},
- </if>
- <if test="item.createTime != null">
- create_time = #{item.createTime},
- </if>
- <if test="item.modifiedId != null">
- modified_id = #{item.modifiedId},
- </if>
- <if test="item.modifiedName != null">
- modified_name = #{item.modifiedName},
- </if>
- <if test="item.updateTime != null">
- update_time = #{item.updateTime},
- </if>
- <if test="item.year != null">
- year = #{item.year},
- </if>
- <if test="item.deleted != null">
- deleted = #{item.deleted},
- </if>
- <if test="item.effectiveDate != null">
- effective_date = #{item.effectiveDate},
- </if>
- <if test="item.createBy != null">
- create_by = #{item.createBy},
- </if>
- <if test="item.updateBy != null">
- update_by = #{item.updateBy},
- </if>
- </set>
- WHERE id = #{item.id}
- </foreach>
- </update>
- <select id="selectByOrgIdList" resultMap="SysWorkTimeSetResult">
- select * from sys_work_time_set where org_id in
- <foreach collection="list" item="item" index="index" open="(" separator="," close=")">
- #{item}
- </foreach>
- </select>
- </mapper>
|