| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216 |
- <?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.hl.mapper.HlClassScoreMapper">
- <resultMap type="HlClassScore" id="HlClassScoreResult">
- <result property="scoreClassId" column="SCORE_CLASS_ID"/>
- <result property="hlScoreId" column="HL_SCORE_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="loseScore" column="LOSE_SCORE"/>
- <result property="score" column="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="selectHlClassScoreVo">
- select *
- from (SELECT A.SCORE_CLASS_ID,
- A.HL_SCORE_ID,
- A.MODEL_ID,
- A.OBJ_TYPE,
- A.SCORE_TYPE,
- A.HL_SCORE,
- A.LOSE_SCORE,
- A.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="selectHlClassScoreList" parameterType="HlClassScore" resultMap="HlClassScoreResult">
- <include refid="selectHlClassScoreVo"/>
- <where>
- <if test="hlScoreId != null ">
- and HL_SCORE_ID = #{hlScoreId}
- </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 HL_SCORE = #{hlScore}
- </if>
- <if test="loseScore != null ">
- and LOSE_SCORE = #{loseScore}
- </if>
- <if test="score != null ">
- and SCORE = #{score}
- </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="selectHlClassScoreByScoreClassId" parameterType="Long"
- resultMap="HlClassScoreResult">
- <include refid="selectHlClassScoreVo"/>
- where SCORE_CLASS_ID = #{scoreClassId}
- </select>
- <insert id="insertHlClassScore" parameterType="HlClassScore" useGeneratedKeys="true"
- keyProperty="scoreClassId">
- insert into hl_class_score
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="hlScoreId != null">HL_SCORE_ID,
- </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="loseScore != null">LOSE_SCORE,
- </if>
- <if test="score != null">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="hlScoreId != null">#{hlScoreId},
- </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="loseScore != null">#{loseScore},
- </if>
- <if test="score != null">#{score},
- </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="updateHlClassScore" parameterType="HlClassScore">
- update hl_class_score
- <trim prefix="SET" suffixOverrides=",">
- <if test="hlScoreId != null">HL_SCORE_ID =
- #{hlScoreId},
- </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="loseScore != null">LOSE_SCORE =
- #{loseScore},
- </if>
- <if test="score != null">SCORE =
- #{score},
- </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 SCORE_CLASS_ID = #{scoreClassId}
- </update>
- <delete id="deleteHlClassScoreByScoreClassId" parameterType="Long">
- delete
- from hl_class_score
- where SCORE_CLASS_ID = #{scoreClassId}
- </delete>
- <delete id="deleteHlClassScoreByScoreClassIds" parameterType="String">
- delete from hl_class_score where SCORE_CLASS_ID in
- <foreach item="scoreClassId" collection="array" open="(" separator="," close=")">
- #{scoreClassId}
- </foreach>
- </delete>
- </mapper>
|