<?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.goldenwater.slaj.hidd.mapper.TDictHiddEngMapper">
    <resultMap type="com.goldenwater.slaj.hidd.domain.TDictHiddEng" id="TDictHiddEngResult">
        <result property="id" column="id"/>
        <result property="dictCode" column="dict_code"/>
        <result property="dictName" column="dict_name"/>
        <result property="dictValue" column="dict_value"/>
        <result property="sortNum" column="sort_num"/>
        <result property="status" column="status"/>
        <result property="hiddContent" column="hidd_content"/>
        <result property="engStat" column="eng_stat"/>
    </resultMap>
    <sql id="selectTDictHiddEngVo">
        select id, dict_code, dict_name, dict_value, sort_num, status, hidd_content, eng_stat
        from t_dict_hidd_eng
    </sql>
    <select id="selectTDictHiddEngById" parameterType="Long" resultMap="TDictHiddEngResult">
        <include refid="selectTDictHiddEngVo"/>
        where id = #{id}
    </select>
    <select id="selectTDictHiddEngList" parameterType="com.goldenwater.slaj.hidd.domain.TDictHiddEng" resultMap="TDictHiddEngResult">
        <include refid="selectTDictHiddEngVo"/>
        <where>
            <if test="dictCode != null and dictCode != ''">AND dict_code = #{dictCode}</if>
            <if test="dictName != null and dictName != ''">AND dict_name like '%' || #{dictName} || '%'</if>
            <if test="status != null and status != ''">AND status = #{status}</if>
        </where>
    </select>
    <insert id="insertTDictHiddEng" parameterType="com.goldenwater.slaj.hidd.domain.TDictHiddEng">
        insert into t_dict_hidd_eng (dict_code, dict_name, dict_value, sort_num, status, hidd_content, eng_stat)
        values (#{dictCode}, #{dictName}, #{dictValue}, #{sortNum}, #{status}, #{hiddContent}, #{engStat})
    </insert>
    <update id="updateTDictHiddEng" parameterType="com.goldenwater.slaj.hidd.domain.TDictHiddEng">
        update t_dict_hidd_eng
        <set>
            <if test="dictCode != null">dict_code = #{dictCode},</if>
            <if test="dictName != null">dict_name = #{dictName},</if>
            <if test="dictValue != null">dict_value = #{dictValue},</if>
            <if test="sortNum != null">sort_num = #{sortNum},</if>
            <if test="status != null">status = #{status},</if>
            <if test="hiddContent != null">hidd_content = #{hiddContent},</if>
            <if test="engStat != null">eng_stat = #{engStat},</if>
        </set>
        where id = #{id}
    </update>
    <delete id="deleteTDictHiddEngById" parameterType="Long">
        delete from t_dict_hidd_eng where id = #{id}
    </delete>
    <delete id="deleteTDictHiddEngByIds" parameterType="Long">
        delete from t_dict_hidd_eng where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
