123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- <?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.BizModelMapper">
- <resultMap type="BizModel" id="BizModelResult">
- <result property="modelId" column="MODEL_ID"/>
- <result property="modelCode" column="MODEL_CODE"/>
- <result property="modelName" column="MODEL_NAME"/>
- <result property="modelScore" column="MODEl_SCORE"/>
- <result property="modelType" column="MODEL_TYPE"/>
- <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>
- <sql id="selectBizModelVo">
- select MODEL_ID,
- MODEL_CODE,
- MODEL_NAME,
- MODEl_SCORE,
- MODEL_TYPE,
- CREATE_BY,
- CREATE_TIME,
- UPDATE_BY,
- UPDATE_TIME,
- REMARK
- from biz_model
- </sql>
- <select id="selectBizModelList" parameterType="BizModel" resultMap="BizModelResult">
- <include refid="selectBizModelVo"/>
- <where>
- <if test="modelCode != null and modelCode != ''">
- and MODEL_CODE = #{modelCode}
- </if>
- <if test="modelName != null and modelName != ''">
- and MODEL_NAME like concat('%', #{modelName}, '%')
- </if>
- <if test="modelScore != null ">
- and MODEl_SCORE = #{modelScore}
- </if>
- <if test="modelType != null and modelType != ''">
- and MODEL_TYPE = #{modelType}
- </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="selectBizModelByModelId" parameterType="Long"
- resultMap="BizModelResult">
- <include refid="selectBizModelVo"/>
- where MODEL_ID = #{modelId}
- </select>
- <select id="selectObjList" resultType="com.jjt.biz.domain.BizObj">
- select *
- from biz_obj
- where obj_id not in (select obj_id from biz_model_detail where model_id = #{modelId})
- </select>
- <select id="selectBizModelMetricsList" resultType="com.jjt.biz.domain.BizObjMetrics">
- SELECT *
- from biz_obj_metrics
- WHERE obj_id IN (SELECT obj_id FROM biz_model_detail WHERE model_id = #{modelId})
- </select>
- <insert id="insertBizModel" parameterType="BizModel" useGeneratedKeys="true"
- keyProperty="modelId">
- insert into biz_model
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="modelCode != null">MODEL_CODE,
- </if>
- <if test="modelName != null">MODEL_NAME,
- </if>
- <if test="modelScore != null">MODEl_SCORE,
- </if>
- <if test="modelType != null">MODEL_TYPE,
- </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="modelCode != null">#{modelCode},
- </if>
- <if test="modelName != null">#{modelName},
- </if>
- <if test="modelScore != null">#{modelScore},
- </if>
- <if test="modelType != null">#{modelType},
- </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="updateBizModel" parameterType="BizModel">
- update biz_model
- <trim prefix="SET" suffixOverrides=",">
- <if test="modelCode != null">MODEL_CODE =
- #{modelCode},
- </if>
- <if test="modelName != null">MODEL_NAME =
- #{modelName},
- </if>
- <if test="modelScore != null">MODEl_SCORE =
- #{modelScore},
- </if>
- <if test="modelType != null">MODEL_TYPE =
- #{modelType},
- </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 MODEL_ID = #{modelId}
- </update>
- <delete id="deleteBizModelByModelId" parameterType="Long">
- delete
- from biz_model
- where MODEL_ID = #{modelId}
- </delete>
- <delete id="deleteBizModelByModelIds" parameterType="String">
- delete from biz_model where MODEL_ID in
- <foreach item="modelId" collection="array" open="(" separator="," close=")">
- #{modelId}
- </foreach>
- </delete>
- </mapper>
|