<?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.party.mapper.PartyOrganizationErrorMapper">
    
    <resultMap type="PartyOrganizationError" id="PartyOrganizationErrorResult">
        <result property="id"    column="id"    />
        <result property="dzzdm"    column="dzzdm"    />
        <result property="dzzmc"    column="dzzmc"    />
        <result property="dzzsj"    column="dzzsj"    />
        <result property="dzzlxr"    column="dzzlxr"    />
        <result property="dzzlxdh"    column="dzzlxdh"    />
        <result property="zzlb"    column="zzlb"    />
        <result property="sdgx"    column="sdgx"    />
        <result property="sjdzzdm"    column="sjdzzdm"    />
        <result property="txdz"    column="txdz"    />
        <result property="sswg"    column="sswg"    />
        <result property="dw"    column="dw"    />
        <result property="remark"    column="remark"    />
        <result property="createTime"    column="create_time"    />
    </resultMap>

    <sql id="selectPartyOrganizationErrorVo">
        select id, dzzdm, dzzmc, dzzsj, dzzlxr, dzzlxdh, zzlb, sdgx, sjdzzdm, txdz, sswg, dw, remark, create_time from party_organization_error
    </sql>

    <select id="selectPartyOrganizationErrorList" parameterType="PartyOrganizationError" resultMap="PartyOrganizationErrorResult">
        <include refid="selectPartyOrganizationErrorVo"/>
        <where>  
            <if test="dzzdm != null  and dzzdm != ''"> and dzzdm = #{dzzdm}</if>
            <if test="dzzmc != null  and dzzmc != ''"> and dzzmc = #{dzzmc}</if>
            <if test="dzzsj != null  and dzzsj != ''"> and dzzsj = #{dzzsj}</if>
            <if test="dzzlxr != null  and dzzlxr != ''"> and dzzlxr = #{dzzlxr}</if>
            <if test="dzzlxdh != null  and dzzlxdh != ''"> and dzzlxdh = #{dzzlxdh}</if>
            <if test="zzlb != null  and zzlb != ''"> and zzlb = #{zzlb}</if>
            <if test="sdgx != null  and sdgx != ''"> and sdgx = #{sdgx}</if>
            <if test="sjdzzdm != null  and sjdzzdm != ''"> and sjdzzdm = #{sjdzzdm}</if>
            <if test="txdz != null  and txdz != ''"> and txdz = #{txdz}</if>
            <if test="sswg != null  and sswg != ''"> and sswg = #{sswg}</if>
            <if test="dw != null  and dw != ''"> and dw = #{dw}</if>
        </where>
    </select>
    
    <select id="selectPartyOrganizationErrorById" parameterType="Long" resultMap="PartyOrganizationErrorResult">
        <include refid="selectPartyOrganizationErrorVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertPartyOrganizationError" parameterType="PartyOrganizationError" useGeneratedKeys="true" keyProperty="id">
        insert into party_organization_error
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="dzzdm != null and dzzdm != ''">dzzdm,</if>
            <if test="dzzmc != null and dzzmc != ''">dzzmc,</if>
            <if test="dzzsj != null and dzzsj != ''">dzzsj,</if>
            <if test="dzzlxr != null and dzzlxr != ''">dzzlxr,</if>
            <if test="dzzlxdh != null and dzzlxdh != ''">dzzlxdh,</if>
            <if test="zzlb != null and zzlb != ''">zzlb,</if>
            <if test="sdgx != null and sdgx != ''">sdgx,</if>
            <if test="sjdzzdm != null">sjdzzdm,</if>
            <if test="txdz != null">txdz,</if>
            <if test="sswg != null">sswg,</if>
            <if test="dw != null">dw,</if>
            <if test="remark != null">remark,</if>
            <if test="createTime != null">create_time,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="dzzdm != null and dzzdm != ''">#{dzzdm},</if>
            <if test="dzzmc != null and dzzmc != ''">#{dzzmc},</if>
            <if test="dzzsj != null and dzzsj != ''">#{dzzsj},</if>
            <if test="dzzlxr != null and dzzlxr != ''">#{dzzlxr},</if>
            <if test="dzzlxdh != null and dzzlxdh != ''">#{dzzlxdh},</if>
            <if test="zzlb != null and zzlb != ''">#{zzlb},</if>
            <if test="sdgx != null and sdgx != ''">#{sdgx},</if>
            <if test="sjdzzdm != null">#{sjdzzdm},</if>
            <if test="txdz != null">#{txdz},</if>
            <if test="sswg != null">#{sswg},</if>
            <if test="dw != null">#{dw},</if>
            <if test="remark != null">#{remark},</if>
            <if test="createTime != null">#{createTime},</if>
         </trim>
    </insert>

    <update id="updatePartyOrganizationError" parameterType="PartyOrganizationError">
        update party_organization_error
        <trim prefix="SET" suffixOverrides=",">
            <if test="dzzdm != null and dzzdm != ''">dzzdm = #{dzzdm},</if>
            <if test="dzzmc != null and dzzmc != ''">dzzmc = #{dzzmc},</if>
            <if test="dzzsj != null and dzzsj != ''">dzzsj = #{dzzsj},</if>
            <if test="dzzlxr != null and dzzlxr != ''">dzzlxr = #{dzzlxr},</if>
            <if test="dzzlxdh != null and dzzlxdh != ''">dzzlxdh = #{dzzlxdh},</if>
            <if test="zzlb != null and zzlb != ''">zzlb = #{zzlb},</if>
            <if test="sdgx != null and sdgx != ''">sdgx = #{sdgx},</if>
            <if test="sjdzzdm != null">sjdzzdm = #{sjdzzdm},</if>
            <if test="txdz != null">txdz = #{txdz},</if>
            <if test="sswg != null">sswg = #{sswg},</if>
            <if test="dw != null">dw = #{dw},</if>
            <if test="remark != null">remark = #{remark},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deletePartyOrganizationErrorById" parameterType="Long">
        delete from party_organization_error where id = #{id}
    </delete>

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