<?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.ruoyi.zongzhi.mapper.TcZhongdianDomainMapper">
    
    <resultMap type="TcZhongdianDomain" id="TcZhongdianDomainResult">
        <result property="id"    column="id"    />
        <result property="areaId"    column="area_id"    />
        <result property="enterpriseType"    column="enterprise_type"    />
        <result property="zdjgContent"    column="zdjg_content"    />
        <result property="weifaXingwei"    column="weifa_xingwei"    />
        <result property="dep"    column="dep"    />
        <result property="zhuyaoYiju"    column="zhuyao_yiju"    />
        <result property="createId"    column="create_id"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateId"    column="update_id"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="remark"    column="remark"    />
        <result property="isStatus"    column="is_status"    />
    </resultMap>

    <sql id="selectTcZhongdianDomainVo">
        select id, area_id, enterprise_type,is_status, zdjg_content, weifa_xingwei, dep, zhuyao_yiju, create_id, create_by, create_time, update_id, update_by, update_time, remark from tc_zhongdian_domain
    </sql>

    <select id="selectTcZhongdianDomainList" parameterType="TcZhongdianDomain" resultMap="TcZhongdianDomainResult">
        <include refid="selectTcZhongdianDomainVo"/>
        <where>  
            <if test="areaId != null "> and area_id = #{areaId}</if>
            <if test="enterpriseType != null "> and enterprise_type = #{enterpriseType}</if>
            <if test="zdjgContent != null  and zdjgContent != ''"> and zdjg_content = #{zdjgContent}</if>
            <if test="weifaXingwei != null  and weifaXingwei != ''"> and weifa_xingwei = #{weifaXingwei}</if>
            <if test="dep != null  and dep != ''"> and dep = #{dep}</if>
            <if test="zhuyaoYiju != null  and zhuyaoYiju != ''"> and zhuyao_yiju = #{zhuyaoYiju}</if>
            <if test="createId != null "> and create_id = #{createId}</if>
            <if test="updateId != null "> and update_id = #{updateId}</if>
            <if test="isStatus != null "> and is_status = #{isStatus}</if>
        </where>
    </select>
    
    <select id="selectTcZhongdianDomainById" parameterType="Long" resultMap="TcZhongdianDomainResult">
        <include refid="selectTcZhongdianDomainVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertTcZhongdianDomain" parameterType="TcZhongdianDomain" useGeneratedKeys="true" keyProperty="id">
        insert into tc_zhongdian_domain
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="areaId != null">area_id,</if>
            <if test="enterpriseType != null">enterprise_type,</if>
            <if test="zdjgContent != null">zdjg_content,</if>
            <if test="weifaXingwei != null">weifa_xingwei,</if>
            <if test="dep != null">dep,</if>
            <if test="zhuyaoYiju != null">zhuyao_yiju,</if>
            <if test="createId != null">create_id,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateId != null">update_id,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="remark != null">remark,</if>
            <if test="isStatus != null">is_status,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="areaId != null">#{areaId},</if>
            <if test="enterpriseType != null">#{enterpriseType},</if>
            <if test="zdjgContent != null">#{zdjgContent},</if>
            <if test="weifaXingwei != null">#{weifaXingwei},</if>
            <if test="dep != null">#{dep},</if>
            <if test="zhuyaoYiju != null">#{zhuyaoYiju},</if>
            <if test="createId != null">#{createId},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateId != null">#{updateId},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="remark != null">#{remark},</if>
            <if test="isStatus != null">#{isStatus},</if>
         </trim>
    </insert>

    <update id="updateTcZhongdianDomain" parameterType="TcZhongdianDomain">
        update tc_zhongdian_domain
        <trim prefix="SET" suffixOverrides=",">
            <if test="areaId != null">area_id = #{areaId},</if>
            <if test="enterpriseType != null">enterprise_type = #{enterpriseType},</if>
            <if test="zdjgContent != null">zdjg_content = #{zdjgContent},</if>
            <if test="weifaXingwei != null">weifa_xingwei = #{weifaXingwei},</if>
            <if test="dep != null">dep = #{dep},</if>
            <if test="zhuyaoYiju != null">zhuyao_yiju = #{zhuyaoYiju},</if>
            <if test="createId != null">create_id = #{createId},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateId != null">update_id = #{updateId},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="remark != null">remark = #{remark},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteTcZhongdianDomainById" parameterType="Long">
        delete from tc_zhongdian_domain where id = #{id}
    </delete>

    <delete id="deleteTcZhongdianDomainByIds" parameterType="String">
        delete from tc_zhongdian_domain where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>