331 lines
14 KiB
XML
331 lines
14 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.SarFileSplitInfoEODao" >
|
|
<!-- Result Map-->
|
|
<resultMap id="BaseResultMap" type="com.adc.da.slrs.standardSplit.entity.SarFileSplitInfoEO" >
|
|
<id column="id" property="id" />
|
|
<result column="sar_type" property="sarType" />
|
|
<result column="file_name" property="fileName" />
|
|
<result column="stand_id" property="standId" />
|
|
<result column="file_type" property="fileType" />
|
|
<result column="att_id" property="attId" />
|
|
<result column="valid_flag" property="validFlag" />
|
|
<result column="creation_time" property="creationTime" />
|
|
<result column="creation_user" property="creationUser" />
|
|
<result column="modify_time" property="modifyTime" />
|
|
<result column="modify_user" property="modifyUser" />
|
|
<result column="stand_num_split" property="standNumSplit" />
|
|
<result column="stand_name_split" property="standNameSplit" />
|
|
<result column="result" property="result" />
|
|
<result column="split_status" property="splitStatus" />
|
|
</resultMap>
|
|
|
|
<!-- SAR_FILE_SPLIT_INFO table all fields -->
|
|
<sql id="Base_Column_List" >
|
|
sar_type, file_name, id, stand_id, file_type, att_id, valid_flag, creation_time,
|
|
creation_user, modify_time, modify_user,stand_num_split,stand_name_split,result
|
|
</sql>
|
|
|
|
<!-- 查询条件 -->
|
|
<sql id="Base_Where_Clause">
|
|
where 1=1
|
|
<trim suffixOverrides="," >
|
|
<if test="sarType != null" >
|
|
and sar_type ${sarTypeOperator} #{sarType}
|
|
</if>
|
|
<if test="fileName != null" >
|
|
and file_name ${fileNameOperator} #{fileName}
|
|
</if>
|
|
<if test="id != null" >
|
|
and id ${idOperator} #{id}
|
|
</if>
|
|
<if test="standId != null" >
|
|
and stand_id ${standIdOperator} #{standId}
|
|
</if>
|
|
<if test="fileType != null" >
|
|
and file_type ${fileTypeOperator} #{fileType}
|
|
</if>
|
|
<if test="attId != null" >
|
|
and att_id ${attIdOperator} #{attId}
|
|
</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="creationUser != null" >
|
|
and creation_user ${creationUserOperator} #{creationUser}
|
|
</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.SarFileSplitInfoEO" >
|
|
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
|
SELECT SEQ_SAR_FILE_SPLIT_INFO.NEXTVAL FROM DUAL
|
|
</selectKey> -->
|
|
insert into SAR_FILE_SPLIT_INFO(<include refid="Base_Column_List" />)
|
|
values (#{sarType, jdbcType=VARCHAR}, #{fileName, jdbcType=VARCHAR}, #{id, jdbcType=VARCHAR}, #{standId, jdbcType=VARCHAR}, #{fileType, jdbcType=VARCHAR}, #{attId, jdbcType=VARCHAR}, #{validFlag, jdbcType=INTEGER}, #{creationTime, jdbcType=TIMESTAMP}, #{creationUser, jdbcType=VARCHAR}, #{modifyTime, jdbcType=TIMESTAMP}, #{modifyUser, jdbcType=VARCHAR})
|
|
</insert>
|
|
|
|
<!-- 动态插入记录 主键是序列 -->
|
|
<insert id="insertSelective" parameterType="com.adc.da.slrs.standardSplit.entity.SarFileSplitInfoEO" >
|
|
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
|
SELECT SEQ_SAR_FILE_SPLIT_INFO.NEXTVAL FROM DUAL
|
|
</selectKey> -->
|
|
insert into SAR_FILE_SPLIT_INFO
|
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
|
<if test="sarType != null" >sar_type,</if>
|
|
<if test="fileName != null" >file_name,</if>
|
|
<if test="id != null" >id,</if>
|
|
<if test="standId != null" >stand_id,</if>
|
|
<if test="fileType != null" >file_type,</if>
|
|
<if test="attId != null" >att_id,</if>
|
|
<if test="validFlag != null" >valid_flag,</if>
|
|
<if test="creationTime != null" >creation_time,</if>
|
|
<if test="creationUser != null" >creation_user,</if>
|
|
<if test="modifyTime != null" >modify_time,</if>
|
|
<if test="modifyUser != null" >modify_user,</if>
|
|
<if test="standNumSplit != null" >stand_num_split,</if>
|
|
<if test="standNameSplit != null" >stand_name_split,</if>
|
|
<if test="result != null" >result,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
<if test="sarType != null" >#{sarType, jdbcType=VARCHAR},</if>
|
|
<if test="fileName != null" >#{fileName, jdbcType=VARCHAR},</if>
|
|
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
|
|
<if test="standId != null" >#{standId, jdbcType=VARCHAR},</if>
|
|
<if test="fileType != null" >#{fileType, jdbcType=VARCHAR},</if>
|
|
<if test="attId != null" >#{attId, jdbcType=VARCHAR},</if>
|
|
<if test="validFlag != null" >#{validFlag, jdbcType=INTEGER},</if>
|
|
<if test="creationTime != null" >#{creationTime, jdbcType=TIMESTAMP},</if>
|
|
<if test="creationUser != null" >#{creationUser, jdbcType=VARCHAR},</if>
|
|
<if test="modifyTime != null" >#{modifyTime, jdbcType=TIMESTAMP},</if>
|
|
<if test="modifyUser != null" >#{modifyUser, jdbcType=VARCHAR},</if>
|
|
<if test="standNumSplit != null" >#{standNumSplit, jdbcType=VARCHAR},</if>
|
|
<if test="standNameSplit != null" >#{standNameSplit, jdbcType=VARCHAR},</if>
|
|
<if test="result != null" >#{result, jdbcType=VARCHAR},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<!-- 根据pk,修改记录-->
|
|
<update id="updateByPrimaryKey" parameterType="com.adc.da.slrs.standardSplit.entity.SarFileSplitInfoEO" >
|
|
update SAR_FILE_SPLIT_INFO
|
|
set sar_type = #{sarType},
|
|
file_name = #{fileName},
|
|
stand_id = #{standId},
|
|
file_type = #{fileType},
|
|
att_id = #{attId},
|
|
valid_flag = #{validFlag},
|
|
creation_time = #{creationTime},
|
|
creation_user = #{creationUser},
|
|
modify_time = #{modifyTime},
|
|
modify_user = #{modifyUser}
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<!-- 修改记录,只修改只不为空的字段 -->
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.slrs.standardSplit.entity.SarFileSplitInfoEO" >
|
|
update SAR_FILE_SPLIT_INFO
|
|
<set >
|
|
<if test="sarType != null" >
|
|
sar_type = #{sarType},
|
|
</if>
|
|
<if test="fileName != null" >
|
|
file_name = #{fileName},
|
|
</if>
|
|
<if test="standId != null" >
|
|
stand_id = #{standId},
|
|
</if>
|
|
<if test="fileType != null" >
|
|
file_type = #{fileType},
|
|
</if>
|
|
<if test="attId != null" >
|
|
att_id = #{attId},
|
|
</if>
|
|
<if test="validFlag != null" >
|
|
valid_flag = #{validFlag},
|
|
</if>
|
|
<if test="creationTime != null" >
|
|
creation_time = #{creationTime},
|
|
</if>
|
|
<if test="creationUser != null" >
|
|
creation_user = #{creationUser},
|
|
</if>
|
|
<if test="modifyTime != null" >
|
|
modify_time = #{modifyTime},
|
|
</if>
|
|
<if test="modifyUser != null" >
|
|
modify_user = #{modifyUser},
|
|
</if>
|
|
<if test="result != null" >
|
|
result = #{result},
|
|
</if>
|
|
<if test="standNumSplit != null" >
|
|
stand_num_split = #{standNumSplit},
|
|
</if>
|
|
<if test="standNameSplit != null" >
|
|
stand_name_split = #{standNameSplit},
|
|
</if>
|
|
<if test="splitStatus != null" >
|
|
split_status = #{splitStatus}
|
|
</if>
|
|
</set>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<!-- 根据id查询 SAR_FILE_SPLIT_INFO -->
|
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
|
|
select <include refid="Base_Column_List" />
|
|
from SAR_FILE_SPLIT_INFO
|
|
where id = #{value}
|
|
|
|
</select>
|
|
|
|
<!-- 删除记录 -->
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
delete from SAR_FILE_SPLIT_INFO
|
|
where id = #{value}
|
|
|
|
</delete>
|
|
|
|
<!-- SAR_FILE_SPLIT_INFO 列表总数-->
|
|
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
|
select count(1) from SAR_FILE_SPLIT_INFO
|
|
<include refid="Base_Where_Clause"/>
|
|
</select>
|
|
|
|
<!-- 查询SAR_FILE_SPLIT_INFO列表 -->
|
|
<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_INFO
|
|
<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_INFO
|
|
<include refid="Base_Where_Clause"/>
|
|
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
|
${pager.orderCondition}
|
|
</if>
|
|
</select>
|
|
|
|
<select id="queryByPageOwn" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.standardSplit.entity.SarFileSplitInfoEOPage">
|
|
select * from
|
|
(select tmp_tb.* from
|
|
(SELECT
|
|
SAR_FILE_SPLIT_INFO.*,
|
|
if(
|
|
SAR_STANDARDS_INFO.STAND_YEAR='',
|
|
CONCAT(SAR_STANDARDS_INFO.stand_sort,' ',SAR_STANDARDS_INFO.stand_number),
|
|
CONCAT(SAR_STANDARDS_INFO.stand_sort,' ',SAR_STANDARDS_INFO.stand_number,'-',SAR_STANDARDS_INFO.stand_year)
|
|
) AS showNumber,
|
|
SAR_STANDARDS_INFO.stand_name as standName
|
|
FROM
|
|
SAR_FILE_SPLIT_INFO
|
|
LEFT JOIN SAR_STANDARDS_INFO ON SAR_FILE_SPLIT_INFO.STAND_ID = SAR_STANDARDS_INFO.id
|
|
where SAR_FILE_SPLIT_INFO.valid_flag =0
|
|
<if test="numOrName != null and numOrName != ''" >
|
|
and (
|
|
if(
|
|
SAR_STANDARDS_INFO.STAND_YEAR='',
|
|
CONCAT(SAR_STANDARDS_INFO.stand_sort,' ',SAR_STANDARDS_INFO.stand_number),
|
|
CONCAT(SAR_STANDARDS_INFO.stand_sort,' ',SAR_STANDARDS_INFO.stand_number,'-',SAR_STANDARDS_INFO.stand_year)
|
|
) like concat(concat('%',#{numOrName}),'%') or SAR_STANDARDS_INFO.stand_name like concat(concat('%',#{numOrName}),'%')
|
|
or SAR_FILE_SPLIT_INFO.stand_num_split like concat(concat('%',#{numOrName}),'%')
|
|
or SAR_FILE_SPLIT_INFO.stand_name_split like concat(concat('%',#{numOrName}),'%')
|
|
)
|
|
</if>
|
|
<if test="standId != null and standId != ''">
|
|
and SAR_FILE_SPLIT_INFO.stand_id = #{standId}
|
|
</if>
|
|
<if test="id != null and id != ''">
|
|
and SAR_FILE_SPLIT_INFO.id = #{id}
|
|
</if>
|
|
<if test="fileType != null and fileType != ''">
|
|
and SAR_FILE_SPLIT_INFO.file_type = #{fileType}
|
|
</if>
|
|
<if test="splitStatus != null and splitStatus != ''">
|
|
and SAR_FILE_SPLIT_INFO.split_status = #{splitStatus}
|
|
</if>
|
|
<if test="result != null ">
|
|
and SAR_FILE_SPLIT_INFO.result = #{result}
|
|
</if>
|
|
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
|
${pager.orderCondition}
|
|
</if>
|
|
) tmp_tb limit ${pager.startIndex-1},${pageSize}) a
|
|
</select>
|
|
|
|
<select id="queryByCountOwn" resultType="java.lang.Integer" parameterType="com.adc.da.slrs.standardSplit.entity.SarFileSplitInfoEOPage">
|
|
SELECT
|
|
count(0)
|
|
FROM
|
|
SAR_FILE_SPLIT_INFO
|
|
LEFT JOIN SAR_STANDARDS_INFO ON SAR_FILE_SPLIT_INFO.STAND_ID = SAR_STANDARDS_INFO.id
|
|
where SAR_FILE_SPLIT_INFO.valid_flag =0
|
|
<if test="numOrName != null and numOrName != ''" >
|
|
and (
|
|
if(
|
|
SAR_STANDARDS_INFO.STAND_YEAR='',
|
|
CONCAT(SAR_STANDARDS_INFO.stand_sort,' ',SAR_STANDARDS_INFO.stand_number),
|
|
CONCAT(SAR_STANDARDS_INFO.stand_sort,' ',SAR_STANDARDS_INFO.stand_number,'-',SAR_STANDARDS_INFO.stand_year)
|
|
) like concat(concat('%',#{numOrName}),'%') or SAR_STANDARDS_INFO.stand_name like concat(concat('%',#{numOrName}),'%')
|
|
or SAR_FILE_SPLIT_INFO.stand_num_split like concat(concat('%',#{numOrName}),'%')
|
|
or SAR_FILE_SPLIT_INFO.stand_name_split like concat(concat('%',#{numOrName}),'%')
|
|
)
|
|
</if>
|
|
<if test="standId != null and standId != ''">
|
|
and SAR_FILE_SPLIT_INFO.stand_id = #{standId}
|
|
</if>
|
|
<if test="id != null and id != ''">
|
|
and SAR_FILE_SPLIT_INFO.id = #{id}
|
|
</if>
|
|
<if test="fileType != null and fileType != ''">
|
|
and SAR_FILE_SPLIT_INFO.file_type = #{fileType}
|
|
</if>
|
|
<if test="splitStatus != null and splitStatus != ''">
|
|
and SAR_FILE_SPLIT_INFO.split_status = #{splitStatus}
|
|
</if>
|
|
<if test="result != null ">
|
|
and SAR_FILE_SPLIT_INFO.result = #{result}
|
|
</if>
|
|
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
|
${pager.orderCondition}
|
|
</if>
|
|
</select>
|
|
|
|
<delete id="deleteByIds" parameterType="com.adc.da.slrs.standardSplit.entity.SarFileSplitInfoEO">
|
|
delete from SAR_FILE_SPLIT_INFO
|
|
where id in
|
|
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
|
|
#{item}
|
|
</foreach>
|
|
</delete>
|
|
|
|
</mapper>
|