284 lines
12 KiB
XML
284 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.SarStandCompareHisEODao" >
|
|
<!-- Result Map-->
|
|
<resultMap id="BaseResultMap" type="com.adc.da.slrs.standardSplit.entity.SarStandCompareHisEO" >
|
|
<id column="id" property="id" />
|
|
<result column="compare_type" property="compareType" />
|
|
<result column="old_stand_id" property="oldStandId" />
|
|
<result column="old_stand_num" property="oldStandNum" />
|
|
<result column="old_stand_name" property="oldStandName" />
|
|
<result column="new_stand_id" property="newStandId" />
|
|
<result column="new_stand_num" property="newStandNum" />
|
|
<result column="new_stand_name" property="newStandName" />
|
|
<result column="old_file_type" property="oldFileType" />
|
|
<result column="old_sar_type" property="oldSarType" />
|
|
<result column="create_user" property="createUser" />
|
|
<result column="create_time" property="createTime" />
|
|
<result column="modify_user" property="modifyUser" />
|
|
<result column="modify_time" property="modifyTime" />
|
|
<result column="new_file_type" property="newFileType" />
|
|
<result column="new_sar_type" property="newSarType" />
|
|
<result column="compare_status" property="compareStatus"/>
|
|
</resultMap>
|
|
|
|
<!-- SAR_STAND_COMPARE_HIS table all fields -->
|
|
<sql id="Base_Column_List" >
|
|
compare_type, id, old_stand_id, old_stand_num, old_stand_name, new_stand_id, new_stand_num, new_stand_name, old_file_type, old_sar_type, create_user, create_time, modify_user, modify_time, new_file_type, new_sar_type ,compare_status
|
|
</sql>
|
|
|
|
<!-- 查询条件 -->
|
|
<sql id="Base_Where_Clause">
|
|
where 1=1
|
|
<trim suffixOverrides="," >
|
|
<if test="compareType != null" >
|
|
and compare_type ${compareTypeOperator} #{compareType}
|
|
</if>
|
|
<if test="id != null" >
|
|
and id ${idOperator} #{id}
|
|
</if>
|
|
<if test="oldStandId != null" >
|
|
and old_stand_id ${oldStandIdOperator} #{oldStandId}
|
|
</if>
|
|
<if test="oldStandNum != null" >
|
|
and old_stand_num ${oldStandNumOperator} #{oldStandNum}
|
|
</if>
|
|
<if test="oldStandName != null" >
|
|
and old_stand_name ${oldStandNameOperator} #{oldStandName}
|
|
</if>
|
|
<if test="newStandId != null" >
|
|
and new_stand_id ${newStandIdOperator} #{newStandId}
|
|
</if>
|
|
<if test="newStandNum != null" >
|
|
and new_stand_num ${newStandNumOperator} #{newStandNum}
|
|
</if>
|
|
<if test="newStandName != null" >
|
|
and new_stand_name ${newStandNameOperator} #{newStandName}
|
|
</if>
|
|
<if test="oldFileType != null" >
|
|
and old_file_type ${oldFileTypeOperator} #{oldFileType}
|
|
</if>
|
|
<if test="oldSarType != null" >
|
|
and old_sar_type ${oldSarTypeOperator} #{oldSarType}
|
|
</if>
|
|
<if test="createUser != null" >
|
|
and create_user ${createUserOperator} #{createUser}
|
|
</if>
|
|
<if test="createTime != null" >
|
|
and create_time ${createTimeOperator} #{createTime}
|
|
</if>
|
|
<if test="createTime1 != null" >
|
|
and create_time >= #{createTime1}
|
|
</if>
|
|
<if test="createTime2 != null" >
|
|
and create_time <= #{createTime2}
|
|
</if>
|
|
<if test="modifyUser != null" >
|
|
and modify_user ${modifyUserOperator} #{modifyUser}
|
|
</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="newFileType != null" >
|
|
and new_file_type ${newFileTypeOperator} #{newFileType}
|
|
</if>
|
|
<if test="newSarType != null" >
|
|
and new_sar_type ${newSarTypeOperator} #{newSarType}
|
|
</if>
|
|
<if test="compareStatus != null" >
|
|
and compare_status = #{compareStatus}
|
|
</if>
|
|
<if test="oldNumOrName != null" >
|
|
and (old_stand_num like concat('%',#{oldNumOrName},'%') OR old_stand_name like concat('%',#{oldNumOrName},'%'))
|
|
</if>
|
|
<if test="newNumOrName != null" >
|
|
and (new_stand_num like concat('%',#{newNumOrName},'%') OR new_stand_name like concat('%',#{newNumOrName},'%'))
|
|
</if>
|
|
</trim>
|
|
</sql>
|
|
|
|
<!-- 插入记录 -->
|
|
<insert id="insert" parameterType="com.adc.da.slrs.standardSplit.entity.SarStandCompareHisEO" >
|
|
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
|
SELECT SEQ_SAR_STAND_COMPARE_HIS.NEXTVAL FROM DUAL
|
|
</selectKey> -->
|
|
insert into SAR_STAND_COMPARE_HIS(<include refid="Base_Column_List" />)
|
|
values (#{compareType, jdbcType=VARCHAR}, #{id, jdbcType=VARCHAR}, #{oldStandId, jdbcType=VARCHAR}, #{oldStandNum, jdbcType=VARCHAR}, #{oldStandName, jdbcType=VARCHAR}, #{newStandId, jdbcType=VARCHAR}, #{newStandNum, jdbcType=VARCHAR}, #{newStandName, jdbcType=VARCHAR}, #{oldFileType, jdbcType=VARCHAR}, #{oldSarType, jdbcType=VARCHAR}, #{createUser, jdbcType=VARCHAR}, #{createTime, jdbcType=TIMESTAMP}, #{modifyUser, jdbcType=VARCHAR}, #{modifyTime, jdbcType=TIMESTAMP}, #{newFileType, jdbcType=VARCHAR}, #{newSarType, jdbcType=VARCHAR},#{compareStatus, jdbcType=VARCHAR})
|
|
</insert>
|
|
|
|
<!-- 动态插入记录 主键是序列 -->
|
|
<insert id="insertSelective" parameterType="com.adc.da.slrs.standardSplit.entity.SarStandCompareHisEO" >
|
|
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
|
SELECT SEQ_SAR_STAND_COMPARE_HIS.NEXTVAL FROM DUAL
|
|
</selectKey> -->
|
|
insert into SAR_STAND_COMPARE_HIS
|
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
|
<if test="compareType != null" >compare_type,</if>
|
|
<if test="id != null" >id,</if>
|
|
<if test="oldStandId != null" >old_stand_id,</if>
|
|
<if test="oldStandNum != null" >old_stand_num,</if>
|
|
<if test="oldStandName != null" >old_stand_name,</if>
|
|
<if test="newStandId != null" >new_stand_id,</if>
|
|
<if test="newStandNum != null" >new_stand_num,</if>
|
|
<if test="newStandName != null" >new_stand_name,</if>
|
|
<if test="oldFileType != null" >old_file_type,</if>
|
|
<if test="oldSarType != null" >old_sar_type,</if>
|
|
<if test="createUser != null" >create_user,</if>
|
|
<if test="createTime != null" >create_time,</if>
|
|
<if test="modifyUser != null" >modify_user,</if>
|
|
<if test="modifyTime != null" >modify_time,</if>
|
|
<if test="newFileType != null" >new_file_type,</if>
|
|
<if test="newSarType != null" >new_sar_type,</if>
|
|
<if test="compareStatus != null" >compare_status,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
<if test="compareType != null" >#{compareType, jdbcType=VARCHAR},</if>
|
|
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
|
|
<if test="oldStandId != null" >#{oldStandId, jdbcType=VARCHAR},</if>
|
|
<if test="oldStandNum != null" >#{oldStandNum, jdbcType=VARCHAR},</if>
|
|
<if test="oldStandName != null" >#{oldStandName, jdbcType=VARCHAR},</if>
|
|
<if test="newStandId != null" >#{newStandId, jdbcType=VARCHAR},</if>
|
|
<if test="newStandNum != null" >#{newStandNum, jdbcType=VARCHAR},</if>
|
|
<if test="newStandName != null" >#{newStandName, jdbcType=VARCHAR},</if>
|
|
<if test="oldFileType != null" >#{oldFileType, jdbcType=VARCHAR},</if>
|
|
<if test="oldSarType != null" >#{oldSarType, jdbcType=VARCHAR},</if>
|
|
<if test="createUser != null" >#{createUser, jdbcType=VARCHAR},</if>
|
|
<if test="createTime != null" >#{createTime, jdbcType=TIMESTAMP},</if>
|
|
<if test="modifyUser != null" >#{modifyUser, jdbcType=VARCHAR},</if>
|
|
<if test="modifyTime != null" >#{modifyTime, jdbcType=TIMESTAMP},</if>
|
|
<if test="newFileType != null" >#{newFileType, jdbcType=VARCHAR},</if>
|
|
<if test="newSarType != null" >#{newSarType, jdbcType=VARCHAR},</if>
|
|
<if test="compareStatus != null" >#{compareStatus, jdbcType=VARCHAR},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<!-- 根据pk,修改记录-->
|
|
<update id="updateByPrimaryKey" parameterType="com.adc.da.slrs.standardSplit.entity.SarStandCompareHisEO" >
|
|
update SAR_STAND_COMPARE_HIS
|
|
set compare_type = #{compareType},
|
|
old_stand_id = #{oldStandId},
|
|
old_stand_num = #{oldStandNum},
|
|
old_stand_name = #{oldStandName},
|
|
new_stand_id = #{newStandId},
|
|
new_stand_num = #{newStandNum},
|
|
new_stand_name = #{newStandName},
|
|
old_file_type = #{oldFileType},
|
|
old_sar_type = #{oldSarType},
|
|
create_user = #{createUser},
|
|
create_time = #{createTime},
|
|
modify_user = #{modifyUser},
|
|
modify_time = #{modifyTime},
|
|
new_file_type = #{newFileType},
|
|
new_sar_type = #{newSarType},
|
|
compare_status = #{compareStatus}
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<!-- 修改记录,只修改只不为空的字段 -->
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.slrs.standardSplit.entity.SarStandCompareHisEO" >
|
|
update SAR_STAND_COMPARE_HIS
|
|
<set >
|
|
<if test="compareType != null" >
|
|
compare_type = #{compareType},
|
|
</if>
|
|
<if test="oldStandId != null" >
|
|
old_stand_id = #{oldStandId},
|
|
</if>
|
|
<if test="oldStandNum != null" >
|
|
old_stand_num = #{oldStandNum},
|
|
</if>
|
|
<if test="oldStandName != null" >
|
|
old_stand_name = #{oldStandName},
|
|
</if>
|
|
<if test="newStandId != null" >
|
|
new_stand_id = #{newStandId},
|
|
</if>
|
|
<if test="newStandNum != null" >
|
|
new_stand_num = #{newStandNum},
|
|
</if>
|
|
<if test="newStandName != null" >
|
|
new_stand_name = #{newStandName},
|
|
</if>
|
|
<if test="oldFileType != null" >
|
|
old_file_type = #{oldFileType},
|
|
</if>
|
|
<if test="oldSarType != null" >
|
|
old_sar_type = #{oldSarType},
|
|
</if>
|
|
<if test="createUser != null" >
|
|
create_user = #{createUser},
|
|
</if>
|
|
<if test="createTime != null" >
|
|
create_time = #{createTime},
|
|
</if>
|
|
<if test="modifyUser != null" >
|
|
modify_user = #{modifyUser},
|
|
</if>
|
|
<if test="modifyTime != null" >
|
|
modify_time = #{modifyTime},
|
|
</if>
|
|
<if test="newFileType != null" >
|
|
new_file_type = #{newFileType},
|
|
</if>
|
|
<if test="newSarType != null" >
|
|
new_sar_type = #{newSarType},
|
|
</if>
|
|
<if test="compareStatus != null" >
|
|
compare_status = #{compareStatus},
|
|
</if>
|
|
</set>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<!-- 根据id查询 SAR_STAND_COMPARE_HIS -->
|
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
|
|
select <include refid="Base_Column_List" />
|
|
from SAR_STAND_COMPARE_HIS
|
|
where id = #{value}
|
|
|
|
</select>
|
|
|
|
<!-- 删除记录 -->
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
delete from SAR_STAND_COMPARE_HIS
|
|
where id = #{value}
|
|
|
|
</delete>
|
|
|
|
<!-- SAR_STAND_COMPARE_HIS 列表总数-->
|
|
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
|
select count(1) from SAR_STAND_COMPARE_HIS
|
|
<include refid="Base_Where_Clause"/>
|
|
</select>
|
|
|
|
<!-- 查询SAR_STAND_COMPARE_HIS列表 -->
|
|
<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_STAND_COMPARE_HIS
|
|
<include refid="Base_Where_Clause"/>
|
|
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
|
${pager.orderCondition}
|
|
</if>
|
|
<if test="sql != null">
|
|
${sql}
|
|
</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_STAND_COMPARE_HIS
|
|
<include refid="Base_Where_Clause"/>
|
|
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
|
${pager.orderCondition}
|
|
</if>
|
|
</select>
|
|
|
|
</mapper>
|