| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- <?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.MeetMeetingInfoDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.MeetMeetingInfo" id="meetMeetingInfoResultMap">
- <result property="id" column="ID"/>
- <result property="title" column="TITLE"/>
- <result property="content" column="CONTENT"/>
- <result property="address" column="ADDRESS"/>
- <result property="stTm" column="ST_TM"/>
- <result property="enTm" column="EN_TM"/>
- <result property="startTm" column="START_TM"/>
- <result property="endTm" column="END_TM"/>
- <result property="gdX" column="GD_X"/>
- <result property="gdY" column="GD_Y"/>
- <result property="state" column="STATE"/>
- <result property="isOut" column="IS_OUT"/>
- <result property="isHasQues" column="IS_HAS_QUES"/>
- <result property="intm" column="INTM"/>
- </resultMap>
- <sql id="table_columns">
- ID,
- TITLE,
- CONTENT,
- ADDRESS,
- ST_TM,
- EN_TM,
- START_TM,
- END_TM,
- GD_X,
- GD_Y,
- STATE,
- IS_OUT,
- IS_HAS_QUES,
- INTM
- </sql>
- <sql id="entity_properties">
- #{id},
- #{title},
- #{content},
- #{address},
- #{stTm},
- #{enTm},
- #{startTm},
- #{endTm},
- #{gdX},
- #{gdY},
- #{state},
- #{isOut},
- #{isHasQues},
- #{intm}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="title != null and title != ''">and TITLE like concat('%',#columnName#,'%')</if>
- <if test="content != null and content != ''">and CONTENT = #{content}</if>
- <if test="address != null and address != ''">and ADDRESS = #{address}</if>
- <if test="stTm != null">and ST_TM = #{stTm}</if>
- <if test="enTm != null">and EN_TM = #{enTm}</if>
- <if test="startTm != null">and START_TM = #{startTm}</if>
- <if test="endTm != null">and END_TM = #{endTm}</if>
- <if test="gdX != null and gdX != ''">and GD_X = #{gdX}</if>
- <if test="gdY != null and gdY != ''">and GD_Y = #{gdY}</if>
- <if test="state != null and state != ''">and STATE = #{state}</if>
- <if test="isOut != null and isOut != ''">and IS_OUT = #{isOut}</if>
- <if test="isHasQues != null and isHasQues != ''">and IS_HAS_QUES = #{isHasQues}</if>
- <if test="intm != null">and INTM = #{intm}</if>
- </trim>
- </sql>
- <select id="get" resultMap="meetMeetingInfoResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from MEET_MEETING_INFO where ID = #{id}
- </select>
- <select id="getBy" resultMap="meetMeetingInfoResultMap">
- select
- <include refid="table_columns"/>
- from MEET_MEETING_INFO
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="meetMeetingInfoResultMap">
- select
- <include refid="table_columns"/>
- from MEET_MEETING_INFO
- </select>
- <select id="findList" resultMap="meetMeetingInfoResultMap">
- select
- <include refid="table_columns"/>
- from MEET_MEETING_INFO
- <include refid="page_where"/>
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from MEET_MEETING_INFO
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.MeetMeetingInfo">
- insert into MEET_MEETING_INFO(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from MEET_MEETING_INFO where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.MeetMeetingInfo">
- delete from MEET_MEETING_INFO
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update MEET_MEETING_INFO set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.MeetMeetingInfo">
- update MEET_MEETING_INFO
- <trim prefix="set" suffixOverrides=",">
- <if test="title != null and title != ''">TITLE = #{title},</if>
- <if test="content != null and content != ''">CONTENT = #{content},</if>
- <if test="address != null and address != ''">ADDRESS = #{address},</if>
- <if test="stTm != null">ST_TM = #{stTm},</if>
- <if test="enTm != null">EN_TM = #{enTm},</if>
- <if test="startTm != null">START_TM = #{startTm},</if>
- <if test="endTm != null">END_TM = #{endTm},</if>
- <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
- <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
- <if test="state != null and state != ''">STATE = #{state},</if>
- <if test="isOut != null and isOut != ''">IS_OUT = #{isOut},</if>
- <if test="isHasQues != null and isHasQues != ''">IS_HAS_QUES = #{isHasQues},</if>
- <if test="intm != null">INTM = #{intm},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.MeetMeetingInfo">
- update MEET_MEETING_INFO
- <trim prefix="set" suffixOverrides=",">
- <if test="title != null and title != ''">TITLE = #{title},</if>
- <if test="content != null and content != ''">CONTENT = #{content},</if>
- <if test="address != null and address != ''">ADDRESS = #{address},</if>
- <if test="stTm != null">ST_TM = #{stTm},</if>
- <if test="enTm != null">EN_TM = #{enTm},</if>
- <if test="startTm != null">START_TM = #{startTm},</if>
- <if test="endTm != null">END_TM = #{endTm},</if>
- <if test="gdX != null and gdX != ''">GD_X = #{gdX},</if>
- <if test="gdY != null and gdY != ''">GD_Y = #{gdY},</if>
- <if test="state != null and state != ''">STATE = #{state},</if>
- <if test="isOut != null and isOut != ''">IS_OUT = #{isOut},</if>
- <if test="isHasQues != null and isHasQues != ''">IS_HAS_QUES = #{isHasQues},</if>
- <if test="intm != null">INTM = #{intm},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <select id="getMeetList" resultMap="meetMeetingInfoResultMap" parameterType="java.util.Map">
- SELECT A.* FROM MEET_MEETING_INFO A
- LEFT JOIN MEET_PERS_LIST B ON A.ID = B.MEETING_ID
- WHERE B.NAME = #{persName} AND B.MBLE_NUM = #{phone}
- AND DATE_ADD(STR_TO_DATE(A.START_TM,'%Y-%m-%d'), INTERVAL -1 DAY) <= SYSDATE() AND SYSDATE() <= DATE_ADD(STR_TO_DATE(A.END_TM,'%Y-%m-%d'), INTERVAL 1 DAY)
- </select>
- <!-- 其他自定义SQL -->
- <select id="getMeetPersList" resultType="cn.com.goldenwater.dcproj.model.MeetPersList"
- parameterType="java.util.Map">
- SELECT A.TITLE as meetName,B.* FROM MEET_MEETING_INFO A
- LEFT JOIN MEET_PERS_LIST B ON A.ID = B.MEETING_ID
- WHERE B.MBLE_NUM = #{phone}
- AND DATE_ADD(STR_TO_DATE(A.START_TM,'%Y-%m-%d'), INTERVAL -1 DAY) <= SYSDATE() AND SYSDATE() <= DATE_ADD(STR_TO_DATE(A.END_TM,'%Y-%m-%d'), INTERVAL 1 DAY)
- </select>
- </mapper>
|