<?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.TRegionHazardInformMapper">
|
<resultMap id="BaseResultMap" type="com.thhy.secure.modules.biz.regionHazardInform.entity.TRegionHazardInformEntity">
|
<!--
|
WARNING - @mbg.generated
|
This element is automatically generated by MyBatis Generator, do not modify.
|
This element was generated on Fri Jun 02 10:07:36 CST 2023.
|
-->
|
<id column="id" jdbcType="VARCHAR" property="id" />
|
<result column="region" jdbcType="VARCHAR" property="region" />
|
<result column="level" jdbcType="INTEGER" property="level" />
|
<result column="region_color" jdbcType="VARCHAR" property="regionColor" />
|
<result column="company_id" jdbcType="VARCHAR" property="companyId" />
|
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
</resultMap>
|
|
|
<insert id="insert" >
|
insert into t_region_hazard_inform
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
id,
|
</if>
|
<if test="region != null">
|
region,
|
</if>
|
<if test="level != null">
|
`level`,
|
</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>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
#{id,jdbcType=VARCHAR},
|
</if>
|
<if test="region != null">
|
#{region,jdbcType=VARCHAR},
|
</if>
|
<if test="level != null">
|
#{level,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>
|
</trim>
|
</insert>
|
<select id="findAll" parameterType="com.thhy.secure.modules.biz.regionHazardInform.dto.TRegionHazardInformDto" resultMap="BaseResultMap">
|
SELECT
|
id,
|
region,
|
`level`,
|
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="level!=null and level!='' ">
|
and `level`=#{level}
|
</if>
|
order by create_time desc
|
</select>
|
<select id="findEntity" parameterType="java.lang.String" resultType="com.thhy.secure.modules.biz.regionHazardInform.entity.TRegionHazardInformEntity">
|
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="level != null">
|
level = #{level,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>
|
<delete id="delete">
|
update t_region_hazard_inform set is_use = 2 where id = #{id,jdbcType=VARCHAR}
|
</delete>
|
</mapper>
|