| | |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="holidays" column="holidays" /> |
| | | <result property="applicable" column="applicable" /> |
| | | <result property="applicableTranslate" column="applicable_translate" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectApsWorkCalendarVo"> |
| | | select id, description, type, effective_date, expiring_date, content, applicable_factory, applicable_workshop, applicable_process, create_by, create_time, update_by, update_time from aps_work_calendar |
| | | select id, description, type, effective_date, expiring_date, content, applicable_factory, applicable_workshop, applicable_process, create_by, create_time, update_by, update_time, holidays, applicable, applicable_translate from aps_work_calendar |
| | | </sql> |
| | | |
| | | <select id="selectApsWorkCalendarList" parameterType="ApsWorkCalendar" resultMap="ApsWorkCalendarResult"> |
| | |
| | | <if test="type != null and type != ''"> and type = #{type}</if> |
| | | <if test="effectiveDate != null and expiringDate != null"> and ((effective_date >= #{effectiveDate} and effective_date <= #{expiringDate}) or (expiring_date >= #{effectiveDate} and expiring_date <= #{expiringDate}))</if> |
| | | <!-- <if test="content != null and content != ''"> and content = #{content}</if>--> |
| | | <if test="applicableFactory != null and applicableFactory != ''"> and applicable_factory = #{applicableFactory}</if> |
| | | <if test="applicableFactory != null and applicableFactory != ''"> |
| | | and EXISTS ( |
| | | SELECT 1 |
| | | FROM jsonb_array_elements(applicable) AS obj |
| | | WHERE obj ->> 'factory' = #{applicableFactory} |
| | | ) |
| | | </if> |
| | | <if test="applicableWorkshop != null and applicableWorkshop != ''"> and applicable_workshop = #{applicableWorkshop}</if> |
| | | <if test="applicableProcess != null and applicableProcess != ''"> and applicable_process = #{applicableProcess}</if> |
| | | </where> |
| | |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateBy != null">update_by,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | <if test="holidays != null">holidays,</if> |
| | | <if test="applicable != null">applicable,</if> |
| | | <if test="applicableTranslate != null">applicable_translate,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateBy != null">#{updateBy},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | <if test="holidays != null">#{holidays, typeHandler=com.aps.core.typeHandler.JsonTypeHandler, jdbcType=OTHER},</if> |
| | | <if test="applicable != null">#{applicable, typeHandler=com.aps.core.typeHandler.JsonTypeHandler, jdbcType=OTHER},</if> |
| | | <if test="applicableTranslate != null">#{applicableTranslate},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | | <if test="updateBy != null">update_by = #{updateBy},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | <if test="holidays != null">holidays = #{holidays, typeHandler=com.aps.core.typeHandler.JsonTypeHandler, jdbcType=OTHER},</if> |
| | | <if test="applicable != null">applicable = #{applicable, typeHandler=com.aps.core.typeHandler.JsonTypeHandler, jdbcType=OTHER},</if> |
| | | <if test="applicableTranslate != null">applicable_translate = #{applicableTranslate},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | delete from aps_work_calendar where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteApsWorkCalendarByIds" parameterType="String"> |
| | | delete from aps_work_calendar where id in |
| | | <delete id="deleteApsWorkCalendarByIds" parameterType="ApsWorkCalendar"> |
| | | delete from aps_work_calendar where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <delete id="deleteApsWorkCalendar" parameterType="ApsWorkCalendar"> |
| | | delete from aps_work_calendar where effective_date=#{effectiveDate} and expiring_date=#{expiringDate} and applicable_factory=#{applicableFactory} and applicable_workshop=#{applicableWorkshop} and applicable_process=#{applicableProcess} |
| | | </delete> |
| | | </mapper> |