<?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.thhy.secure.modules.biz.regionHazardInform.mapper.RegionHazardInformMapper">
|
<resultMap id="BaseResultMap" type="com.thhy.secure.modules.biz.regionHazardInform.entity.RegionHazardInformEntity">
|
<id column="id" jdbcType="VARCHAR" property="id" />
|
<result column="region" jdbcType="VARCHAR" property="region" />
|
<result column="level_type" jdbcType="INTEGER" property="levelType" />
|
<result column="region_color" jdbcType="VARCHAR" property="regionColor" />
|
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
<result column="company_id" jdbcType="VARCHAR" property="companyId" />
|
<result column="is_use" jdbcType="INTEGER" property="isUse" />
|
</resultMap>
|
<insert id="insertTRegionHazardInform" >
|
insert into t_region_hazard_inform
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
id,
|
</if>
|
<if test="region != null">
|
region,
|
</if>
|
<if test="levelType != null">
|
level_type,
|
</if>
|
<if test="regionColor != null">
|
region_color,
|
</if>
|
<if test="createTime != null">
|
create_time,
|
</if>
|
<if test="createUser != null">
|
create_user,
|
</if>
|
<if test="companyId != null">
|
company_id,
|
</if>
|
<if test="isUse != null">
|
is_use,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id!= null">
|
#{id,jdbcType=VARCHAR},
|
</if>
|
<if test="region!= null">
|
#{region,jdbcType=VARCHAR},
|
</if>
|
<if test="levelType!= null">
|
#{levelType,jdbcType=INTEGER},
|
</if>
|
<if test="regionColor!= null">
|
#{regionColor,jdbcType=VARCHAR},
|
</if>
|
<if test="createTime!= null">
|
#{createTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="createUser!= null">
|
#{createUser,jdbcType=VARCHAR},
|
</if>
|
<if test="companyId!= null">
|
#{companyId,jdbcType=VARCHAR},
|
</if>
|
<if test="isUse != null">
|
#{isUse,jdbcType=INTEGER},
|
</if>
|
</trim>
|
</insert>
|
|
<select id="findAllRegionHazardInform" parameterType="com.thhy.secure.modules.biz.regionHazardInform.dto.TRegionHazardInformDto" resultType="com.thhy.secure.modules.biz.regionHazardInform.entity.RegionHazardInformEntity">
|
SELECT
|
id,
|
region,
|
level_type,
|
region_color,
|
company_id,
|
create_user,
|
create_time,
|
is_use
|
FROM
|
t_region_hazard_inform
|
WHERE
|
is_use = 1
|
<if test="companyId!=null and companyId!='' ">
|
and company_id=#{companyId}
|
</if>
|
<if test="levelType!=null and levelType!='' ">
|
and level_type=#{levelType}
|
</if>
|
order by create_time desc
|
</select>
|
<select id="findEntity" parameterType="java.lang.String" resultType="com.thhy.secure.modules.biz.regionHazardInform.entity.RegionHazardInformEntity">
|
SELECT
|
id,
|
region,
|
`level`,
|
region_color,
|
company_id,
|
create_user,
|
create_time,
|
is_use
|
FROM
|
t_region_hazard_inform
|
WHERE
|
is_use = 1 and id = #{id,jdbcType=VARCHAR}
|
</select>
|
<update id="update">
|
update t_region_hazard_inform
|
<set>
|
<if test="levelType != null">
|
level_type = #{levelType,jdbcType=INTEGER},
|
</if>
|
<if test="region != null">
|
region = #{region,jdbcType=VARCHAR},
|
</if>
|
<if test="regionColor != null">
|
region_color = #{regionColor,jdbcType=VARCHAR},
|
</if>
|
</set>
|
where id = #{id,jdbcType=VARCHAR}
|
</update>
|
<update id="delete" parameterType="java.lang.String">
|
update t_region_hazard_inform set is_use = 2 where id = #{id,jdbcType=VARCHAR}
|
</update>
|
</mapper>
|