218 lines
9.0 KiB
XML
218 lines
9.0 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.SarFileSplitItemsParamsEODao" >
|
|
<!-- Result Map-->
|
|
<resultMap id="BaseResultMap" type="com.adc.da.slrs.standardSplit.entity.SarFileSplitItemsParamsEO" >
|
|
<id column="id" property="id" />
|
|
<result column="item_id" property="itemId" />
|
|
<result column="description" property="description" />
|
|
<result column="figure" property="figure" />
|
|
<result column="valid_flag" property="validFlag" />
|
|
<result column="creation_time" property="creationTime" />
|
|
<result column="modify_time" property="modifyTime" />
|
|
<result column="info_id" property="infoId" />
|
|
</resultMap>
|
|
|
|
<!-- SAR_FILE_SPLIT_ITEMS_PARAMS table all fields -->
|
|
<sql id="Base_Column_List" >
|
|
id, item_id, description, figure, valid_flag, creation_time, modify_time, info_id
|
|
</sql>
|
|
|
|
<!-- 查询条件 -->
|
|
<sql id="Base_Where_Clause">
|
|
where 1=1
|
|
<trim suffixOverrides="," >
|
|
<if test="id != null" >
|
|
and id ${idOperator} #{id}
|
|
</if>
|
|
<if test="itemId != null" >
|
|
and item_id ${itemIdOperator} #{itemId}
|
|
</if>
|
|
<if test="description != null" >
|
|
and description ${descriptionOperator} #{description}
|
|
</if>
|
|
<if test="figure != null" >
|
|
and figure ${figureOperator} #{figure}
|
|
</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="infoId != null" >
|
|
and info_id ${infoIdOperator} #{infoId}
|
|
</if>
|
|
</trim>
|
|
</sql>
|
|
|
|
<!-- 插入记录 -->
|
|
<insert id="insert" parameterType="com.adc.da.slrs.standardSplit.entity.SarFileSplitItemsParamsEO" >
|
|
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
|
SELECT SEQ_SAR_FILE_SPLIT_ITEMS_PARAMS.NEXTVAL FROM DUAL
|
|
</selectKey> -->
|
|
insert into SAR_FILE_SPLIT_ITEMS_PARAMS(<include refid="Base_Column_List" />)
|
|
values (#{id, jdbcType=VARCHAR}, #{itemId, jdbcType=VARCHAR}, #{description, jdbcType=VARCHAR}, #{figure, jdbcType=VARCHAR}, #{validFlag, jdbcType=INTEGER}, #{creationTime, jdbcType=TIMESTAMP}, #{modifyTime, jdbcType=TIMESTAMP}, #{infoId, jdbcType=VARCHAR})
|
|
</insert>
|
|
|
|
<!-- 动态插入记录 主键是序列 -->
|
|
<insert id="insertSelective" parameterType="com.adc.da.slrs.standardSplit.entity.SarFileSplitItemsParamsEO" >
|
|
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
|
SELECT SEQ_SAR_FILE_SPLIT_ITEMS_PARAMS.NEXTVAL FROM DUAL
|
|
</selectKey> -->
|
|
insert into SAR_FILE_SPLIT_ITEMS_PARAMS
|
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
|
<if test="id != null" >id,</if>
|
|
<if test="itemId != null" >item_id,</if>
|
|
<if test="description != null" >description,</if>
|
|
<if test="figure != null" >figure,</if>
|
|
<if test="validFlag != null" >valid_flag,</if>
|
|
<if test="creationTime != null" >creation_time,</if>
|
|
<if test="modifyTime != null" >modify_time,</if>
|
|
<if test="infoId != null" >info_id,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
|
|
<if test="itemId != null" >#{itemId, jdbcType=VARCHAR},</if>
|
|
<if test="description != null" >#{description, jdbcType=VARCHAR},</if>
|
|
<if test="figure != null" >#{figure, 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="infoId != null" >#{infoId, jdbcType=VARCHAR},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<!-- 根据pk,修改记录-->
|
|
<update id="updateByPrimaryKey" parameterType="com.adc.da.slrs.standardSplit.entity.SarFileSplitItemsParamsEO" >
|
|
update SAR_FILE_SPLIT_ITEMS_PARAMS
|
|
set item_id = #{itemId},
|
|
description = #{description},
|
|
figure = #{figure},
|
|
valid_flag = #{validFlag},
|
|
creation_time = #{creationTime},
|
|
modify_time = #{modifyTime},
|
|
info_id = #{infoId}
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<!-- 修改记录,只修改只不为空的字段 -->
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.slrs.standardSplit.entity.SarFileSplitItemsParamsEO" >
|
|
update SAR_FILE_SPLIT_ITEMS_PARAMS
|
|
<set >
|
|
<if test="itemId != null" >
|
|
item_id = #{itemId},
|
|
</if>
|
|
<if test="description != null" >
|
|
description = #{description},
|
|
</if>
|
|
<if test="figure != null" >
|
|
figure = #{figure},
|
|
</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="infoId != null" >
|
|
info_id = #{infoId},
|
|
</if>
|
|
</set>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<!-- 根据id查询 SAR_FILE_SPLIT_ITEMS_PARAMS -->
|
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
|
|
select <include refid="Base_Column_List" />
|
|
from SAR_FILE_SPLIT_ITEMS_PARAMS
|
|
where id = #{value}
|
|
|
|
</select>
|
|
|
|
<!-- 删除记录 -->
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
delete from SAR_FILE_SPLIT_ITEMS_PARAMS
|
|
where id = #{value}
|
|
|
|
</delete>
|
|
|
|
<!-- SAR_FILE_SPLIT_ITEMS_PARAMS 列表总数-->
|
|
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
|
select count(1) from SAR_FILE_SPLIT_ITEMS_PARAMS
|
|
<include refid="Base_Where_Clause"/>
|
|
</select>
|
|
|
|
<!-- 查询SAR_FILE_SPLIT_ITEMS_PARAMS列表 -->
|
|
<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_PARAMS
|
|
<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_PARAMS
|
|
<include refid="Base_Where_Clause"/>
|
|
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
|
${pager.orderCondition}
|
|
</if>
|
|
</select>
|
|
|
|
<delete id="deleteByItemIds" parameterType="java.lang.String">
|
|
delete from SAR_FILE_SPLIT_ITEMS_PARAMS
|
|
where item_id in
|
|
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<insert id="insertForeach" parameterType="java.util.List">
|
|
insert into SAR_FILE_SPLIT_ITEMS_PARAMS(<include refid="Base_Column_List" />)
|
|
values
|
|
<foreach collection="list" item="item" index="index" separator=",">
|
|
(#{item.id, jdbcType=VARCHAR}, #{item.itemId, jdbcType=VARCHAR}, #{item.description, jdbcType=VARCHAR}, #{item.figure, jdbcType=VARCHAR}, #{item.validFlag, jdbcType=INTEGER}, #{item.creationTime, jdbcType=TIMESTAMP}, #{item.modifyTime, jdbcType=TIMESTAMP}, #{item.infoId, jdbcType=VARCHAR})
|
|
</foreach>
|
|
</insert>
|
|
|
|
<delete id="deleteByInfoIds" parameterType="java.lang.String">
|
|
delete from SAR_FILE_SPLIT_ITEMS_PARAMS
|
|
where info_id in
|
|
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<!-- 通过menuid 查询目录下所有的条目 -->
|
|
<select id="queryItemsParamsByMenuId" resultMap="BaseResultMap" parameterType="java.lang.String">
|
|
select <include refid="Base_Column_List"/> from SAR_FILE_SPLIT_ITEMS_PARAMS
|
|
where valid_flag = '0' and ITEM_ID in
|
|
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
</select>
|
|
|
|
</mapper>
|