<?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.yssh.mapper.AlertConfigMapper">
|
<resultMap id="AlertConfigResult" type="com.yssh.entity.AlertConfig">
|
<id column="id" property="id" />
|
<result column="jcyj" property="jcyj" />
|
<result column="jcbj" property="jcbj" />
|
<result column="pfyj" property="pfyj" />
|
<result column="pfbj" property="pfbj" />
|
</resultMap>
|
|
<sql id="alertConfigSQL">
|
SELECT id, jcyj, jcbj, pfyj, pfbj
|
FROM alert_config
|
</sql>
|
|
<select id="getAll" resultMap="AlertConfigResult">
|
<include refid="alertConfigSQL"></include>
|
</select>
|
|
<select id="query" resultMap="AlertConfigResult" parameterType="Integer">
|
<include refid="alertConfigSQL"></include>
|
WHERE id= #{id}
|
</select>
|
|
<insert id="insert" parameterType="com.yssh.entity.AlertConfig">
|
insert into alert_config (
|
jcyj, jcbj, pfyj, pfbj
|
)
|
values (
|
#{jcyj},#{jcbj},#{pfyj},#{pfbj}
|
)
|
</insert>
|
|
<update id="update" parameterType="com.yssh.entity.AlertConfig">
|
update alert_config
|
<set >
|
<if test="jcyj != null and jcyj != ''">
|
jcyj = #{jcyj},
|
</if>
|
<if test="jcbj != null and jcbj != ''">
|
jcbj = #{jcbj},
|
</if>
|
<if test="pfbj != null and pfbj != ''">
|
pfbj = #{pfbj},
|
</if>
|
<if test="pfyj != null and pfyj != ''">
|
pfyj = #{pfyj},
|
</if>
|
</set>
|
where id = #{id}
|
</update>
|
|
<delete id="delete" parameterType="Integer">
|
DELETE FROM alert_config WHERE id = #{id}
|
</delete>
|
</mapper>
|