|
|
@@ -0,0 +1,110 @@
|
|
|
+<?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.safetyCheck.mapper.CoreSafecheckPlanToCheckOrgTypeMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.xunmei.core.safetyCheck.domain.CoreSafecheckPlanToCheckOrgType"
|
|
|
+ id="CoreSafecheckPlanToCheckOrgTypeResult">
|
|
|
+ <result property="planId" column="plan_id"/>
|
|
|
+ <result property="typeId" column="type_id"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectCoreSafecheckPlanToCheckOrgTypeVo">
|
|
|
+ select plan_id, type_id, create_time, update_time, create_by, update_by
|
|
|
+ from core_safecheck_plan_to_check_org_type
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectCoreSafecheckPlanToCheckOrgTypeList"
|
|
|
+ parameterType="com.xunmei.core.safetyCheck.domain.CoreSafecheckPlanToCheckOrgType"
|
|
|
+ resultMap="CoreSafecheckPlanToCheckOrgTypeResult">
|
|
|
+ <include refid="selectCoreSafecheckPlanToCheckOrgTypeVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="planId != null ">
|
|
|
+ and plan_id = #{planId}
|
|
|
+ </if>
|
|
|
+ <if test="typeId != null ">
|
|
|
+ and type_id = #{typeId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectCoreSafecheckPlanToCheckOrgTypeByPlanId" parameterType="Long"
|
|
|
+ resultMap="CoreSafecheckPlanToCheckOrgTypeResult">
|
|
|
+ <include refid="selectCoreSafecheckPlanToCheckOrgTypeVo"/>
|
|
|
+ where plan_id = #{planId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertCoreSafecheckPlanToCheckOrgType"
|
|
|
+ parameterType="com.xunmei.core.safetyCheck.domain.CoreSafecheckPlanToCheckOrgType">
|
|
|
+ insert into core_safecheck_plan_to_check_org_type
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="planId != null">plan_id,
|
|
|
+ </if>
|
|
|
+ <if test="typeId != null">type_id,
|
|
|
+ </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>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="planId != null">#{planId},
|
|
|
+ </if>
|
|
|
+ <if test="typeId != null">#{typeId},
|
|
|
+ </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>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateCoreSafecheckPlanToCheckOrgType"
|
|
|
+ parameterType="com.xunmei.core.safetyCheck.domain.CoreSafecheckPlanToCheckOrgType">
|
|
|
+ update core_safecheck_plan_to_check_org_type
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="typeId != null">type_id =
|
|
|
+ #{typeId},
|
|
|
+ </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>
|
|
|
+ </trim>
|
|
|
+ where plan_id = #{planId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteCoreSafecheckPlanToCheckOrgTypeByPlanId" parameterType="Long">
|
|
|
+ delete
|
|
|
+ from core_safecheck_plan_to_check_org_type
|
|
|
+ where plan_id = #{planId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteCoreSafecheckPlanToCheckOrgTypeByPlanIds" parameterType="String">
|
|
|
+ delete from core_safecheck_plan_to_check_org_type where plan_id in
|
|
|
+ <foreach item="planId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{planId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|