|
@@ -0,0 +1,168 @@
|
|
|
+<!DOCTYPE mapper
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+
|
|
|
+<mapper namespace="com.bosshand.virgo.api.dao.MeetingMinutesDao">
|
|
|
+
|
|
|
+ <resultMap type="com.bosshand.virgo.api.model.MeetingMinutes" id="result">
|
|
|
+ <id column="id" property="id"/>
|
|
|
+ <result column="organizationId" property="organizationId"/>
|
|
|
+ <result column="projectId" property="projectId"/>
|
|
|
+ <result column="date" property="date"/>
|
|
|
+ <result column="name" property="name"/>
|
|
|
+ <result column="duration" property="duration"/>
|
|
|
+ <result column="placeId" property="placeId"/>
|
|
|
+ <result column="placeName" property="placeName"/>
|
|
|
+ <result column="typeId" property="typeId"/>
|
|
|
+ <result column="typeName" property="typeName"/>
|
|
|
+ <result column="type" property="type"/>
|
|
|
+ <result column="attachment" property="attachment"/>
|
|
|
+ <result column="joinUserIds" property="joinUserIds"/>
|
|
|
+ <result column="content" property="content"/>
|
|
|
+ <result column="status" property="status"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap type="com.bosshand.virgo.api.model.MeetingMinutes" id="MeetingMinutesResult">
|
|
|
+ <id column="id" property="id"/>
|
|
|
+ <result column="organizationId" property="organizationId"/>
|
|
|
+ <result column="projectId" property="projectId"/>
|
|
|
+ <result column="date" property="date"/>
|
|
|
+ <result column="name" property="name"/>
|
|
|
+ <result column="duration" property="duration"/>
|
|
|
+ <result column="placeId" property="placeId"/>
|
|
|
+ <result column="placeName" property="placeName"/>
|
|
|
+ <result column="typeId" property="typeId"/>
|
|
|
+ <result column="typeName" property="typeName"/>
|
|
|
+ <result column="type" property="type"/>
|
|
|
+ <result column="attachment" property="attachment"/>
|
|
|
+ <result column="joinUserIds" property="joinUserIds"/>
|
|
|
+ <result column="content" property="content"/>
|
|
|
+ <result column="status" property="status"/>
|
|
|
+ <collection property="joinUserList" ofType="com.bosshand.virgo.api.model.JoinUser">
|
|
|
+ <id property="id" column="joinUser_id"/>
|
|
|
+ <result property="name" column="joinUser_name"/>
|
|
|
+ <result property="portrait" column="joinUser_portrait"/>
|
|
|
+ </collection>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="query">
|
|
|
+ select a.*, b.name as placeName, c.name as typeName
|
|
|
+ from meeting_minutes a
|
|
|
+ LEFT JOIN meeting_place b ON a.placeId = b.id
|
|
|
+ LEFT JOIN meeting_type c ON a.typeId = c.id
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <sql id="details">
|
|
|
+ select a.*,
|
|
|
+ b.name as placeName,
|
|
|
+ c.name as typeName,
|
|
|
+ d.id as joinUser_id,
|
|
|
+ d.name as joinUser_name,
|
|
|
+ d.portrait as joinUser_portrait
|
|
|
+ from meeting_minutes a
|
|
|
+ LEFT JOIN meeting_place b ON a.placeId = b.id
|
|
|
+ LEFT JOIN meeting_type c ON a.typeId = c.id
|
|
|
+ LEFT JOIN mgr_user d ON FIND_IN_SET(d.id, a.joinUserIds)
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="get" resultMap="MeetingMinutesResult">
|
|
|
+ <include refid="details"/> where a.id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getTotalCount" parameterType="com.bosshand.virgo.api.model.MeetingMinutes" resultType="Integer">
|
|
|
+ SELECT count(*) FROM meeting_minutes
|
|
|
+ <where>
|
|
|
+ <if test="organizationId != 0">
|
|
|
+ and organizationId = #{organizationId}
|
|
|
+ </if>
|
|
|
+ <if test="projectId != 0">
|
|
|
+ and projectId = #{projectId}
|
|
|
+ </if>
|
|
|
+ <if test="date != null">
|
|
|
+ and date = #{date}
|
|
|
+ </if>
|
|
|
+ <if test="name != null">
|
|
|
+ and name = #{name}
|
|
|
+ </if>
|
|
|
+ <if test="duration != null">
|
|
|
+ and duration = #{duration}
|
|
|
+ </if>
|
|
|
+ <if test="placeId != 0">
|
|
|
+ and placeId = #{placeId}
|
|
|
+ </if>
|
|
|
+ <if test="typeId != 0">
|
|
|
+ and typeId = #{typeId}
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ and type = #{type}
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ and status = #{status}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getLimit" resultMap="result">
|
|
|
+ <include refid="query"/>
|
|
|
+ <where>
|
|
|
+ <if test="p.organizationId != 0">
|
|
|
+ and a.organizationId = #{p.organizationId}
|
|
|
+ </if>
|
|
|
+ <if test="p.projectId != 0">
|
|
|
+ and a.projectId = #{p.projectId}
|
|
|
+ </if>
|
|
|
+ <if test="p.date != null">
|
|
|
+ and a.date = #{p.date}
|
|
|
+ </if>
|
|
|
+ <if test="p.name != null">
|
|
|
+ and a.name = #{p.name}
|
|
|
+ </if>
|
|
|
+ <if test="p.duration != null">
|
|
|
+ and a.duration = #{p.duration}
|
|
|
+ </if>
|
|
|
+ <if test="p.placeId != 0">
|
|
|
+ and a.placeId = #{p.placeId}
|
|
|
+ </if>
|
|
|
+ <if test="p.typeId != 0">
|
|
|
+ and a.typeId = #{p.typeId}
|
|
|
+ </if>
|
|
|
+ <if test="p.type != null">
|
|
|
+ and a.type = #{p.type}
|
|
|
+ </if>
|
|
|
+ <if test="p.status != null">
|
|
|
+ and a.status = #{p.status}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ limit #{currIndex} , #{pageSize}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <insert id="insert" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ INSERT INTO meeting_minutes (organizationId, projectId, date, name, duration, placeId, typeId, type, status, joinUserIds, attachment, content)
|
|
|
+ VALUES (#{organizationId}, #{projectId}, #{date}, #{name}, #{duration}, #{placeId}, #{typeId}, #{type}, #{status}, #{joinUserIds}, #{attachment}, #{content})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <delete id="delete">
|
|
|
+ DELETE FROM meeting_minutes WHERE id=#{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <update id="update" parameterType="com.bosshand.virgo.api.model.MeetingMinutes">
|
|
|
+ UPDATE meeting_minutes
|
|
|
+ <trim prefix="set" suffixOverrides=",">
|
|
|
+ <if test="organizationId!=0">organizationId=#{organizationId},</if>
|
|
|
+ <if test="projectId!=0">projectId=#{projectId},</if>
|
|
|
+ <if test="date!=null">date=#{date},</if>
|
|
|
+ <if test="name!=null">name=#{name},</if>
|
|
|
+ <if test="duration!=null">duration=#{duration},</if>
|
|
|
+ <if test="placeId!=0">placeId=#{placeId},</if>
|
|
|
+ <if test="typeId!=0">typeId=#{typeId},</if>
|
|
|
+ <if test="type!=null">type=#{type},</if>
|
|
|
+ <if test="status!=null">status=#{status},</if>
|
|
|
+ <if test="attachment!=null">attachment=#{attachment},</if>
|
|
|
+ <if test="joinUserIds!=null">joinUserIds=#{joinUserIds},</if>
|
|
|
+ <if test="content!=null">content=#{content},</if>
|
|
|
+ </trim>
|
|
|
+ WHERE id=#{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+</mapper>
|