| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235 |
- <?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.BisInspTravelPlanDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.BisInspTravelPlan" id="bisInspTravelPlanResultMap">
- <result property="id" column="ID"/>
- <result property="title" column="TITLE"/>
- <result property="sttm" column="STTM" jdbcType="TIMESTAMP"/>
- <result property="entm" column="ENTM" jdbcType="TIMESTAMP"/>
- <result property="dayCount" column="DAY_COUNT"/>
- <result property="pass" column="PASS"/>
- <result property="persId" column="PERS_ID"/>
- <result property="intm" column="INTM" jdbcType="TIMESTAMP"/>
- <result property="uptm" column="UPTM" jdbcType="TIMESTAMP"/>
- <result property="dataStat" column="DATA_STAT"/>
- <result property="isCollect" column="IS_COLLECT"/>
- <result property="planNm" column="PLAN_NM"/>
- <result property="planId" column="PLAN_ID"/>
- </resultMap>
- <resultMap type="cn.com.goldenwater.dcproj.model.BisInspTravelPlan" id="bisInspTravelPlanAllResultMap">
- <id column="AID" property="id"/>
- <result property="title" column="ATITLE"/>
- <result property="sttm" column="ASTTM" jdbcType="TIMESTAMP"/>
- <result property="entm" column="AENTM" jdbcType="TIMESTAMP"/>
- <result property="dayCount" column="ADAY_COUNT"/>
- <result property="pass" column="APASS"/>
- <result property="persId" column="PERS_ID"/>
- <result property="intm" column="AINTM" jdbcType="TIMESTAMP"/>
- <result property="uptm" column="AUPTM" jdbcType="TIMESTAMP"/>
- <collection property="bisInspTravelPlanDayList" ofType="cn.com.goldenwater.dcproj.model.BisInspTravelPlanDay">
- <id property="id" column="BID"/>
- <result property="title" column="BTITLE"/>
- <result property="minte" column="BMINTE"/>
- <result property="distance" column="BDISTANCE"/>
- <collection property="bisInspTravelPlanPoints"
- ofType="cn.com.goldenwater.dcproj.model.BisInspTravelPlanPoint">
- <id property="id" column="CID"/>
- <result property="distance" column="CDISTANCE"/>
- <result property="consuming" column="CCONSUMING"/>
- <result property="name" column="CNAME"/>
- <result property="addvcd" column="CADDVCD"/>
- <result property="addvnm" column="CADDVNM"/>
- <result property="lev" column="CLEV"/>
- <result property="lgtd" column="CLGTD"/>
- <result property="lttd" column="CLTTD"/>
- <result property="icons" column="CICONS"/>
- <result property="ordr" column="CORDR"/>
- <result property="intm" column="CINTM" jdbcType="TIMESTAMP"/>
- <result property="uptm" column="CUPTM" jdbcType="TIMESTAMP"/>
- <result property="ptype" column="CPTYPE"/>
- <result property="regid" column="CREGID"/>
- <result property="sttm" column="CSTTM" jdbcType="TIMESTAMP"/>
- <result property="entm" column="CENTM" jdbcType="TIMESTAMP"/>
- <result property="note" column="CNOTE"/>
- </collection>
- </collection>
- </resultMap>
- <sql id="table_columns">
- ID,
- TITLE,
- STTM,
- ENTM,
- DAY_COUNT,
- PASS,
- PERS_ID,
- INTM,
- UPTM,
- DATA_STAT,
- IS_COLLECT,
- PLAN_NM,
- PLAN_ID
- </sql>
- <sql id="entity_properties">
- #{id},
- #{title},
- #{sttm},
- #{entm},
- #{dayCount},
- #{pass},
- #{persId},
- #{intm},
- #{uptm},
- #{dataStat},
- #{isCollect},
- #{planNm},
- #{planId}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="title != null and title != ''">and TITLE = #{title}</if>
- <if test="sttm != null">and STTM = #{sttm}</if>
- <if test="entm != null">and ENTM = #{entm}</if>
- <if test="dayCount != null and dayCount != ''">and DAY_COUNT = #{dayCount}</if>
- <if test="pass != null and pass != ''">and PASS = #{pass}</if>
- <if test="persId != null and persId != ''">and PERS_ID = #{persId}</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="isCollect != null and isCollect != ''">and IS_COLLECT = #{isCollect}</if>
- <if test="planNm != null and planNm != ''">and PLAN_NM = #{planNm}</if>
- <if test="planId != null and planId != ''">and PLAN_ID = #{planId}</if>
- and DATA_STAT='0'
- </trim>
- </sql>
- <select id="get" resultMap="bisInspTravelPlanResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from bis_insp_travel_plan where ID = #{id}
- </select>
- <select id="getBy" resultMap="bisInspTravelPlanResultMap">
- select
- <include refid="table_columns"/>
- from bis_insp_travel_plan
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="bisInspTravelPlanResultMap">
- select
- <include refid="table_columns"/>
- from bis_insp_travel_plan
- </select>
- <select id="findList" resultMap="bisInspTravelPlanResultMap">
- select
- <include refid="table_columns"/>
- from bis_insp_travel_plan
- <include refid="page_where"/>
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from bis_insp_travel_plan
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspTravelPlan">
- insert into bis_insp_travel_plan(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- update bis_insp_travel_plan set DATA_STAT='9' where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspTravelPlan">
- update bis_insp_travel_plan set DATA_STAT='9'
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update bis_insp_travel_plan set DATA_STAT = '9' where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspTravelPlan">
- update bis_insp_travel_plan
- <trim prefix="set" suffixOverrides=",">
- <if test="title != null and title != ''">TITLE = #{title},</if>
- <if test="sttm != null">STTM = #{sttm},</if>
- <if test="entm != null">ENTM = #{entm},</if>
- <if test="dayCount != null and dayCount != ''">DAY_COUNT = #{dayCount},</if>
- <if test="pass != null and pass != ''">PASS = #{pass},</if>
- <if test="persId != null and persId != ''">PERS_ID = #{persId},</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="isCollect != null and isCollect != ''">IS_COLLECT = #{isCollect},</if>
- <if test="planNm != null and planNm != ''">PLAN_NM = #{planNm},</if>
- <if test="planId != null and planId != ''">PLAN_ID = #{planId},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspTravelPlan">
- update bis_insp_travel_plan
- <trim prefix="set" suffixOverrides=",">
- <if test="title != null and title != ''">TITLE = #{title},</if>
- <if test="sttm != null">STTM = #{sttm},</if>
- <if test="entm != null">ENTM = #{entm},</if>
- <if test="dayCount != null and dayCount != ''">DAY_COUNT = #{dayCount},</if>
- <if test="pass != null and pass != ''">PASS = #{pass},</if>
- <if test="persId != null and persId != ''">PERS_ID = #{persId},</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="isCollect != null and isCollect != ''">IS_COLLECT = #{isCollect},</if>
- <if test="planNm != null and planNm != ''">PLAN_NM = #{planNm},</if>
- <if test="planId != null and planId != ''">PLAN_ID = #{planId},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- <select id="getMyTravelPlan" resultMap="bisInspTravelPlanResultMap">
- select A.*,B.PERS_NAME from bis_insp_travel_plan a left join bis_insp_all_rlation_pers b on a.pers_id=b.guid
- where A.DATA_STAT='0' AND a.pers_id = #{persId}
- </select>
- <!--根据督查组获取路书相关信息-->
- <select id="getTravelByPlanId" resultMap="bisInspTravelPlanResultMap">
- select * from bis_insp_travel_plan where DATA_STAT='0' and plan_id= #{planId}
- </select>
- <select id="getMaxOne" resultType="java.lang.Integer">
- select Max(ORDR) as ordr from bis_insp_travel_plan where DATA_STAT='0' AND pers_id = #{persId}
- </select>
- <!--获取路书信息-->
- <select id="getTravelPlanInfo" resultMap="bisInspTravelPlanAllResultMap">
- select A.ID AID,A.TITLE ATITLE,A.STTM ASTTM,A.ENTM AENTM,A.DAY_COUNT ADAY_COUNT,A.PASS APASS,A.INTM AINTM,A.UPTM AUPTM,A.IS_COLLECT,
- b.id BID,B.TITLE BTITLE,B.MINTE BMINTE,B.DISTANCE BDISTANCE,
- C.ID CID,C.NAME CNAME,C.ADDVCD CADDVCD,C.ADDVNM CADDVNM,C.REGID CREGID,C.STTM CSTTM,C.ENTM CENTM,C.CONSUMING CCONSUMING,C.NOTE CNOTE
- FROM bis_insp_travel_plan A
- LEFT JOIN BIS_INSP_TRAVEL_PLAN_DAY B ON A.ID=B.TRAVEL_PLAN_ID
- LEFT JOIN BIS_INSP_TRAVEL_PLAN_POINT C ON B.ID=C.PLAN_DAY_ID
- WHERE A.DATA_STAT='0' AND B.DATA_STAT='0' AND C.DATA_STAT='0'
- and A.ID = #{travelPlanId}
- order by B.ORDR,C.ORDR
- </select>
- <!--取消路书关联-->
- <update id="cancelTravelPlan" parameterType="java.lang.String">
- update bis_insp_travel_plan set PLAN_NM =null,PLAN_ID=null where ID = #{id}
- </update>
- </mapper>
|