| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224 |
- <?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="cn.com.goldenwater.dcproj.dao.BisInspTravelPlanPointDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.BisInspTravelPlanPoint" id="bisInspTravelPlanPointResultMap">
- <result property="distance" column="DISTANCE"/>
- <result property="consuming" column="CONSUMING"/>
- <result property="id" column="ID"/>
- <result property="planDayId" column="PLAN_DAY_ID"/>
- <result property="name" column="NAME"/>
- <result property="addvcd" column="ADDVCD"/>
- <result property="addvnm" column="ADDVNM"/>
- <result property="lev" column="LEV"/>
- <result property="lgtd" column="LGTD"/>
- <result property="lttd" column="LTTD"/>
- <result property="icons" column="ICONS"/>
- <result property="ordr" column="ORDR"/>
- <result property="intm" column="INTM" jdbcType="TIMESTAMP"/>
- <result property="uptm" column="UPTM" jdbcType="TIMESTAMP"/>
- <result property="dataStat" column="DATA_STAT"/>
- <result property="ptype" column="PTYPE"/>
- <result property="regid" column="REGID"/>
- <result property="travelPlanId" column="TRAVEL_PLAN_ID"/>
- <result property="sttm" column="STTM" jdbcType="TIMESTAMP"/>
- <result property="entm" column="ENTM" jdbcType="TIMESTAMP"/>
- <result property="note" column="NOTE"/>
- </resultMap>
- <sql id="table_columns">
- PTYPE,
- REGID,
- TRAVEL_PLAN_ID,
- DISTANCE,
- CONSUMING,
- STTM,
- ENTM,
- ID,
- PLAN_DAY_ID,
- NAME,
- ADDVCD,
- ADDVNM,
- LEV,
- LGTD,
- LTTD,
- ICONS,
- ORDR,
- INTM,
- UPTM,
- NOTE,
- DATA_STAT
- </sql>
- <sql id="entity_properties">
- #{ptype},
- #{regid},
- #{travelPlanId},
- #{distance},
- #{consuming},
- #{sttm},
- #{entm},
- #{id},
- #{planDayId},
- #{name},
- #{addvcd},
- #{addvnm},
- #{lev},
- #{lgtd},
- #{lttd},
- #{icons},
- #{ordr},
- #{intm},
- #{uptm},
- #{note},
- #{dataStat}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="regid != null and regid != ''">and REGID = #{regid}</if>
- <if test="travelPlanId != null and travelPlanId != ''">and TRAVEL_PLAN_ID = #{travelPlanId}</if>
- <if test="distance != null and distance != ''">and DISTANCE = #{distance}</if>
- <if test="consuming != null and consuming != ''">and CONSUMING = #{consuming}</if>
- <if test="sttm != null">and STTM = #{sttm}</if>
- <if test="entm != null">and ENTM = #{entm}</if>
- <if test="id != null and id != ''">and ID = #{id}</if>
- <if test="planDayId != null and planDayId != ''">and PLAN_DAY_ID = #{planDayId}</if>
- <if test="name != null and name != ''">and NAME = #{name}</if>
- <if test="addvcd != null and addvcd != ''">and ADDVCD = #{addvcd}</if>
- <if test="addvnm != null and addvnm != ''">and ADDVNM = #{addvnm}</if>
- <if test="lev != null and lev != ''">and LEV = #{lev}</if>
- <if test="lgtd != null and lgtd != ''">and LGTD = #{lgtd}</if>
- <if test="lttd != null and lttd != ''">and LTTD = #{lttd}</if>
- <if test="icons != null and icons != ''">and ICONS = #{icons}</if>
- <if test="ordr != null and ordr != ''">and ORDR = #{ordr}</if>
- <if test="intm != null">and INTM = #{intm}</if>
- <if test="uptm != null">and UPTM = #{uptm}</if>
- <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
- <if test="note != null and note != ''">and note = #{note}</if>
- and DATA_STAT='0'
- </trim>
- </sql>
- <select id="get" resultMap="bisInspTravelPlanPointResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from BIS_INSP_TRAVEL_PLAN_POINT where ID = #{id}
- </select>
- <select id="getBy" resultMap="bisInspTravelPlanPointResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_TRAVEL_PLAN_POINT
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="bisInspTravelPlanPointResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_TRAVEL_PLAN_POINT
- </select>
- <select id="findList" resultMap="bisInspTravelPlanPointResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_TRAVEL_PLAN_POINT
- <include refid="page_where"/>
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from BIS_INSP_TRAVEL_PLAN_POINT
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspTravelPlanPoint">
- insert into BIS_INSP_TRAVEL_PLAN_POINT(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- update BIS_INSP_TRAVEL_PLAN_POINT set DATA_STAT='9' where ID = #{id}
- </delete>
- <delete id="deleteByDayId" parameterType="java.lang.String">
- update BIS_INSP_TRAVEL_PLAN_POINT set DATA_STAT='9' where plan_day_id=#{dayId}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspTravelPlanPoint">
- delete from BIS_INSP_TRAVEL_PLAN_POINT
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update BIS_INSP_TRAVEL_PLAN_POINT set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspTravelPlanPoint">
- update BIS_INSP_TRAVEL_PLAN_POINT
- <trim prefix="set" suffixOverrides=",">
- <if test="regid != null and regid != ''">REGID = #{regid},</if>
- <if test="travelPlanId != null and travelPlanId != ''">TRAVEL_PLAN_ID = #{travelPlanId},</if>
- <if test="distance != null and distance != ''">DISTANCE = #{distance},</if>
- <if test="consuming != null and consuming != ''">CONSUMING = #{consuming},</if>
- <if test="sttm != null">STTM = #{sttm},</if>
- <if test="entm != null">ENTM = #{entm},</if>
- <if test="ptype != null and ptype != ''">ptype = #{ptype},</if>
- <if test="planDayId != null and planDayId != ''">PLAN_DAY_ID = #{planDayId},</if>
- <if test="name != null and name != ''">NAME = #{name},</if>
- <if test="addvcd != null and addvcd != ''">ADDVCD = #{addvcd},</if>
- <if test="addvnm != null and addvnm != ''">ADDVNM = #{addvnm},</if>
- <if test="lev != null and lev != ''">LEV = #{lev},</if>
- <if test="lgtd != null and lgtd != ''">LGTD = #{lgtd},</if>
- <if test="lttd != null and lttd != ''">LTTD = #{lttd},</if>
- <if test="icons != null and icons != ''">ICONS = #{icons},</if>
- <if test="ordr != null and ordr != ''">ORDR = #{ordr},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspTravelPlanPoint">
- update BIS_INSP_TRAVEL_PLAN_POINT
- <trim prefix="set" suffixOverrides=",">
- <if test="regid != null and regid != ''">REGID = #{regid},</if>
- <if test="travelPlanId != null and travelPlanId != ''">TRAVEL_PLAN_ID = #{travelPlanId},</if>
- <if test="distance != null and distance != ''">DISTANCE = #{distance},</if>
- <if test="consuming != null and consuming != ''">CONSUMING = #{consuming},</if>
- <if test="sttm != null">STTM = #{sttm},</if>
- <if test="entm != null">ENTM = #{entm},</if>
- <if test="ptype != null and ptype != ''">ptype = #{ptype},</if>
- <if test="planDayId != null and planDayId != ''">PLAN_DAY_ID = #{planDayId},</if>
- <if test="name != null and name != ''">NAME = #{name},</if>
- <if test="addvcd != null and addvcd != ''">ADDVCD = #{addvcd},</if>
- <if test="addvnm != null and addvnm != ''">ADDVNM = #{addvnm},</if>
- <if test="lev != null and lev != ''">LEV = #{lev},</if>
- <if test="lgtd != null and lgtd != ''">LGTD = #{lgtd},</if>
- <if test="lttd != null and lttd != ''">LTTD = #{lttd},</if>
- <if test="icons != null and icons != ''">ICONS = #{icons},</if>
- <if test="ordr != null and ordr != ''">ORDR = #{ordr},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
- <if test="note != null and note != ''">NOTE = #{note},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- <select id="getPointByDayId" resultMap="bisInspTravelPlanPointResultMap">
- select t.*,t.rowid from bis_insp_travel_plan_point t where DATA_STAT='0' AND plan_day_id=#{dayId} order by ORDR
- </select>
- <select id="getMaxOne" resultType="java.lang.Integer">
- select max(ORDR) from bis_insp_travel_plan_point t where DATA_STAT='0' AND plan_day_id=#{dayId}
- </select>
- </mapper>
|