|
@@ -0,0 +1,136 @@
|
|
|
+<?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.gqy.document.mapper.DcbBlockMapper">
|
|
|
+
|
|
|
+ <!-- 数据块表结果映射 -->
|
|
|
+ <resultMap type="DcbBlock" id="DcbBlockResult">
|
|
|
+ <id property="dcbId" column="dcb_id" />
|
|
|
+ <result property="dcbName" column="dcb_name" />
|
|
|
+ <result property="dcbLayId" column="dcb_lay_id" />
|
|
|
+ <result property="dcbType" column="dcb_type" />
|
|
|
+ <result property="dcbNr" column="dcb_nr" />
|
|
|
+ <result property="dcbShare" column="dcb_share" />
|
|
|
+ <result property="dcbAttrs" column="dcb_attrs" />
|
|
|
+ <result property="dcbOwner" column="dcb_owner" />
|
|
|
+ <result property="dcbNo" column="dcb_no" />
|
|
|
+ <result property="dcbStatus" column="dcb_status" />
|
|
|
+ <result property="dcbReId" column="dcb_re_id" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!-- 数据块表字段 -->
|
|
|
+ <sql id="selectDcbBlockVo">
|
|
|
+ select dcb_id, dcb_name, dcb_lay_id, dcb_type, dcb_nr, dcb_share, dcb_attrs,
|
|
|
+ dcb_owner, dcb_no, dcb_status, dcb_re_id
|
|
|
+ from dcb_block
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <!-- 查询数据块列表 -->
|
|
|
+ <select id="selectDcbBlockList" parameterType="DcbBlock" resultMap="DcbBlockResult">
|
|
|
+ <include refid="selectDcbBlockVo"/>
|
|
|
+ <where>
|
|
|
+ <!-- 根据名称模糊查询 -->
|
|
|
+ <if test="dcbName != null and dcbName != ''">
|
|
|
+ AND dcb_name like concat('%', #{dcbName}, '%')
|
|
|
+ </if>
|
|
|
+ <!-- 根据布局ID精确查询 -->
|
|
|
+ <if test="dcbLayId != null and dcbLayId != ''">
|
|
|
+ AND dcb_lay_id = #{dcbLayId}
|
|
|
+ </if>
|
|
|
+ <!-- 根据类型精确查询 -->
|
|
|
+ <if test="dcbType != null and dcbType != ''">
|
|
|
+ AND dcb_type = #{dcbType}
|
|
|
+ </if>
|
|
|
+ <!-- 根据共享标志查询 -->
|
|
|
+ <if test="dcbShare != null">
|
|
|
+ AND dcb_share = #{dcbShare}
|
|
|
+ </if>
|
|
|
+ <!-- 根据所有者查询 -->
|
|
|
+ <if test="dcbOwner != null">
|
|
|
+ AND dcb_owner = #{dcbOwner}
|
|
|
+ </if>
|
|
|
+ <!-- 根据编号精确查询 -->
|
|
|
+ <if test="dcbNo != null and dcbNo != ''">
|
|
|
+ AND dcb_no = #{dcbNo}
|
|
|
+ </if>
|
|
|
+ <!-- 根据状态查询 -->
|
|
|
+ <if test="dcbStatus != null">
|
|
|
+ AND dcb_status = #{dcbStatus}
|
|
|
+ </if>
|
|
|
+ <!-- 根据关联ID查询 -->
|
|
|
+ <if test="dcbReId != null">
|
|
|
+ AND dcb_re_id = #{dcbReId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询单个数据块 -->
|
|
|
+ <select id="selectDcbBlockById" parameterType="Long" resultMap="DcbBlockResult">
|
|
|
+ <include refid="selectDcbBlockVo"/>
|
|
|
+ where dcb_id = #{dcbId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 新增数据块 -->
|
|
|
+ <insert id="insertDcbBlock" parameterType="DcbBlock">
|
|
|
+ insert into dcb_block
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="dcbId != null">dcb_id,</if>
|
|
|
+ <if test="dcbName != null">dcb_name,</if>
|
|
|
+ <if test="dcbLayId != null">dcb_lay_id,</if>
|
|
|
+ <if test="dcbType != null">dcb_type,</if>
|
|
|
+ <if test="dcbNr != null">dcb_nr,</if>
|
|
|
+ <if test="dcbShare != null">dcb_share,</if>
|
|
|
+ <if test="dcbAttrs != null">dcb_attrs,</if>
|
|
|
+ <if test="dcbOwner != null">dcb_owner,</if>
|
|
|
+ <if test="dcbNo != null">dcb_no,</if>
|
|
|
+ <if test="dcbStatus != null">dcb_status,</if>
|
|
|
+ <if test="dcbReId != null">dcb_re_id,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="dcbId != null">#{dcbId},</if>
|
|
|
+ <if test="dcbName != null">#{dcbName},</if>
|
|
|
+ <if test="dcbLayId != null">#{dcbLayId},</if>
|
|
|
+ <if test="dcbType != null">#{dcbType},</if>
|
|
|
+ <if test="dcbNr != null">#{dcbNr},</if>
|
|
|
+ <if test="dcbShare != null">#{dcbShare},</if>
|
|
|
+ <if test="dcbAttrs != null">#{dcbAttrs},</if>
|
|
|
+ <if test="dcbOwner != null">#{dcbOwner},</if>
|
|
|
+ <if test="dcbNo != null">#{dcbNo},</if>
|
|
|
+ <if test="dcbStatus != null">#{dcbStatus},</if>
|
|
|
+ <if test="dcbReId != null">#{dcbReId},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!-- 修改数据块 -->
|
|
|
+ <update id="updateDcbBlock" parameterType="DcbBlock">
|
|
|
+ update dcb_block
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="dcbName != null">dcb_name = #{dcbName},</if>
|
|
|
+ <if test="dcbLayId != null">dcb_lay_id = #{dcbLayId},</if>
|
|
|
+ <if test="dcbType != null">dcb_type = #{dcbType},</if>
|
|
|
+ <if test="dcbNr != null">dcb_nr = #{dcbNr},</if>
|
|
|
+ <if test="dcbShare != null">dcb_share = #{dcbShare},</if>
|
|
|
+ <if test="dcbAttrs != null">dcb_attrs = #{dcbAttrs},</if>
|
|
|
+ <if test="dcbOwner != null">dcb_owner = #{dcbOwner},</if>
|
|
|
+ <if test="dcbNo != null">dcb_no = #{dcbNo},</if>
|
|
|
+ <if test="dcbStatus != null">dcb_status = #{dcbStatus},</if>
|
|
|
+ <if test="dcbReId != null">dcb_re_id = #{dcbReId},</if>
|
|
|
+ </trim>
|
|
|
+ where dcb_id = #{dcbId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!-- 删除单个数据块 -->
|
|
|
+ <delete id="deleteDcbBlockById" parameterType="Long">
|
|
|
+ delete from dcb_block where dcb_id = #{dcbId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <!-- 批量删除数据块 -->
|
|
|
+ <delete id="deleteDcbBlockByIds" parameterType="String">
|
|
|
+ delete from dcb_block where dcb_id in
|
|
|
+ <foreach item="dcbId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{dcbId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|