258 lines
11 KiB
XML
258 lines
11 KiB
XML
<?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.adc.da.slrs.standardSplit.dao.SarFileSplitItemsTableEODao" >
|
|
<!-- Result Map-->
|
|
<resultMap id="BaseResultMap" type="com.adc.da.slrs.standardSplit.entity.SarFileSplitItemsTableEO" >
|
|
<id column="id" property="id" />
|
|
<result column="items_val_id" property="itemsValId" />
|
|
<result column="items_id" property="itemsId" />
|
|
<result column="row_num" property="rowNum" />
|
|
<result column="col_num" property="colNum" />
|
|
<result column="content" property="content" />
|
|
<result column="valid_flag" property="validFlag" />
|
|
<result column="creation_time" property="creationTime" />
|
|
<result column="modify_time" property="modifyTime" />
|
|
<result column="modify_user" property="modifyUser" />
|
|
</resultMap>
|
|
|
|
<!-- SAR_FILE_SPLIT_ITEMS_TABLE table all fields -->
|
|
<sql id="Base_Column_List" >
|
|
id, items_val_id, items_id, row_num, col_num, content, valid_flag, creation_time, modify_time, modify_user
|
|
</sql>
|
|
|
|
<!-- 查询条件 -->
|
|
<sql id="Base_Where_Clause">
|
|
where 1=1
|
|
<trim suffixOverrides="," >
|
|
<if test="id != null" >
|
|
and id ${idOperator} #{id}
|
|
</if>
|
|
<if test="itemsValId != null" >
|
|
and items_val_id ${itemsValIdOperator} #{itemsValId}
|
|
</if>
|
|
<if test="itemsId != null" >
|
|
and items_id ${itemsIdOperator} #{itemsId}
|
|
</if>
|
|
<if test="rowNum != null" >
|
|
and row_num ${rowNumOperator} #{rowNum}
|
|
</if>
|
|
<if test="colNum != null" >
|
|
and col_num ${colNumOperator} #{colNum}
|
|
</if>
|
|
<if test="content != null" >
|
|
and content ${contentOperator} #{content}
|
|
</if>
|
|
<if test="validFlag != null" >
|
|
and valid_flag ${validFlagOperator} #{validFlag}
|
|
</if>
|
|
<if test="creationTime != null" >
|
|
and creation_time ${creationTimeOperator} #{creationTime}
|
|
</if>
|
|
<if test="creationTime1 != null" >
|
|
and creation_time >= #{creationTime1}
|
|
</if>
|
|
<if test="creationTime2 != null" >
|
|
and creation_time <= #{creationTime2}
|
|
</if>
|
|
<if test="modifyTime != null" >
|
|
and modify_time ${modifyTimeOperator} #{modifyTime}
|
|
</if>
|
|
<if test="modifyTime1 != null" >
|
|
and modify_time >= #{modifyTime1}
|
|
</if>
|
|
<if test="modifyTime2 != null" >
|
|
and modify_time <= #{modifyTime2}
|
|
</if>
|
|
<if test="modifyUser != null" >
|
|
and modify_user ${modifyUserOperator} #{modifyUser}
|
|
</if>
|
|
</trim>
|
|
</sql>
|
|
|
|
<!-- 插入记录 -->
|
|
<insert id="insert" parameterType="com.adc.da.slrs.standardSplit.entity.SarFileSplitItemsTableEO" >
|
|
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
|
SELECT SEQ_SAR_FILE_SPLIT_ITEMS_TABLE.NEXTVAL FROM DUAL
|
|
</selectKey> -->
|
|
insert into SAR_FILE_SPLIT_ITEMS_TABLE(<include refid="Base_Column_List" />)
|
|
values (#{id, jdbcType=VARCHAR}, #{itemsValId, jdbcType=VARCHAR}, #{itemsId, jdbcType=VARCHAR}, #{rowNum, jdbcType=INTEGER}, #{colNum, jdbcType=INTEGER}, #{content, jdbcType=VARCHAR}, #{validFlag, jdbcType=INTEGER}, #{creationTime, jdbcType=TIMESTAMP}, #{modifyTime, jdbcType=TIMESTAMP}, #{modifyUser, jdbcType=VARCHAR})
|
|
</insert>
|
|
|
|
<!-- 动态插入记录 主键是序列 -->
|
|
<insert id="insertSelective" parameterType="com.adc.da.slrs.standardSplit.entity.SarFileSplitItemsTableEO" >
|
|
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
|
SELECT SEQ_SAR_FILE_SPLIT_ITEMS_TABLE.NEXTVAL FROM DUAL
|
|
</selectKey> -->
|
|
insert into SAR_FILE_SPLIT_ITEMS_TABLE
|
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
|
<if test="id != null" >id,</if>
|
|
<if test="itemsValId != null" >items_val_id,</if>
|
|
<if test="itemsId != null" >items_id,</if>
|
|
<if test="rowNum != null" >row_num,</if>
|
|
<if test="colNum != null" >col_num,</if>
|
|
<if test="content != null" >content,</if>
|
|
<if test="validFlag != null" >valid_flag,</if>
|
|
<if test="creationTime != null" >creation_time,</if>
|
|
<if test="modifyTime != null" >modify_time,</if>
|
|
<if test="modifyUser != null" >modify_user,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
|
|
<if test="itemsValId != null" >#{itemsValId, jdbcType=VARCHAR},</if>
|
|
<if test="itemsId != null" >#{itemsId, jdbcType=VARCHAR},</if>
|
|
<if test="rowNum != null" >#{rowNum, jdbcType=INTEGER},</if>
|
|
<if test="colNum != null" >#{colNum, jdbcType=INTEGER},</if>
|
|
<if test="content != null" >#{content, jdbcType=VARCHAR},</if>
|
|
<if test="validFlag != null" >#{validFlag, jdbcType=INTEGER},</if>
|
|
<if test="creationTime != null" >#{creationTime, jdbcType=TIMESTAMP},</if>
|
|
<if test="modifyTime != null" >#{modifyTime, jdbcType=TIMESTAMP},</if>
|
|
<if test="modifyUser != null" >#{modifyUser, jdbcType=VARCHAR},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<!-- 根据pk,修改记录-->
|
|
<update id="updateByPrimaryKey" parameterType="com.adc.da.slrs.standardSplit.entity.SarFileSplitItemsTableEO" >
|
|
update SAR_FILE_SPLIT_ITEMS_TABLE
|
|
set items_val_id = #{itemsValId},
|
|
items_id = #{itemsId},
|
|
row_num = #{rowNum},
|
|
col_num = #{colNum},
|
|
content = #{content},
|
|
valid_flag = #{validFlag},
|
|
creation_time = #{creationTime},
|
|
modify_time = #{modifyTime},
|
|
modify_user = #{modifyUser}
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<!-- 修改记录,只修改只不为空的字段 -->
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.slrs.standardSplit.entity.SarFileSplitItemsTableEO" >
|
|
update SAR_FILE_SPLIT_ITEMS_TABLE
|
|
<set >
|
|
<if test="itemsValId != null" >
|
|
items_val_id = #{itemsValId},
|
|
</if>
|
|
<if test="itemsId != null" >
|
|
items_id = #{itemsId},
|
|
</if>
|
|
<if test="rowNum != null" >
|
|
row_num = #{rowNum},
|
|
</if>
|
|
<if test="colNum != null" >
|
|
col_num = #{colNum},
|
|
</if>
|
|
<if test="content != null" >
|
|
content = #{content},
|
|
</if>
|
|
<if test="validFlag != null" >
|
|
valid_flag = #{validFlag},
|
|
</if>
|
|
<if test="creationTime != null" >
|
|
creation_time = #{creationTime},
|
|
</if>
|
|
<if test="modifyTime != null" >
|
|
modify_time = #{modifyTime},
|
|
</if>
|
|
<if test="modifyUser != null" >
|
|
modify_user = #{modifyUser},
|
|
</if>
|
|
</set>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<!-- 根据id查询 SAR_FILE_SPLIT_ITEMS_TABLE -->
|
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
|
|
select <include refid="Base_Column_List" />
|
|
from SAR_FILE_SPLIT_ITEMS_TABLE
|
|
where id = #{value}
|
|
|
|
</select>
|
|
|
|
<!-- 删除记录 -->
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
delete from SAR_FILE_SPLIT_ITEMS_TABLE
|
|
where id = #{value}
|
|
|
|
</delete>
|
|
|
|
<!-- SAR_FILE_SPLIT_ITEMS_TABLE 列表总数-->
|
|
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
|
select count(1) from SAR_FILE_SPLIT_ITEMS_TABLE
|
|
<include refid="Base_Where_Clause"/>
|
|
</select>
|
|
|
|
<!-- 查询SAR_FILE_SPLIT_ITEMS_TABLE列表 -->
|
|
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
|
select <include refid="Base_Column_List" /> from
|
|
(select tmp_tb.* from
|
|
(select <include refid="Base_Column_List" /> from SAR_FILE_SPLIT_ITEMS_TABLE
|
|
<include refid="Base_Where_Clause"/>
|
|
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
|
${pager.orderCondition}
|
|
</if>
|
|
) tmp_tb limit ${pager.startIndex-1},${pageSize}) a
|
|
</select>
|
|
|
|
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
|
select <include refid="Base_Column_List"/> from SAR_FILE_SPLIT_ITEMS_TABLE
|
|
<include refid="Base_Where_Clause"/>
|
|
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
|
${pager.orderCondition}
|
|
</if>
|
|
</select>
|
|
|
|
<insert id="insertForeach" parameterType="java.util.List">
|
|
<foreach collection="list" item="item" index="index" separator=";">
|
|
insert into SAR_FILE_SPLIT_ITEMS_TABLE(<include refid="Base_Column_List" />)
|
|
values (#{item.id, jdbcType=VARCHAR}, #{item.itemsValId, jdbcType=VARCHAR},
|
|
#{item.itemsId, jdbcType=VARCHAR}, #{item.rowNum, jdbcType=INTEGER}, #{item.colNum, jdbcType=INTEGER},
|
|
#{item.content, jdbcType=VARCHAR}, #{item.validFlag, jdbcType=INTEGER}, #{item.creationTime, jdbcType=TIMESTAMP}, #{item.modifyTime, jdbcType=TIMESTAMP}, #{item.modifyUser, jdbcType=VARCHAR})
|
|
</foreach>
|
|
</insert>
|
|
|
|
<select id="queryByRowNum" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
|
select row_num from SAR_FILE_SPLIT_ITEMS_TABLE
|
|
<include refid="Base_Where_Clause"/>
|
|
group by row_num
|
|
order by row_num
|
|
</select>
|
|
|
|
<delete id="deleteByitemValIds" parameterType="java.lang.String">
|
|
delete from SAR_FILE_SPLIT_ITEMS_TABLE
|
|
where ITEMS_VAL_ID in
|
|
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<delete id="deleteTableByMenuIds" parameterType="java.lang.String">
|
|
delete from SAR_FILE_SPLIT_ITEMS_TABLE
|
|
where EXISTS (
|
|
select 1 from SAR_FILE_SPLIT_ITEMS
|
|
where SAR_FILE_SPLIT_ITEMS_TABLE.ITEMS_ID=SAR_FILE_SPLIT_ITEMS.id
|
|
and SAR_FILE_SPLIT_ITEMS.MENU_ID in
|
|
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</delete>
|
|
|
|
<delete id="deleteByitemIds" parameterType="java.lang.String">
|
|
delete from SAR_FILE_SPLIT_ITEMS_TABLE
|
|
where ITEMS_ID in
|
|
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<!-- 通过menuid 查询目录下所有的条目 -->
|
|
<select id="queryItemsTableByMenuId" resultMap="BaseResultMap" parameterType="java.lang.String">
|
|
select <include refid="Base_Column_List"/> from SAR_FILE_SPLIT_ITEMS_TABLE
|
|
where valid_flag = '0' and ITEMS_ID in
|
|
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
</mapper>
|