ept_col_qualificationMapper.xml 7.9 KB
<?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.eport.rest.dao.EptColQualificationDao">
    
	<sql id="EptColQualificationEntityColumns">
		a1.ID AS "id"
		,a1.BOOK_ID AS "bookId"
		,a1.SEQ_NO AS "seqNo"
		,a1.PLAT_NO2 AS "platNo2"
		,a1.CUSTOMS AS "customs"
		,a1.COL_CODE AS "colCode"
		,a1.TRADE_CODE AS "tradeCode"
		,a1.TRADE_NAME AS "tradeName"
		,a1.BIZ_TYPE AS "bizType"
		,a1.CONTROL_FLAG AS "controlFlag"
		,a1.BEGIN_DATE AS "beginDate"
		,a1.END_DATE AS "endDate"
		,a1.COL_AREA_CODE AS "colAreaCode"
		,a1.COL_CUSTOMS_CODE AS "colCustomsCode"
		,a1.APP_PERSON AS "appPerson"
		,a1.APP_DATE AS "appDate"
		,a1.REMARK AS "remark"
		,a1.AREA_CODE AS "areaCode"
		,a1.CUSTOMS_CODE AS "customsCode"
		,a1.TRADES_CODE AS "tradesCode"
		,a1.STEP_ID AS "stepId"
		,a1.CREATE_PERSON AS "createPerson"
		,a1.DECLARE_PERSON AS "declarePerson"
		,a1.DECLARE_DATE AS "declareDate"
		,a1.APPROVE_PERSON AS "approvePerson"
		,a1.APPROVE_DATE AS "approveDate"
		,a1.OUTER_COMMENT AS "outerComment"
		,a1.INNER_COMMENT AS "innerComment"
		,a1.IS_DELETE AS "isDelete"
		,a1.CREATE_ID AS "createId"
		,a1.CREATE_DATE AS "createDate"
		,a1.UPDATE_ID AS "updateId"
		,a1.UPDATE_DATE AS "updateDate"
	</sql>
	
	<sql id="EptColQualificationEntityListColumns">
		a1.ID AS "id"
	</sql>
	
	
	
		<!--查询表中所有资料(所有字段) -->
		<select id="listAll"  
		parameterType="HashMap" 
		resultType="com.eport.rest.entity.EptColQualificationEntity"
		>
		select  
			<include refid="EptColQualificationEntityColumns"/>
			,(select BUSI_NAME from busi_type  c1 where c1.BUSI_CODE = a1.BIZ_TYPE) as busiName
			,(select CUSTOM_NA from custom_code  c1 where c1.CUSTOM_CO = a1.COL_CUSTOMS_CODE) as customName
		FROM ept_col_qualification  a1
		WHERE 1=1
		 and IS_DELETE = 0
		</select>
		
	
		<!--分页查询资料(所有字段) -->
		<select id="pageAll"  
		parameterType="HashMap" 
		resultType="com.eport.rest.entity.EptColQualificationEntity"
		>
		select  
			<include refid="EptColQualificationEntityColumns"/>
			,(select BUSI_NAME from busi_type  c1 where c1.BUSI_CODE = a1.BIZ_TYPE) as busiName
			,(select CUSTOM_NA from custom_code  c1 where c1.CUSTOM_CO = a1.COL_CUSTOMS_CODE) as customName
		FROM ept_col_qualification  a1
		WHERE 1=1
		 and IS_DELETE = 0
		</select>
		
	
		<!--查询表中所有资料(仅列表显示字段) -->
		<select id="list"  
		parameterType="HashMap" 
		resultType="com.eport.rest.entity.EptColQualificationEntity"
		>
		select  
			<include refid="EptColQualificationEntityListColumns"/>
		FROM ept_col_qualification  a1
		WHERE 1=1
		 and IS_DELETE = 0
		</select>
		
	
		<!--分页查询资料(仅列表显示字段) -->
		<select id="page"  
		parameterType="HashMap" 
		resultType="com.eport.rest.entity.EptColQualificationEntity"
		>
		select  
			<include refid="EptColQualificationEntityListColumns"/>
		FROM ept_col_qualification  a1
		WHERE 1=1
		 and IS_DELETE = 0
		</select>
		
	
		<!--根据主键查询数据 -->
		<select id="findByPK"  
		parameterType="Integer" 
		resultType="com.eport.rest.entity.EptColQualificationEntity"
		>
		select  
		<include refid="EptColQualificationEntityColumns"/>
			,(select BUSI_NAME from busi_type  c1 where c1.BUSI_CODE = a1.BIZ_TYPE) as busiName
			,(select CUSTOM_NA from custom_code  c1 where c1.CUSTOM_CO = a1.COL_CUSTOMS_CODE) as customName
		FROM ept_col_qualification  a1
		WHERE a1.ID=#{par}
		 and IS_DELETE = 0
		</select>
		
	
		<!--新增数据 -->
		<insert id="insert"  
		parameterType="com.eport.rest.entity.EptColQualificationEntity" 
		>
		<selectKey resultType="Integer" order="AFTER" keyProperty="id">
		<if test="id != null ">
		select #{id} from dual
		</if>
		<if test="id == null ">
		SELECT LAST_INSERT_ID() AS id
		</if>
		 </selectKey>
		insert  
		  INTO ept_col_qualification (
		BOOK_ID
		,SEQ_NO
		,PLAT_NO2
		,CUSTOMS
		,COL_CODE
		,TRADE_CODE
		,TRADE_NAME
		,BIZ_TYPE
		,CONTROL_FLAG
		,BEGIN_DATE
		,END_DATE
		,COL_AREA_CODE
		,COL_CUSTOMS_CODE
		,APP_PERSON
		,APP_DATE
		,REMARK
		,AREA_CODE
		,CUSTOMS_CODE
		,TRADES_CODE
		,STEP_ID
		,CREATE_PERSON
		,DECLARE_PERSON
		,DECLARE_DATE
		,APPROVE_PERSON
		,APPROVE_DATE
		,OUTER_COMMENT
		,INNER_COMMENT
		,IS_DELETE
		,CREATE_ID
		,CREATE_DATE
		,UPDATE_ID
		,UPDATE_DATE
		<if test="id != null ">
		,ID
		</if>
		  ) VALUES (
		#{bookId,jdbcType=INTEGER}
		,#{seqNo,jdbcType=VARCHAR}
		,#{platNo2,jdbcType=VARCHAR}
		,#{customs,jdbcType=VARCHAR}
		,#{colCode,jdbcType=VARCHAR}
		,#{tradeCode,jdbcType=VARCHAR}
		,#{tradeName,jdbcType=VARCHAR}
		,#{bizType,jdbcType=VARCHAR}
		,#{controlFlag,jdbcType=VARCHAR}
		,#{beginDate,jdbcType=DATE}
		,#{endDate,jdbcType=DATE}
		,#{colAreaCode,jdbcType=VARCHAR}
		,#{colCustomsCode,jdbcType=VARCHAR}
		,#{appPerson,jdbcType=VARCHAR}
		,#{appDate,jdbcType=DATE}
		,#{remark,jdbcType=VARCHAR}
		,#{areaCode,jdbcType=VARCHAR}
		,#{customsCode,jdbcType=VARCHAR}
		,#{tradesCode,jdbcType=VARCHAR}
		,#{stepId,jdbcType=VARCHAR}
		,#{createPerson,jdbcType=VARCHAR}
		,#{declarePerson,jdbcType=VARCHAR}
		,#{declareDate,jdbcType=DATE}
		,#{approvePerson,jdbcType=VARCHAR}
		,#{approveDate,jdbcType=DATE}
		,#{outerComment,jdbcType=VARCHAR}
		,#{innerComment,jdbcType=VARCHAR}
		,#{isDelete,jdbcType=INTEGER}
		,#{createId,jdbcType=INTEGER}
		,#{createDate,jdbcType=DATE}
		,#{updateId,jdbcType=INTEGER}
		,#{updateDate,jdbcType=DATE}
		<if test="id != null ">
		,#{id,jdbcType=INTEGER}
		</if>
		  )
		</insert>
		
	
		<!--更新数据 -->
		<update id="update"  
		parameterType="com.eport.rest.entity.EptColQualificationEntity" 
		>
		update  
		ept_col_qualification
		<set>
		<if test="bookId != null ">
		BOOK_ID = #{bookId},
		</if>
		<if test="seqNo != null ">
		SEQ_NO = #{seqNo},
		</if>
		<if test="platNo2 != null ">
		PLAT_NO2 = #{platNo2},
		</if>
		<if test="customs != null ">
		CUSTOMS = #{customs},
		</if>
		<if test="colCode != null ">
		COL_CODE = #{colCode},
		</if>
		<if test="tradeCode != null ">
		TRADE_CODE = #{tradeCode},
		</if>
		<if test="tradeName != null ">
		TRADE_NAME = #{tradeName},
		</if>
		<if test="bizType != null ">
		BIZ_TYPE = #{bizType},
		</if>
		<if test="controlFlag != null ">
		CONTROL_FLAG = #{controlFlag},
		</if>
		<if test="beginDate != null ">
		BEGIN_DATE = #{beginDate},
		</if>
		<if test="endDate != null ">
		END_DATE = #{endDate},
		</if>
		<if test="colAreaCode != null ">
		COL_AREA_CODE = #{colAreaCode},
		</if>
		<if test="colCustomsCode != null ">
		COL_CUSTOMS_CODE = #{colCustomsCode},
		</if>
		<if test="appPerson != null ">
		APP_PERSON = #{appPerson},
		</if>
		<if test="appDate != null ">
		APP_DATE = #{appDate},
		</if>
		<if test="remark != null ">
		REMARK = #{remark},
		</if>
		<if test="areaCode != null ">
		AREA_CODE = #{areaCode},
		</if>
		<if test="customsCode != null ">
		CUSTOMS_CODE = #{customsCode},
		</if>
		<if test="tradesCode != null ">
		TRADES_CODE = #{tradesCode},
		</if>
		<if test="stepId != null ">
		STEP_ID = #{stepId},
		</if>
		<if test="createPerson != null ">
		CREATE_PERSON = #{createPerson},
		</if>
		<if test="declarePerson != null ">
		DECLARE_PERSON = #{declarePerson},
		</if>
		<if test="declareDate != null ">
		DECLARE_DATE = #{declareDate},
		</if>
		<if test="approvePerson != null ">
		APPROVE_PERSON = #{approvePerson},
		</if>
		<if test="approveDate != null ">
		APPROVE_DATE = #{approveDate},
		</if>
		<if test="outerComment != null ">
		OUTER_COMMENT = #{outerComment},
		</if>
		<if test="innerComment != null ">
		INNER_COMMENT = #{innerComment},
		</if>
		<if test="isDelete != null ">
		IS_DELETE = #{isDelete},
		</if>
		<if test="updateId != null ">
		UPDATE_ID = #{updateId},
		</if>
		<if test="updateDate != null ">
		UPDATE_DATE = #{updateDate},
		</if>
		</set>
		WHERE ID = #{id}
		</update>
		
	
		<!--根据主键删除数据 -->
		<update id="delete"  
		parameterType="HashMap" 
		>
		update  
		ept_col_qualification set IS_DELETE = 1
		where ID in (${par})
		</update>
		
	
</mapper>