|
|
@@ -0,0 +1,208 @@
|
|
|
+<?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="com.xunmei.core.safetybook.mapper.CoreSafetyBookAqbwbndjhMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.xunmei.core.safetybook.domain.CoreSafetyBookAqbwbndjh" id="CoreSafetyBookAqbwbndjhResult">
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="title" column="title"/>
|
|
|
+ <result property="date" column="date"/>
|
|
|
+ <result property="content" column="content"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
+ <result property="images" column="images"/>
|
|
|
+ <result property="orgId" column="org_id"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectCoreSafetyBookAqbwbndjhVo">
|
|
|
+ select id,
|
|
|
+ title,
|
|
|
+ date,
|
|
|
+ content,
|
|
|
+ create_time,
|
|
|
+ update_time,
|
|
|
+ create_by,
|
|
|
+ update_by,
|
|
|
+ images,
|
|
|
+ org_id
|
|
|
+ from core_safety_book_aqbwbndjh
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectCoreSafetyBookAqbwbndjhList"
|
|
|
+ parameterType="com.xunmei.core.safetybook.domain.CoreSafetyBookAqbwbndjh"
|
|
|
+ resultMap="CoreSafetyBookAqbwbndjhResult">
|
|
|
+ <include refid="selectCoreSafetyBookAqbwbndjhVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="title != null and title != ''">
|
|
|
+ and title = #{title}
|
|
|
+ </if>
|
|
|
+ <if test="date != null ">
|
|
|
+ and date = #{date}
|
|
|
+ </if>
|
|
|
+ <if test="content != null and content != ''">
|
|
|
+ and content = #{content}
|
|
|
+ </if>
|
|
|
+ <if test="images != null and images != ''">
|
|
|
+ and images = #{images}
|
|
|
+ </if>
|
|
|
+ <if test="orgId != null ">
|
|
|
+ and org_id = #{orgId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectCoreSafetyBookAqbwbndjhById" parameterType="Long"
|
|
|
+ resultMap="CoreSafetyBookAqbwbndjhResult">
|
|
|
+ <include refid="selectCoreSafetyBookAqbwbndjhVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+ <select id="selectAqbwbndjhPage" resultType="com.xunmei.core.safetybook.domain.CoreSafetyBookAqbwbndjh">
|
|
|
+ select a.id,
|
|
|
+ a.title,
|
|
|
+ a.date,
|
|
|
+ a.content,
|
|
|
+ a.create_time,
|
|
|
+ a.update_time,
|
|
|
+ a.create_by,
|
|
|
+ a.update_by,
|
|
|
+ a.images,
|
|
|
+ a.org_id,
|
|
|
+ u2.name as userName,
|
|
|
+ o.name as orgName,
|
|
|
+ group_concat(u.name) as userNames
|
|
|
+ from core_safety_book_aqbwbndjh a
|
|
|
+ left join core_safety_book_aqbwbndjh_user au on au.aqbwbndjh_id=a.id
|
|
|
+ left join sys_user u on u.id=au.user_id
|
|
|
+ left join sys_user u2 on u2.id=a.create_by
|
|
|
+ left join sys_org o on o.id=a.org_id
|
|
|
+ <where>
|
|
|
+
|
|
|
+ <if test="aq.date != null ">
|
|
|
+ and a.date = #{aq.date}
|
|
|
+ </if>
|
|
|
+
|
|
|
+
|
|
|
+ </where>
|
|
|
+ group by a.id,a.create_time
|
|
|
+ order by a.create_time desc
|
|
|
+ </select>
|
|
|
+ <select id="selectAqbwbndjhById" resultType="com.xunmei.core.safetybook.domain.CoreSafetyBookAqbwbndjh">
|
|
|
+ select a.id,
|
|
|
+ a.title,
|
|
|
+ a.date,
|
|
|
+ a.content,
|
|
|
+ a.create_time,
|
|
|
+ a.update_time,
|
|
|
+ a.create_by,
|
|
|
+ a.update_by,
|
|
|
+ a.images,
|
|
|
+ a.org_id,
|
|
|
+ group_concat(u.name) as userNames
|
|
|
+ from core_safety_book_aqbwbndjh a
|
|
|
+ left join core_safety_book_aqbwbndjh_user au on au.aqbwbndjh_id = a.id
|
|
|
+ left join sys_user u on u.id = au.user_id
|
|
|
+ where a.id = #{id}
|
|
|
+ group by a.id
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertCoreSafetyBookAqbwbndjh"
|
|
|
+ parameterType="com.xunmei.core.safetybook.domain.CoreSafetyBookAqbwbndjh">
|
|
|
+ insert into core_safety_book_aqbwbndjh
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">id,
|
|
|
+ </if>
|
|
|
+ <if test="title != null">title,
|
|
|
+ </if>
|
|
|
+ <if test="date != null">date,
|
|
|
+ </if>
|
|
|
+ <if test="content != null">content,
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">create_time,
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">update_time,
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">create_by,
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">update_by,
|
|
|
+ </if>
|
|
|
+ <if test="images != null">images,
|
|
|
+ </if>
|
|
|
+ <if test="orgId != null">org_id,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">#{id},
|
|
|
+ </if>
|
|
|
+ <if test="title != null">#{title},
|
|
|
+ </if>
|
|
|
+ <if test="date != null">#{date},
|
|
|
+ </if>
|
|
|
+ <if test="content != null">#{content},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">#{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">#{updateTime},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">#{createBy},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">#{updateBy},
|
|
|
+ </if>
|
|
|
+ <if test="images != null">#{images},
|
|
|
+ </if>
|
|
|
+ <if test="orgId != null">#{orgId},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateCoreSafetyBookAqbwbndjh"
|
|
|
+ parameterType="com.xunmei.core.safetybook.domain.CoreSafetyBookAqbwbndjh">
|
|
|
+ update core_safety_book_aqbwbndjh
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="title != null">title =
|
|
|
+ #{title},
|
|
|
+ </if>
|
|
|
+ <if test="date != null">date =
|
|
|
+ #{date},
|
|
|
+ </if>
|
|
|
+ <if test="content != null">content =
|
|
|
+ #{content},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">create_time =
|
|
|
+ #{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">update_time =
|
|
|
+ #{updateTime},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">create_by =
|
|
|
+ #{createBy},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">update_by =
|
|
|
+ #{updateBy},
|
|
|
+ </if>
|
|
|
+ <if test="images != null">images =
|
|
|
+ #{images},
|
|
|
+ </if>
|
|
|
+ <if test="orgId != null">org_id =
|
|
|
+ #{orgId},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteCoreSafetyBookAqbwbndjhById" parameterType="Long">
|
|
|
+ delete
|
|
|
+ from core_safety_book_aqbwbndjh
|
|
|
+ where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteCoreSafetyBookAqbwbndjhByIds" parameterType="String">
|
|
|
+ delete from core_safety_book_aqbwbndjh where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|