|
@@ -0,0 +1,105 @@
|
|
|
+<?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">
|
|
|
+<!-- namespace必须指向DAO接口 -->
|
|
|
+<mapper namespace="com.jpsoft.smart.modules.base.dao.AlarmConfigDAO">
|
|
|
+ <resultMap id="AlarmConfigMap" type="com.jpsoft.smart.modules.base.entity.AlarmConfig">
|
|
|
+ <result property="id" column="id_"/>
|
|
|
+ <result property="companyId" column="company_id"/>
|
|
|
+ <result property="weekdays" column="weekdays_"/>
|
|
|
+ <result property="startTime" column="start_time"/>
|
|
|
+ <result property="endTime" column="end_time"/>
|
|
|
+ <result property="delFlag" column="del_flag"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ </resultMap>
|
|
|
+ <insert id="insert" parameterType="com.jpsoft.smart.modules.base.entity.AlarmConfig">
|
|
|
+ <!--
|
|
|
+ <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="${pkFieldName}">
|
|
|
+ select sys_guid() from dual
|
|
|
+ </selectKey>
|
|
|
+ -->
|
|
|
+ <![CDATA[
|
|
|
+ insert into base_alarm_config
|
|
|
+ (id_,company_id,weekdays_,start_time,end_time,del_flag,create_by,create_time,update_by,update_time)
|
|
|
+ values
|
|
|
+ (
|
|
|
+ #{id,jdbcType=VARCHAR}
|
|
|
+ ,#{companyId,jdbcType=VARCHAR}
|
|
|
+ ,#{weekdays,jdbcType=VARCHAR}
|
|
|
+ ,#{startTime,jdbcType=VARCHAR}
|
|
|
+ ,#{endTime,jdbcType=VARCHAR}
|
|
|
+ ,#{delFlag,jdbcType= NUMERIC }
|
|
|
+ ,#{createBy,jdbcType=VARCHAR}
|
|
|
+ ,#{createTime,jdbcType= TIMESTAMP }
|
|
|
+ ,#{updateBy,jdbcType=VARCHAR}
|
|
|
+ ,#{updateTime,jdbcType= TIMESTAMP }
|
|
|
+ )
|
|
|
+ ]]>
|
|
|
+ </insert>
|
|
|
+ <delete id="delete" parameterType="string">
|
|
|
+ delete from base_alarm_config where ${pkField.columnName}=#{$pkFieldName,jdbcType=VARCHAR}
|
|
|
+ </delete>
|
|
|
+ <update id="update" parameterType="com.jpsoft.smart.modules.base.entity.AlarmConfig">
|
|
|
+ update base_alarm_config
|
|
|
+ <set>
|
|
|
+ <if test="id!=null">
|
|
|
+ id_=#{id,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="companyId!=null">
|
|
|
+ company_id=#{companyId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="weekdays!=null">
|
|
|
+ weekdays_=#{weekdays,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="startTime!=null">
|
|
|
+ start_time=#{startTime,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="endTime!=null">
|
|
|
+ end_time=#{endTime,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="delFlag!=null">
|
|
|
+ del_flag=#{delFlag,jdbcType= NUMERIC },
|
|
|
+ </if>
|
|
|
+ <if test="createBy!=null">
|
|
|
+ create_by=#{createBy,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createTime!=null">
|
|
|
+ create_time=#{createTime,jdbcType= TIMESTAMP },
|
|
|
+ </if>
|
|
|
+ <if test="updateBy!=null">
|
|
|
+ update_by=#{updateBy,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime!=null">
|
|
|
+ update_time=#{updateTime,jdbcType= TIMESTAMP },
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where ${pkField.ColumnName}=#{$pkFieldName}
|
|
|
+ </update>
|
|
|
+ <select id="get" parameterType="string" resultMap="AlarmConfigMap">
|
|
|
+ select
|
|
|
+ id_,company_id,weekdays_,start_time,end_time,del_flag,create_by,create_time,update_by,update_time from
|
|
|
+ base_alarm_config where ${pkField.ColumnName}=#{0}
|
|
|
+ </select>
|
|
|
+ <select id="exist" parameterType="string" resultType="int">
|
|
|
+ select count(*) from base_alarm_config where ${pkField.ColumnName}=#{0}
|
|
|
+ </select>
|
|
|
+ <select id="list" resultMap="AlarmConfigMap">
|
|
|
+ select * from base_alarm_config where del_flag=0
|
|
|
+ </select>
|
|
|
+ <select id="search" parameterType="hashmap" resultMap="AlarmConfigMap">
|
|
|
+ <![CDATA[
|
|
|
+ select * from base_alarm_config
|
|
|
+ ]]>
|
|
|
+ <where>
|
|
|
+ <if test="searchParams.id != null">
|
|
|
+ and ID_ like #{searchParams.id}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <foreach item="sort" collection="sortList" open="order by" separator=",">
|
|
|
+ ${sort.name} ${sort.order}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
+</mapper>
|