LandRoadVeRecordDao.xml 8.2 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.thinkgem.jeesite.modules.land.dao.LandRoadVeRecordDao">
    
	<sql id="landRoadVeRecordColumns">
		a.eport_id AS "eportId",
		a.main_port AS "mainPort",
		a.co_code AS "coCode",
		a.ve_target_no AS "veTargetNo",
		a.domestic_lisence_no AS "domesticLisenceNo",
		a.domestic_license_color AS "domesticLicenseColor",
		a.foreign_license AS "foreignLicense",
		a.ve_reg_place AS "veRegPlace",
		a.ve_property AS "veProperty",
		a.ve_convey_qua AS "veConveyQua",
		a.ve_card_no AS "veCardNo",
		a.ve_owner_name AS "veOwnerName",
		a.ve_owner_no AS "veOwnerNo",
		a.owner_inside_addr AS "ownerInsideAddr",
		a.owner_inside_tel AS "ownerInsideTel",
		a.ve_type AS "veType",
		a.brand AS "brand",
		a.model AS "model",
		a.exhaust_capacity AS "exhaustCapacity",
		a.ve_factory_date AS "veFactoryDate",
		a.ve_motor_no AS "veMotorNo",
		a.ve_frame_no AS "veFrameNo",
		a.ve_ton AS "veTon",
		a.self_wt AS "selfWt",
		a.allow_tow_total_wt AS "allowTowTotalWt",
		a.container_inner_length AS "containerInnerLength",
		a.container_inner_width AS "containerInnerWidth",
		a.container_inner_height AS "containerInnerHeight",
		a.outer_length AS "outerLength",
		a.outer_width AS "outerWidth",
		a.outer_height AS "outerHeight",
		a.ve_body_color AS "veBodyColor",
		a.oil_box_capcity AS "oilBoxCapcity",
		a.allow_ve_ie_port AS "allowVeIePort",
		a.appr_no AS "apprNo",
		a.appr_period AS "apprPeriod",
		a.curr_apply_bussiness AS "currApplyBussiness",
		a.front_45c_pic AS "front45cPic",
		a.back_45c_pic AS "back45cPic",
		a.oil_box_pic AS "oilBoxPic",
		a.ve_bottom_pic AS "veBottomPic",
		a.memo AS "memo",
		a.proposer AS "proposer",
		a.propose_time AS "proposeTime",
		a.ve_class_flag AS "veClassFlag",
		a.operation_type AS "operationType",
		a.trailer_license_no AS "trailerLicenseNo",
		a.trailer_frame_no AS "trailerFrameNo",
		a.appro_no_pic AS "approNoPic",
		a.ve_frame_no_pic AS "veFrameNoPic",
		a.motor_no_pic AS "motorNoPic",
		a.foreign_license_pic AS "foreignLicensePic",
		a.nationality AS "nationality",
		a.returnmessage AS "returnmessage",
		a.barcode AS "barcode",
		a.id AS "id",
		a.create_by AS "createBy.id",
		a.create_date AS "createDate",
		a.update_by AS "updateBy.id",
		a.update_date AS "updateDate"
	</sql>
	
	<sql id="landRoadVeRecordJoins">
	</sql>
    
	<select id="get" resultType="LandRoadVeRecord">
		SELECT 
			<include refid="landRoadVeRecordColumns"/>
		FROM land_road_ve_record a
		<include refid="landRoadVeRecordJoins"/>
		WHERE a.id = #{id}
	</select>
	
	<select id="findList" resultType="LandRoadVeRecord">
		SELECT 
			<include refid="landRoadVeRecordColumns"/>
		FROM land_road_ve_record a
		<include refid="landRoadVeRecordJoins"/>
		<trim prefix="WHERE" prefixOverrides="and">
			<if test='domesticLisenceNo !=null and domesticLisenceNo !=""'>
				and domestic_lisence_no = #{domesticLisenceNo}
			</if>
			<if test='createBy.id !="1"and createBy.id !=null and createBy.id !=""'>
				and create_by = #{createBy.id}
			</if>
		</trim>
		<choose>
			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
				ORDER BY ${page.orderBy}
			</when>
			<otherwise>
				ORDER BY a.update_date DESC
			</otherwise>
		</choose>
	</select>
	<select id="selectByFrameNo" parameterType="java.lang.String" resultType="LandRoadVeRecord">
		SELECT * FROM land_road_ve_record WHERE domestic_lisence_no = #{domesticLisenceNo}
	</select>
	
	<select id="findAllList" resultType="LandRoadVeRecord">
		SELECT 
			<include refid="landRoadVeRecordColumns"/>
		FROM land_road_ve_record a
		<include refid="landRoadVeRecordJoins"/>
		<where>
			
		</where>		
		<choose>
			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
				ORDER BY ${page.orderBy}
			</when>
			<otherwise>
				ORDER BY a.update_date DESC
			</otherwise>
		</choose>
	</select>
	
	
	<insert id="insert">
		INSERT INTO land_road_ve_record(
			eport_id,
			main_port,
			co_code,
			ve_target_no,
			domestic_lisence_no,
			domestic_license_color,
			foreign_license,
			ve_reg_place,
			ve_property,
			ve_convey_qua,
			ve_card_no,
			ve_owner_name,
			ve_owner_no,
			owner_inside_addr,
			owner_inside_tel,
			ve_type,
			brand,
			model,
			exhaust_capacity,
			ve_factory_date,
			ve_motor_no,
			ve_frame_no,
			ve_ton,
			self_wt,
			allow_tow_total_wt,
			container_inner_length,
			container_inner_width,
			container_inner_height,
			outer_length,
			outer_width,
			outer_height,
			ve_body_color,
			oil_box_capcity,
			allow_ve_ie_port,
			appr_no,
			appr_period,
			curr_apply_bussiness,
			front_45c_pic,
			back_45c_pic,
			oil_box_pic,
			ve_bottom_pic,
			memo,
			proposer,
			propose_time,
			ve_class_flag,
			operation_type,
			trailer_license_no,
			trailer_frame_no,
			appro_no_pic,
			ve_frame_no_pic,
			motor_no_pic,
			foreign_license_pic,
			nationality,
			returnmessage,
			barcode,
			id,
			create_by,
			create_date,
			update_by,
			update_date
		) VALUES (
			#{eportId},
			#{mainPort},
			#{coCode},
			#{veTargetNo},
			#{domesticLisenceNo},
			#{domesticLicenseColor},
			#{foreignLicense},
			#{veRegPlace},
			#{veProperty},
			#{veConveyQua},
			#{veCardNo},
			#{veOwnerName},
			#{veOwnerNo},
			#{ownerInsideAddr},
			#{ownerInsideTel},
			#{veType},
			#{brand},
			#{model},
			#{exhaustCapacity},
			#{veFactoryDate},
			#{veMotorNo},
			#{veFrameNo},
			#{veTon},
			#{selfWt},
			#{allowTowTotalWt},
			#{containerInnerLength},
			#{containerInnerWidth},
			#{containerInnerHeight},
			#{outerLength},
			#{outerWidth},
			#{outerHeight},
			#{veBodyColor},
			#{oilBoxCapcity},
			#{allowVeIePort},
			#{apprNo},
			#{apprPeriod},
			#{currApplyBussiness},
			#{front45cPic},
			#{back45cPic},
			#{oilBoxPic},
			#{veBottomPic},
			#{memo},
			#{proposer},
			#{proposeTime},
			#{veClassFlag},
			#{operationType},
			#{trailerLicenseNo},
			#{trailerFrameNo},
			#{approNoPic},
			#{veFrameNoPic},
			#{motorNoPic},
			#{foreignLicensePic},
			#{nationality},
			#{returnmessage},
			#{barcode},
			#{id},
			#{createBy.id},
			#{createDate},
			#{updateBy.id},
			#{updateDate}
		)
	</insert>
	
	<update id="update">
		UPDATE land_road_ve_record SET 	
			eport_id = #{eportId},
			main_port = #{mainPort},
			co_code = #{coCode},
			ve_target_no = #{veTargetNo},
			domestic_lisence_no = #{domesticLisenceNo},
			domestic_license_color = #{domesticLicenseColor},
			foreign_license = #{foreignLicense},
			ve_reg_place = #{veRegPlace},
			ve_property = #{veProperty},
			ve_convey_qua = #{veConveyQua},
			ve_card_no = #{veCardNo},
			ve_owner_name = #{veOwnerName},
			ve_owner_no = #{veOwnerNo},
			owner_inside_addr = #{ownerInsideAddr},
			owner_inside_tel = #{ownerInsideTel},
			ve_type = #{veType},
			brand = #{brand},
			model = #{model},
			exhaust_capacity = #{exhaustCapacity},
			ve_factory_date = #{veFactoryDate},
			ve_motor_no = #{veMotorNo},
			ve_frame_no = #{veFrameNo},
			ve_ton = #{veTon},
			self_wt = #{selfWt},
			allow_tow_total_wt = #{allowTowTotalWt},
			container_inner_length = #{containerInnerLength},
			container_inner_width = #{containerInnerWidth},
			container_inner_height = #{containerInnerHeight},
			outer_length = #{outerLength},
			outer_width = #{outerWidth},
			outer_height = #{outerHeight},
			ve_body_color = #{veBodyColor},
			oil_box_capcity = #{oilBoxCapcity},
			allow_ve_ie_port = #{allowVeIePort},
			appr_no = #{apprNo},
			appr_period = #{apprPeriod},
			curr_apply_bussiness = #{currApplyBussiness},
			front_45c_pic = #{front45cPic},
			back_45c_pic = #{back45cPic},
			oil_box_pic = #{oilBoxPic},
			ve_bottom_pic = #{veBottomPic},
			memo = #{memo},
			proposer = #{proposer},
			propose_time = #{proposeTime},
			ve_class_flag = #{veClassFlag},
			operation_type = #{operationType},
			trailer_license_no = #{trailerLicenseNo},
			trailer_frame_no = #{trailerFrameNo},
			appro_no_pic = #{approNoPic},
			ve_frame_no_pic = #{veFrameNoPic},
			motor_no_pic = #{motorNoPic},
			foreign_license_pic = #{foreignLicensePic},
			nationality = #{nationality},
			returnmessage = #{returnmessage},
			barcode = #{barcode},
			update_by = #{updateBy.id},
			update_date = #{updateDate}
		WHERE id = #{id}
	</update>
	
	<update id="delete">
		DELETE FROM land_road_ve_record
		WHERE id = #{id}
	</update>
	
</mapper>