|
@@ -0,0 +1,209 @@
|
|
|
+<?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.jjt.biz.mapper.HlBaseMapper">
|
|
|
+
|
|
|
+ <resultMap type="HlBase" id="HlBaseResult">
|
|
|
+ <result property="hlBaseId" column="HL_BASE_ID"/>
|
|
|
+ <result property="modelId" column="MODEL_ID"/>
|
|
|
+ <result property="stand" column="STAND"/>
|
|
|
+ <result property="createBy" column="CREATE_BY"/>
|
|
|
+ <result property="createTime" column="CREATE_TIME"/>
|
|
|
+ <result property="updateBy" column="UPDATE_BY"/>
|
|
|
+ <result property="updateTime" column="UPDATE_TIME"/>
|
|
|
+ <result property="remark" column="REMARK"/>
|
|
|
+ <collection column="hlBaseId=HL_BASE_ID"
|
|
|
+ property="hlClassList" javaType="java.util.List" select="selectHlClassList"/>
|
|
|
+ </resultMap>
|
|
|
+ <resultMap type="HlClass" id="HlClassResult">
|
|
|
+ <result property="classId" column="CLASS_ID"/>
|
|
|
+ <result property="hlBaseId" column="HL_BASE_ID"/>
|
|
|
+ <result property="classCode" column="CLASS_CODE"/>
|
|
|
+ <result property="className" column="CLASS_NAME"/>
|
|
|
+ <result property="classScore" column="CLASS_SCORE"/>
|
|
|
+ <result property="createBy" column="CREATE_BY"/>
|
|
|
+ <result property="createTime" column="CREATE_TIME"/>
|
|
|
+ <result property="updateBy" column="UPDATE_BY"/>
|
|
|
+ <result property="updateTime" column="UPDATE_TIME"/>
|
|
|
+ <result property="remark" column="REMARK"/>
|
|
|
+ <collection column="classId=CLASS_ID"
|
|
|
+ property="hlObjList" javaType="java.util.List" select="selectHlObjList"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap type="HlObj" id="HlObjResult">
|
|
|
+ <result property="hlObjId" column="HL_OBJ_ID"/>
|
|
|
+ <result property="classId" column="CLASS_ID"/>
|
|
|
+ <result property="hlObjName" column="HL_OBJ_NAME"/>
|
|
|
+ <result property="hlObjCode" column="HL_OBJ_CODE"/>
|
|
|
+ <result property="hlObjScore" column="HL_OBJ_SCORE"/>
|
|
|
+ <result property="hlObjStand" column="HL_OBJ_STAND"/>
|
|
|
+ <result property="createBy" column="CREATE_BY"/>
|
|
|
+ <result property="createTime" column="CREATE_TIME"/>
|
|
|
+ <result property="updateBy" column="UPDATE_BY"/>
|
|
|
+ <result property="updateTime" column="UPDATE_TIME"/>
|
|
|
+ <result property="remark" column="REMARK"/>
|
|
|
+ <collection column="hlObjId=HL_OBJ_ID"
|
|
|
+ property="hlDetailList" javaType="java.util.List" select="selectHlDetailList"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap type="HlDetail" id="HlDetailResult">
|
|
|
+ <result property="hlDetailId" column="HL_DETAIL_ID"/>
|
|
|
+ <result property="hlObjId" column="HL_OBJ_ID"/>
|
|
|
+ <result property="hlDetailName" column="HL_DETAIL_NAME"/>
|
|
|
+ <result property="hlDetailCode" column="HL_DETAIL_CODE"/>
|
|
|
+ <result property="hlDetailScore" column="HL_DETAIL_SCORE"/>
|
|
|
+ <result property="createBy" column="CREATE_BY"/>
|
|
|
+ <result property="createTime" column="CREATE_TIME"/>
|
|
|
+ <result property="updateBy" column="UPDATE_BY"/>
|
|
|
+ <result property="updateTime" column="UPDATE_TIME"/>
|
|
|
+ <result property="remark" column="REMARK"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <select id="selectHlClassList" resultMap="HlClassResult">
|
|
|
+ select *
|
|
|
+ from hl_class
|
|
|
+ where HL_BASE_ID = #{hlBaseId}
|
|
|
+ </select>
|
|
|
+ <select id="selectHlObjList" resultMap="HlObjResult">
|
|
|
+ select *
|
|
|
+ from hl_obj
|
|
|
+ where CLASS_ID = #{classId}
|
|
|
+ </select>
|
|
|
+ <select id="selectHlDetailList" resultMap="HlDetailResult">
|
|
|
+ select *
|
|
|
+ from hl_detail
|
|
|
+ where HL_OBJ_ID = #{hlObjId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <sql id="selectHlBaseVo">
|
|
|
+ select HL_BASE_ID,
|
|
|
+ MODEL_ID,
|
|
|
+ STAND,
|
|
|
+ CREATE_BY,
|
|
|
+ CREATE_TIME,
|
|
|
+ UPDATE_BY,
|
|
|
+ UPDATE_TIME,
|
|
|
+ REMARK
|
|
|
+ from hl_base
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectHlBaseList" parameterType="HlBase" resultMap="HlBaseResult">
|
|
|
+ <include refid="selectHlBaseVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="modelId != null ">
|
|
|
+ and MODEL_ID = #{modelId}
|
|
|
+ </if>
|
|
|
+ <if test="stand != null and stand != ''">
|
|
|
+ and STAND = #{stand}
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null and createBy != ''">
|
|
|
+ and CREATE_BY = #{createBy}
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null ">
|
|
|
+ and CREATE_TIME = #{createTime}
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null and updateBy != ''">
|
|
|
+ and UPDATE_BY = #{updateBy}
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null ">
|
|
|
+ and UPDATE_TIME = #{updateTime}
|
|
|
+ </if>
|
|
|
+ <if test="remark != null and remark != ''">
|
|
|
+ and REMARK = #{remark}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectHlBaseByHlBaseId" parameterType="Long" resultMap="HlBaseResult">
|
|
|
+ <include refid="selectHlBaseVo"/>
|
|
|
+ where HL_BASE_ID = #{hlBaseId}
|
|
|
+ </select>
|
|
|
+ <select id="selectHlBaseByModelId" resultMap="HlBaseResult">
|
|
|
+ <include refid="selectHlBaseVo"/>
|
|
|
+ where MODEL_ID = #{modelId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertHlBase" parameterType="HlBase" useGeneratedKeys="true" keyProperty="hlBaseId">
|
|
|
+ insert into hl_base
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="modelId != null">MODEL_ID,
|
|
|
+ </if>
|
|
|
+ <if test="stand != null">STAND,
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">CREATE_BY,
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">CREATE_TIME,
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">UPDATE_BY,
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">UPDATE_TIME,
|
|
|
+ </if>
|
|
|
+ <if test="remark != null">REMARK,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="modelId != null">#{modelId},
|
|
|
+ </if>
|
|
|
+ <if test="stand != null">#{stand},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">#{createBy},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">#{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">#{updateBy},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">#{updateTime},
|
|
|
+ </if>
|
|
|
+ <if test="remark != null">#{remark},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateHlBase" parameterType="HlBase">
|
|
|
+ update hl_base
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="modelId != null">MODEL_ID =
|
|
|
+ #{modelId},
|
|
|
+ </if>
|
|
|
+ <if test="stand != null">STAND =
|
|
|
+ #{stand},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null">CREATE_BY =
|
|
|
+ #{createBy},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">CREATE_TIME =
|
|
|
+ #{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null">UPDATE_BY =
|
|
|
+ #{updateBy},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">UPDATE_TIME =
|
|
|
+ #{updateTime},
|
|
|
+ </if>
|
|
|
+ <if test="remark != null">REMARK =
|
|
|
+ #{remark},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ where HL_BASE_ID = #{hlBaseId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteHlBaseByHlBaseId" parameterType="Long">
|
|
|
+ delete
|
|
|
+ from hl_base
|
|
|
+ where HL_BASE_ID = #{hlBaseId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteHlBaseByHlBaseIds" parameterType="String">
|
|
|
+ delete from hl_base where HL_BASE_ID in
|
|
|
+ <foreach item="hlBaseId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{hlBaseId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+ <delete id="deleteHlBase4ModelId">
|
|
|
+ delete from hl_detail where HL_OBJ_ID in (select HL_OBJ_ID from hl_obj where CLASS_ID in (select CLASS_ID from hl_class where hl_base_id in (select hl_base_id from hl_base where model_id =#{modelId})));
|
|
|
+ delete from hl_obj where CLASS_ID in (select CLASS_ID from hl_class where hl_base_id in (select hl_base_id from hl_base where model_id =#{modelId}));
|
|
|
+ delete from hl_class where hl_base_id in (select hl_base_id from hl_base where model_id =#{modelId});
|
|
|
+ delete from hl_base where model_id =#{modelId};
|
|
|
+ </delete>
|
|
|
+</mapper>
|