| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- <?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.BisInspMeetDiscussDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.BisInspMeetDiscuss" id="bisInspMeetDiscussResultMap">
- <result property="id" column="ID"/>
- <result property="disNm" column="DIS_NM"/>
- <result property="persId" column="PERS_ID"/>
- <result property="persName" column="PERS_NAME"/>
- <result property="orgId" column="ORG_ID"/>
- <result property="orgNm" column="ORG_NM"/>
- <result property="intm" column="INTM"/>
- <result property="uptm" column="UPTM"/>
- <result property="flagValid" column="FLAG_VALID"/>
- <result property="meetingNumber" column="MEETING_NUMBER"/>
- </resultMap>
- <sql id="table_columns">
- ID,
- DIS_NM,
- PERS_ID,
- PERS_NAME,
- ORG_ID,
- ORG_NM,
- INTM,
- UPTM,
- FLAG_VALID,
- MEETING_NUMBER
- </sql>
- <sql id="entity_properties">
- #{id},
- #{disNm},
- #{persId},
- #{persName},
- #{orgId},
- #{orgNm},
- #{intm},
- #{uptm},
- #{flagValid},
- #{meetingNumber}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="disNm != null and disNm != ''">and DIS_NM = #{disNm}</if>
- <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
- <if test="persName != null and persName != ''">and PERS_NAME = #{persName}</if>
- <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
- <if test="orgNm != null and orgNm != ''">and ORG_NM = #{orgNm}</if>
- <if test="intm != null">and INTM = #{intm}</if>
- <if test="uptm != null">and UPTM = #{uptm}</if>
- <if test="flagValid != null and flagValid != ''">and FLAG_VALID = #{flagValid}</if>
- <if test="meetingNumber != null and meetingNumber != ''">and MEETING_NUMBER = #{meetingNumber}</if>
- </trim>
- </sql>
- <select id="getBy" resultMap="bisInspMeetDiscussResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_MEET_DISCUSS
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="bisInspMeetDiscussResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_MEET_DISCUSS
- </select>
- <select id="findList" resultMap="bisInspMeetDiscussResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_MEET_DISCUSS
- <include refid="page_where"/>
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from BIS_INSP_MEET_DISCUSS
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspMeetDiscuss">
- insert into BIS_INSP_MEET_DISCUSS(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from BIS_INSP_MEET_DISCUSS where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspMeetDiscuss">
- delete from BIS_INSP_MEET_DISCUSS
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update BIS_INSP_MEET_DISCUSS set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspMeetDiscuss">
- update BIS_INSP_MEET_DISCUSS
- <trim prefix="set" suffixOverrides=",">
- <if test="disNm != null and disNm != ''">DIS_NM = #{disNm},</if>
- <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
- <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
- <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
- <if test="orgNm != null and orgNm != ''">ORG_NM = #{orgNm},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="flagValid != null and flagValid != ''">FLAG_VALID = #{flagValid},</if>
- <if test="meetingNumber != null and meetingNumber != ''">MEETING_NUMBER = #{meetingNumber},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspMeetDiscuss">
- update BIS_INSP_MEET_DISCUSS
- <trim prefix="set" suffixOverrides=",">
- <if test="disNm != null and disNm != ''">DIS_NM = #{disNm},</if>
- <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
- <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
- <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
- <if test="orgNm != null and orgNm != ''">ORG_NM = #{orgNm},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="flagValid != null and flagValid != ''">FLAG_VALID = #{flagValid},</if>
- <if test="meetingNumber != null and meetingNumber != ''">MEETING_NUMBER = #{meetingNumber},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- <resultMap type="cn.com.goldenwater.dcproj.model.BisInspMeetDiscuss" id="discussMap">
- <id property="id" column="ID"/>
- <result property="disNm" column="DIS_NM"/>
- <result property="persId" column="PERS_ID"/>
- <result property="persName" column="PERS_NAME"/>
- <result property="orgId" column="ORG_ID"/>
- <result property="orgNm" column="ORG_NM"/>
- <result property="intm" column="INTM"/>
- <result property="uptm" column="UPTM"/>
- <collection property="bisInspMeetDiscussPersList"
- ofType="cn.com.goldenwater.dcproj.model.BisInspMeetDiscussPers">
- <result property="id" column="DISP_ID"/>
- <result property="persId" column="DIS_PERS_ID"/>
- <result property="persName" column="DIS_PERS_NAME"/>
- <result property="callnumber" column="callnumber"/>
- <result property="disId" column="DIS_ID"/>
- <result property="imgurl" column="imgurl"/>
- </collection>
- </resultMap>
- <select id="get" resultMap="bisInspMeetDiscussResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from BIS_INSP_MEET_DISCUSS where ID = #{id}
- </select>
- <select id="getById" resultMap="discussMap" parameterType="String">
- select A.ID,A.DIS_NM,A.PERS_ID,A.PERS_NAME,A.ORG_ID,A.ORG_NM,A.INTM,
- A.UPTM,B.ID DISP_ID,B.PERS_ID DIS_PERS_ID,B.PERS_NAME DIS_PERS_NAME,
- B.DIS_ID DIS_ID,B.CALLNUMBER,b.imgurl
- from BIS_INSP_MEET_DISCUSS A
- LEFT JOIN BIS_INSP_MEET_DISCUSS_PERS B
- ON A.ID=B.DIS_ID WHERE A.ID = #{id}
- </select>
- <select id="findDiscuss" resultMap="discussMap">
- select A.ID,A.DIS_NM,A.PERS_ID,A.PERS_NAME,A.ORG_ID,A.ORG_NM,A.INTM,
- A.UPTM,B.ID DISP_ID,B.PERS_ID DIS_PERS_ID,B.PERS_NAME DIS_PERS_NAME,
- B.DIS_ID DIS_ID,B.CALLNUMBER,b.imgurl
- from BIS_INSP_MEET_DISCUSS A
- LEFT JOIN BIS_INSP_MEET_DISCUSS_PERS B
- ON A.ID=B.DIS_ID WHERE (
- A.ID IN (SELECT DISTINCT DIS_ID FROM BIS_INSP_MEET_DISCUSS_PERS WHERE PERS_ID =#{persId})
- or A.ID IN (SELECT DISTINCT id FROM BIS_INSP_MEET_DISCUSS WHERE PERS_ID =#{persId})
- )
- </select>
- </mapper>
|