Files
foton-slrs-system-rest/adc-da-slrs/src/main/resources/mybatis/mapper/standardSplit/SarFileSplitItemsValEOMapper.xml
T

296 lines
12 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.SarFileSplitItemsValEODao" >
<!-- Result Map-->
<resultMap id="BaseResultMap" type="com.adc.da.slrs.standardSplit.entity.SarFileSplitItemsValEO" >
<id column="id" property="id" />
<result column="type" property="type" />
<result column="item_id" property="itemId" />
<result column="item_content" property="itemContent" />
<result column="valid_flag" property="validFlag" />
<result column="creation_user" property="creationUser" />
<result column="creation_time" property="creationTime" />
<result column="modify_time" property="modifyTime" />
<result column="modify_user" property="modifyUser" />
<result column="display_seq" property="displaySeq" />
<result column="img_name" property="imgName" />
</resultMap>
<!-- SAR_FILE_SPLIT_ITEMS_VAL table all fields -->
<sql id="Base_Column_List" >
id, type, item_id, item_content, valid_flag, creation_user, creation_time, modify_time, modify_user, display_seq,img_name
</sql>
<!-- 查询条件 -->
<sql id="Base_Where_Clause">
where 1=1
<trim suffixOverrides="," >
<if test="id != null" >
and id ${idOperator} #{id}
</if>
<if test="type != null" >
and type ${typeOperator} #{type}
</if>
<if test="itemId != null" >
and item_id ${itemIdOperator} #{itemId}
</if>
<if test="itemContent != null" >
and item_content ${itemContentOperator} #{itemContent}
</if>
<if test="validFlag != null" >
and valid_flag ${validFlagOperator} #{validFlag}
</if>
<if test="creationUser != null" >
and creation_user ${creationUserOperator} #{creationUser}
</if>
<if test="creationTime != null" >
and creation_time ${creationTimeOperator} #{creationTime}
</if>
<if test="creationTime1 != null" >
and creation_time &gt;= #{creationTime1}
</if>
<if test="creationTime2 != null" >
and creation_time &lt;= #{creationTime2}
</if>
<if test="modifyTime != null" >
and modify_time ${modifyTimeOperator} #{modifyTime}
</if>
<if test="modifyTime1 != null" >
and modify_time &gt;= #{modifyTime1}
</if>
<if test="modifyTime2 != null" >
and modify_time &lt;= #{modifyTime2}
</if>
<if test="modifyUser != null" >
and modify_user ${modifyUserOperator} #{modifyUser}
</if>
<if test="displaySeq != null" >
and display_seq ${displaySeqOperator} #{displaySeq}
</if>
</trim>
</sql>
<!-- 插入记录 -->
<insert id="insert" parameterType="com.adc.da.slrs.standardSplit.entity.SarFileSplitItemsValEO" >
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
SELECT SEQ_SAR_FILE_SPLIT_ITEMS_VAL.NEXTVAL FROM DUAL
</selectKey> -->
insert into SAR_FILE_SPLIT_ITEMS_VAL(<include refid="Base_Column_List" />)
values (#{id, jdbcType=VARCHAR}, #{type, jdbcType=VARCHAR}, #{itemId, jdbcType=VARCHAR}, #{itemContent, jdbcType=CLOB}, #{validFlag, jdbcType=INTEGER}, #{creationUser, jdbcType=VARCHAR}, #{creationTime, jdbcType=TIMESTAMP}, #{modifyTime, jdbcType=TIMESTAMP}, #{modifyUser, jdbcType=VARCHAR}, #{displaySeq, jdbcType=INTEGER})
</insert>
<!-- 动态插入记录 主键是序列 -->
<insert id="insertSelective" parameterType="com.adc.da.slrs.standardSplit.entity.SarFileSplitItemsValEO" >
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
SELECT SEQ_SAR_FILE_SPLIT_ITEMS_VAL.NEXTVAL FROM DUAL
</selectKey> -->
insert into SAR_FILE_SPLIT_ITEMS_VAL
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >id,</if>
<if test="type != null" >type,</if>
<if test="itemId != null" >item_id,</if>
<if test="itemContent != null" >item_content,</if>
<if test="validFlag != null" >valid_flag,</if>
<if test="creationUser != null" >creation_user,</if>
<if test="creationTime != null" >creation_time,</if>
<if test="modifyTime != null" >modify_time,</if>
<if test="modifyUser != null" >modify_user,</if>
<if test="displaySeq != null" >display_seq,</if>
<if test="imgName != null" >img_name,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
<if test="type != null" >#{type, jdbcType=VARCHAR},</if>
<if test="itemId != null" >#{itemId, jdbcType=VARCHAR},</if>
<if test="itemContent != null" >#{itemContent, jdbcType=CLOB},</if>
<if test="validFlag != null" >#{validFlag, jdbcType=INTEGER},</if>
<if test="creationUser != null" >#{creationUser, jdbcType=VARCHAR},</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>
<if test="displaySeq != null" >#{displaySeq, jdbcType=INTEGER},</if>
<if test="imgName != null" >#{imgName, jdbcType=INTEGER},</if>
</trim>
</insert>
<!-- 根据pk,修改记录-->
<update id="updateByPrimaryKey" parameterType="com.adc.da.slrs.standardSplit.entity.SarFileSplitItemsValEO" >
update SAR_FILE_SPLIT_ITEMS_VAL
set type = #{type},
item_id = #{itemId},
item_content = #{itemContent},
valid_flag = #{validFlag},
creation_user = #{creationUser},
creation_time = #{creationTime},
modify_time = #{modifyTime},
modify_user = #{modifyUser},
display_seq = #{displaySeq}
where id = #{id}
</update>
<!-- 修改记录,只修改只不为空的字段 -->
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.slrs.standardSplit.entity.SarFileSplitItemsValEO" >
update SAR_FILE_SPLIT_ITEMS_VAL
<set >
<if test="type != null" >
type = #{type},
</if>
<if test="itemId != null" >
item_id = #{itemId},
</if>
<if test="itemContent != null" >
item_content = #{itemContent},
</if>
<if test="validFlag != null" >
valid_flag = #{validFlag},
</if>
<if test="creationUser != null" >
creation_user = #{creationUser},
</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>
<if test="displaySeq != null" >
display_seq = #{displaySeq},
</if>
</set>
where id = #{id}
</update>
<!-- 根据id查询 SAR_FILE_SPLIT_ITEMS_VAL -->
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select <include refid="Base_Column_List" />
from SAR_FILE_SPLIT_ITEMS_VAL
where id = #{value}
</select>
<!-- 删除记录 -->
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from SAR_FILE_SPLIT_ITEMS_VAL
where id = #{value}
</delete>
<!-- SAR_FILE_SPLIT_ITEMS_VAL 列表总数-->
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
select count(1) from SAR_FILE_SPLIT_ITEMS_VAL
<include refid="Base_Where_Clause"/>
</select>
<!-- 查询SAR_FILE_SPLIT_ITEMS_VAL列表 -->
<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_VAL
<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_VAL
<include refid="Base_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
</select>
<delete id="deleteByIds" parameterType="com.adc.da.slrs.standardSplit.entity.SarFileSplitItemsValEO">
delete from SAR_FILE_SPLIT_ITEMS_VAL
where id in
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<delete id="deleteByitemId" parameterType="java.lang.String">
delete from SAR_FILE_SPLIT_ITEMS_VAL
where item_id = #{value}
</delete>
<!-- 批量插入接口 -->
<insert id="insertForeach" parameterType="java.util.List">
insert into SAR_FILE_SPLIT_ITEMS_VAL
(id, type, item_id, valid_flag, creation_user, creation_time, modify_time, modify_user, display_seq, img_name, item_content)
values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.id, jdbcType=VARCHAR}, #{item.type, jdbcType=VARCHAR},
#{item.itemId, jdbcType=VARCHAR},
#{item.validFlag, jdbcType=INTEGER}, #{item.creationUser, jdbcType=VARCHAR},
#{item.creationTime, jdbcType=TIMESTAMP}, #{item.modifyTime, jdbcType=TIMESTAMP},
#{item.modifyUser, jdbcType=VARCHAR}, #{item.displaySeq, jdbcType=INTEGER},
#{item.imgName, jdbcType=INTEGER},
#{item.itemContent, jdbcType=CLOB})
</foreach>
</insert>
<delete id="deleteValByInfoIds" parameterType="java.lang.String">
delete from SAR_FILE_SPLIT_ITEMS_VAL
where EXISTS (
select 1 from SAR_FILE_SPLIT_ITEMS
where SAR_FILE_SPLIT_ITEMS_VAL.ITEM_ID=SAR_FILE_SPLIT_ITEMS.id
and SAR_FILE_SPLIT_ITEMS.INFO_ID in
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
)
</delete>
<delete id="deleteValByitemIds" parameterType="java.lang.String">
delete from SAR_FILE_SPLIT_ITEMS_VAL
where ITEM_ID in
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<update id="updateForeach" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" separator=";">
update SAR_FILE_SPLIT_ITEMS_VAL
<set >
item_content = #{item.itemContent, jdbcType=VARCHAR},
modify_time = #{item.modifyTime, jdbcType=TIMESTAMP},
modify_user = #{item.modifyUser, jdbcType=VARCHAR},
display_seq = #{item.displaySeq, jdbcType=INTEGER},
</set>
where id = #{item.id, jdbcType=VARCHAR}
</foreach>
;
</update>
<delete id="deleteValByMenuIds" parameterType="java.lang.String">
delete from SAR_FILE_SPLIT_ITEMS_VAL
where EXISTS (
select 1 from SAR_FILE_SPLIT_ITEMS
where SAR_FILE_SPLIT_ITEMS_VAL.ITEM_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>
<!-- 通过menuid 查询目录下所有的条目 -->
<select id="queryItemsValByMenuId" resultMap="BaseResultMap" parameterType="java.lang.String">
select <include refid="Base_Column_List"/> from SAR_FILE_SPLIT_ITEMS_VAL
where valid_flag = '0' and ITEM_ID in
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>