|
@@ -5,144 +5,169 @@
|
|
|
<mapper namespace="com.jjt.hl.mapper.HlClassMapper">
|
|
|
|
|
|
<resultMap type="HlClass" id="HlClassResult">
|
|
|
- <result property="hlClassId" column="HL_CLASS_ID"/>
|
|
|
- <result property="modelId" column="MODEL_ID"/>
|
|
|
- <result property="objType" column="OBJ_TYPE"/>
|
|
|
- <result property="scoreType" column="SCORE_TYPE"/>
|
|
|
- <result property="hlScore" column="HL_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"/>
|
|
|
+ <result property="hlClassId" column="HL_CLASS_ID"/>
|
|
|
+ <result property="modelId" column="MODEL_ID"/>
|
|
|
+ <result property="objType" column="OBJ_TYPE"/>
|
|
|
+ <result property="scoreType" column="SCORE_TYPE"/>
|
|
|
+ <result property="hlScore" column="HL_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 property="hlObjList" javaType="java.util.List" resultMap="hlObjResult"/>
|
|
|
+ </resultMap>
|
|
|
+ <resultMap id="hlObjResult" type="HlObj">
|
|
|
+ <result property="hlObjId" column="HL_OBJ_ID"/>
|
|
|
+ <result property="hlClassId" column="HL_CLASS_ID"/>
|
|
|
+ <result property="objId" column="OBJ_ID"/>
|
|
|
+ <result property="objName" column="OBJ_NAME"/>
|
|
|
+ <result property="objType" column="OBJ_TYPE"/>
|
|
|
</resultMap>
|
|
|
-
|
|
|
<sql id="selectHlClassVo">
|
|
|
- select HL_CLASS_ID, MODEL_ID, OBJ_TYPE, SCORE_TYPE, HL_SCORE, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, REMARK
|
|
|
- from hl_class
|
|
|
+ select *
|
|
|
+ from (SELECT a.HL_CLASS_ID,
|
|
|
+ a.MODEL_ID,
|
|
|
+ a.OBJ_TYPE,
|
|
|
+ a.SCORE_TYPE,
|
|
|
+ a.HL_SCORE,
|
|
|
+ a.CREATE_BY,
|
|
|
+ a.CREATE_TIME,
|
|
|
+ a.UPDATE_BY,
|
|
|
+ a.UPDATE_TIME,
|
|
|
+ a.REMARK,
|
|
|
+ b.hl_obj_id,
|
|
|
+ b.OBJ_ID,
|
|
|
+ b.OBJ_NAME
|
|
|
+ from hl_class a
|
|
|
+ left JOIN (SELECT a.*, b.OBJ_NAME, b.OBJ_TYPE
|
|
|
+ FROM hl_obj a,
|
|
|
+ biz_obj b
|
|
|
+ WHERE a.obj_id = b.obj_id) b ON a.hl_class_id = b.hl_class_id and a.obj_type=b.obj_type) t
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectHlClassList" parameterType="HlClass" resultMap="HlClassResult">
|
|
|
<include refid="selectHlClassVo"/>
|
|
|
<where>
|
|
|
- <if test="modelId != null ">
|
|
|
- and MODEL_ID = #{modelId}
|
|
|
- </if>
|
|
|
- <if test="objType != null and objType != ''">
|
|
|
- and OBJ_TYPE = #{objType}
|
|
|
- </if>
|
|
|
- <if test="scoreType != null and scoreType != ''">
|
|
|
- and SCORE_TYPE = #{scoreType}
|
|
|
- </if>
|
|
|
- <if test="hlScore != null and hlScore != ''">
|
|
|
- and HL_SCORE = #{hlScore}
|
|
|
- </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>
|
|
|
+ <if test="modelId != null ">
|
|
|
+ and MODEL_ID = #{modelId}
|
|
|
+ </if>
|
|
|
+ <if test="objType != null and objType != ''">
|
|
|
+ and OBJ_TYPE = #{objType}
|
|
|
+ </if>
|
|
|
+ <if test="scoreType != null and scoreType != ''">
|
|
|
+ and SCORE_TYPE = #{scoreType}
|
|
|
+ </if>
|
|
|
+ <if test="hlScore != null and hlScore != ''">
|
|
|
+ and HL_SCORE = #{hlScore}
|
|
|
+ </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="selectHlClassByHlClassId" parameterType="Long"
|
|
|
resultMap="HlClassResult">
|
|
|
- <include refid="selectHlClassVo"/>
|
|
|
- where HL_CLASS_ID = #{hlClassId}
|
|
|
+ <include refid="selectHlClassVo"/>
|
|
|
+ where HL_CLASS_ID = #{hlClassId}
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertHlClass" parameterType="HlClass" useGeneratedKeys="true"
|
|
|
keyProperty="hlClassId">
|
|
|
insert into hl_class
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="modelId != null">MODEL_ID,
|
|
|
- </if>
|
|
|
- <if test="objType != null">OBJ_TYPE,
|
|
|
- </if>
|
|
|
- <if test="scoreType != null">SCORE_TYPE,
|
|
|
- </if>
|
|
|
- <if test="hlScore != null">HL_SCORE,
|
|
|
- </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>
|
|
|
+ <if test="modelId != null">MODEL_ID,
|
|
|
+ </if>
|
|
|
+ <if test="objType != null">OBJ_TYPE,
|
|
|
+ </if>
|
|
|
+ <if test="scoreType != null">SCORE_TYPE,
|
|
|
+ </if>
|
|
|
+ <if test="hlScore != null">HL_SCORE,
|
|
|
+ </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="objType != null">#{objType},
|
|
|
- </if>
|
|
|
- <if test="scoreType != null">#{scoreType},
|
|
|
- </if>
|
|
|
- <if test="hlScore != null">#{hlScore},
|
|
|
- </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>
|
|
|
+ <if test="modelId != null">#{modelId},
|
|
|
+ </if>
|
|
|
+ <if test="objType != null">#{objType},
|
|
|
+ </if>
|
|
|
+ <if test="scoreType != null">#{scoreType},
|
|
|
+ </if>
|
|
|
+ <if test="hlScore != null">#{hlScore},
|
|
|
+ </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="updateHlClass" parameterType="HlClass">
|
|
|
update hl_class
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
- <if test="modelId != null">MODEL_ID =
|
|
|
- #{modelId},
|
|
|
- </if>
|
|
|
- <if test="objType != null">OBJ_TYPE =
|
|
|
- #{objType},
|
|
|
- </if>
|
|
|
- <if test="scoreType != null">SCORE_TYPE =
|
|
|
- #{scoreType},
|
|
|
- </if>
|
|
|
- <if test="hlScore != null">HL_SCORE =
|
|
|
- #{hlScore},
|
|
|
- </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>
|
|
|
+ <if test="modelId != null">MODEL_ID =
|
|
|
+ #{modelId},
|
|
|
+ </if>
|
|
|
+ <if test="objType != null">OBJ_TYPE =
|
|
|
+ #{objType},
|
|
|
+ </if>
|
|
|
+ <if test="scoreType != null">SCORE_TYPE =
|
|
|
+ #{scoreType},
|
|
|
+ </if>
|
|
|
+ <if test="hlScore != null">HL_SCORE =
|
|
|
+ #{hlScore},
|
|
|
+ </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_CLASS_ID = #{hlClassId}
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteHlClassByHlClassId" parameterType="Long">
|
|
|
delete
|
|
|
- from hl_class where HL_CLASS_ID = #{hlClassId}
|
|
|
+ from hl_class
|
|
|
+ where HL_CLASS_ID = #{hlClassId}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteHlClassByHlClassIds" parameterType="String">
|