|
|
@@ -0,0 +1,168 @@
|
|
|
+<?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.CoreSafetyWorkSummaryMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.xunmei.core.safetybook.domain.CoreSafetyWorkSummary" id="CoreSafetyWorkSummaryResult">
|
|
|
+ <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="orgId" column="org_id"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectCoreSafetyWorkSummaryVo">
|
|
|
+ select *
|
|
|
+ from core_safety_work_summary
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectCoreSafetyWorkSummaryList"
|
|
|
+ parameterType="com.xunmei.core.safetybook.domain.CoreSafetyWorkSummary"
|
|
|
+ resultMap="CoreSafetyWorkSummaryResult">
|
|
|
+ <include refid="selectCoreSafetyWorkSummaryVo"/>
|
|
|
+ <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="orgId != null ">
|
|
|
+ and org_id = #{orgId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectCoreSafetyWorkSummaryById" parameterType="Long"
|
|
|
+ resultMap="CoreSafetyWorkSummaryResult">
|
|
|
+ <include refid="selectCoreSafetyWorkSummaryVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+ <select id="selectPage" resultType="com.xunmei.core.safetybook.vo.CoreSafetyWorkSummaryVo">
|
|
|
+ select a.*,
|
|
|
+ o.short_name as orgName
|
|
|
+ from core_safety_work_summary a
|
|
|
+ left join sys_org o on o.id=a.org_id
|
|
|
+ <where>
|
|
|
+ <if test="aq.year != null ">
|
|
|
+ and a.year = #{aq.year}
|
|
|
+ </if>
|
|
|
+ <if test="aq.range!=null and aq.range.size >1">
|
|
|
+ and a.date <![CDATA[>=]]> #{aq.range[0]} and a.date <![CDATA[<=]]> #{aq.range[1]}
|
|
|
+ </if>
|
|
|
+ <if test="aq.checkSub ==true">
|
|
|
+ and o.path like concat(#{aq.selectOrgPath},'%')
|
|
|
+ </if>
|
|
|
+ <if test="aq.checkSub ==false and aq.orgId != null">
|
|
|
+ and a.org_id = #{aq.orgId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ group by a.id,a.create_time
|
|
|
+ order by a.create_time desc
|
|
|
+ </select>
|
|
|
+ <select id="selectById" resultType="com.xunmei.core.safetybook.vo.CoreSafetyWorkSummaryVo">
|
|
|
+ select a.*,
|
|
|
+ o.short_name as org_name
|
|
|
+ from core_safety_work_summary a
|
|
|
+ left join sys_org o on o.id = a.org_id
|
|
|
+ where a.id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+<!-- <insert id="insertCoreSafetyWorkSummary"-->
|
|
|
+<!-- parameterType="com.xunmei.core.safetybook.domain.CoreSafetyWorkSummary">-->
|
|
|
+<!-- insert into core_safety_work_summary-->
|
|
|
+<!-- <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="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="orgId != null">#{orgId},-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- </trim>-->
|
|
|
+<!-- </insert>-->
|
|
|
+
|
|
|
+<!-- <update id="updateCoreSafetyWorkSummary"-->
|
|
|
+<!-- parameterType="com.xunmei.core.safetybook.domain.CoreSafetyWorkSummary">-->
|
|
|
+<!-- update core_safety_work_summary-->
|
|
|
+<!-- <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="orgId != null">org_id =-->
|
|
|
+<!-- #{orgId},-->
|
|
|
+<!-- </if>-->
|
|
|
+<!-- </trim>-->
|
|
|
+<!-- where id = #{id}-->
|
|
|
+<!-- </update>-->
|
|
|
+
|
|
|
+ <delete id="deleteCoreSafetyWorkSummaryById" parameterType="Long">
|
|
|
+ delete
|
|
|
+ from core_safety_work_summary
|
|
|
+ where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteCoreSafetyWorkSummaryByIds" parameterType="String">
|
|
|
+ delete from core_safety_work_summary where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|