<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"" target="_blank">http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.morg.nbqypj.legrepinfsgm.mapper.NbqypjLegRepInfSgmMapper">
<resultMap type="NbqypjLegRepInfSgmt" id="NbqypjLegRepInfSgmResult">
<result property="iid" column="iid" />
<result property="entcertnum" column="entcertnum" />
<result property="legrepname" column="legrepname" />
<result property="legrepidtype" column="legrepidtype" />
<result property="legrepidnum" column="legrepidnum" />
<result property="legrephouseaddstat" column="legrephouseaddstat" />
<result property="legrepedulevel" column="legrepedulevel" />
<result property="legrepworkingyears" column="legrepworkingyears" />
<result property="sbzt" column="sbzt" />
<result property="sjzt" column="sjzt" />
<result property="bwbh" column="bwbh" />
<result property="disOrgId" column="dis_org_id" />
<result property="disDataDate" column="dis_data_date" />
</resultMap>
<sql id="selectNbqypjLegRepInfSgmVo">
select iid, entcertnum, legrepname, legrepidtype, legrepidnum, legrephouseaddstat, legrepedulevel, legrepworkingyears, sbzt, sjzt, bwbh, dis_org_id, dis_data_date from nbqypj_leg_rep_inf_sgm
</sql>
<select id="selectNbqypjLegRepInfSgmList" parameterType="NbqypjLegRepInfSgmt" resultMap="NbqypjLegRepInfSgmResult">
<include refid="selectNbqypjLegRepInfSgmVo"/>
<where>
<if test="legrepname != null and legrepname != ''"> and legrepname like concat('%', #{legrepname}, '%')</if>
<if test="legrepidtype != null and legrepidtype != ''"> and legrepidtype = #{legrepidtype}</if>
<if test="legrepidnum != null and legrepidnum != ''"> and legrepidnum = #{legrepidnum}</if>
<if test="legrephouseaddstat != null and legrephouseaddstat != ''"> and legrephouseaddstat = #{legrephouseaddstat}</if>
<if test="legrepedulevel != null and legrepedulevel != ''"> and legrepedulevel = #{legrepedulevel}</if>
<if test="legrepworkingyears != null "> and legrepworkingyears = #{legrepworkingyears}</if>
<if test="sbzt != null and sbzt != ''"> and sbzt = #{sbzt}</if>
<if test="sjzt != null and sjzt != ''"> and sjzt = #{sjzt}</if>
<if test="bwbh != null and bwbh != ''"> and bwbh = #{bwbh}</if>
<if test="entcertnum != null and entcertnum != ''"> and entcertnum = #{entcertnum}</if>
<if test="disOrgId != null and disOrgId != ''"> and dis_org_id = #{disOrgId}</if>
<if test="disDataDate != null and disDataDate != ''"> and dis_data_date = #{disDataDate}</if>
</where>
</select>
<select id="selectNbqypjLegRepInfSgmByIid" parameterType="Long" resultMap="NbqypjLegRepInfSgmResult">
<include refid="selectNbqypjLegRepInfSgmVo"/>
where iid = #{iid}
</select>
<select id="selectUniqueIdListByIds" parameterType="Long" resultMap="NbqypjLegRepInfSgmResult">
select entcertnum, dis_org_id, dis_data_date
from nbqypj_leg_rep_inf_sgm
where iid in
<foreach item="iid" collection="array" open="(" separator="," close=")">
#{iid}
</foreach>
</select>
<insert id="insertNbqypjLegRepInfSgm" parameterType="NbqypjLegRepInfSgmt">
insert into nbqypj_leg_rep_inf_sgm
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="entcertnum != null">entcertnum,</if>
<if test="legrepname != null">legrepname,</if>
<if test="legrepidtype != null">legrepidtype,</if>
<if test="legrepidnum != null">legrepidnum,</if>
<if test="legrephouseaddstat != null">legrephouseaddstat,</if>
<if test="legrepedulevel != null">legrepedulevel,</if>
<if test="legrepworkingyears != null">legrepworkingyears,</if>
<if test="sbzt != null">sbzt,</if>
<if test="sjzt != null">sjzt,</if>
<if test="bwbh != null">bwbh,</if>
<if test="disOrgId != null">dis_org_id,</if>
<if test="disDataDate != null">dis_data_date,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="entcertnum != null">#{entcertnum},</if>
<if test="legrepname != null">#{legrepname},</if>
<if test="legrepidtype != null">#{legrepidtype},</if>
<if test="legrepidnum != null">#{legrepidnum},</if>
<if test="legrephouseaddstat != null">#{legrephouseaddstat},</if>
<if test="legrepedulevel != null">#{legrepedulevel},</if>
<if test="legrepworkingyears != null">#{legrepworkingyears},</if>
<if test="sbzt != null">#{sbzt},</if>
<if test="sjzt != null">#{sjzt},</if>
<if test="bwbh != null">#{bwbh},</if>
<if test="disOrgId != null">#{disOrgId},</if>
<if test="disDataDate != null">#{disDataDate},</if>
</trim>
</insert>
<update id="updateNbqypjLegRepInfSgm" parameterType="NbqypjLegRepInfSgmt">
update nbqypj_leg_rep_inf_sgm
<trim prefix="SET" suffixOverrides=",">
<if test="legrepname != null">legrepname = #{legrepname},</if>
<if test="legrepidtype != null">legrepidtype = #{legrepidtype},</if>
<if test="legrepidnum != null">legrepidnum = #{legrepidnum},</if>
<if test="legrephouseaddstat != null">legrephouseaddstat = #{legrephouseaddstat},</if>
<if test="legrepedulevel != null">legrepedulevel = #{legrepedulevel},</if>
<if test="legrepworkingyears != null">legrepworkingyears = #{legrepworkingyears},</if>
<if test="sbzt != null">sbzt = #{sbzt},</if>
<if test="sjzt != null">sjzt = #{sjzt},</if>
<if test="bwbh != null">bwbh = #{bwbh},</if>
<if test="disOrgId != null">dis_org_id = #{disOrgId},</if>
<if test="disDataDate != null">dis_data_date = #{disDataDate},</if>
<if test="entcertnum != null and entcertnum != '' ">entcertnum = #{entcertnum},</if>
</trim>
where iid = #{iid}
</update>
<!-- 批量更新(逻辑删除)操作 -->
<update id="updateNbqypjLegRepInfSgmtSjztByIds" parameterType="Long">
update nbqypj_leg_rep_inf_sgm set sjzt = 'delete' where iid in
<foreach item="iid" collection="array" open="(" separator="," close=")">
#{iid}
</foreach>
</update>
<delete id="deleteNbqypjLegRepInfSgmByIid" parameterType="Long">
delete from nbqypj_leg_rep_inf_sgm where iid = #{iid}
</delete>
<delete id="deleteNbqypjLegRepInfSgmByKey" parameterType="NbqypjLegRepInfSgmt">
delete from nbqypj_leg_rep_inf_sgm where entcertnum = #{entcertnum} and dis_org_id = #{disOrgId} and dis_data_date = #{disDataDate}
</delete>
<delete id="deleteNbqypjLegRepInfSgmByIds" parameterType="String">
delete from nbqypj_leg_rep_inf_sgm where iid in
<foreach item="iid" collection="array" open="(" separator="," close=")">
#{iid}
</foreach>
</delete>
</mapper>
该文档展示了一个MyBatis的MapperXML配置文件,包括了查询、插入、更新和删除等数据库操作,涉及实体类属性映射及动态SQL条件构造。
1999





