<?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.iailab.module.model.matlab.dao.MlModelDao">
|
<resultMap type="com.iailab.module.model.matlab.dto.MlModelDTO" id="mlModelMap">
|
<result property="id" column="id"/>
|
<result property="modelName" column="model_name"/>
|
<result property="modelFileName" column="model_file_name"/>
|
<result property="modelFilePath" column="model_file_path"/>
|
<result property="modelType" column="model_type"/>
|
<result property="matlabPlatform" column="matlab_platform"/>
|
<result property="matlabVersion" column="matlab_version"/>
|
<result property="remark" column="remark"/>
|
<result property="creator" column="creator"/>
|
<result property="createDate" column="create_date"/>
|
<result property="updater" column="updater"/>
|
<result property="updateDate" column="update_date"/>
|
<collection property="modelMethods" ofType="com.iailab.module.model.matlab.dto.MlModelMethodDTO">
|
<id property="id" column="method_id"/>
|
<result property="className" column="class_name"/>
|
<result property="methodName" column="method_name"/>
|
<result property="dataLength" column="data_length"/>
|
<result property="outLength" column="out_length"/>
|
<collection property="methodSettings" ofType="com.iailab.module.model.matlab.dto.MlModelMethodSettingDTO">
|
<id property="id" column="setting_id"/>
|
<result property="name" column="setting_name"/>
|
<result property="settingKey" column="setting_key"/>
|
<result property="settingValue" column="setting_value"/>
|
<result property="valueType" column="value_type"/>
|
</collection>
|
</collection>
|
</resultMap>
|
|
<select id="list" resultMap="mlModelMap" parameterType="java.util.Map">
|
SELECT
|
a.*,
|
b.id method_id,
|
b.class_name,
|
b.method_name,
|
b.data_length,
|
b.out_length,
|
c.id setting_id,
|
c.NAME setting_name,
|
c.setting_key,
|
c.setting_value,
|
c.value_type
|
FROM
|
t_ml_model a
|
LEFT JOIN t_ml_model_method b ON a.id = b.ml_model_id
|
LEFT JOIN t_ml_model_method_setting c ON b.id = c.ml_model_method_id
|
<where>
|
<if test="params.modelType != null and params.modelType != ''">
|
AND a.model_type = #{params.modelType}
|
</if>
|
</where>
|
ORDER BY
|
a.create_date,
|
b.sort,
|
c.sort
|
</select>
|
<select id="get" resultMap="mlModelMap" parameterType="java.lang.String">
|
SELECT
|
a.*,
|
b.id method_id,
|
b.class_name,
|
b.method_name,
|
b.data_length,
|
b.out_length,
|
c.id setting_id,
|
c.NAME setting_name,
|
c.setting_key,
|
c.setting_value,
|
c.value_type
|
FROM
|
t_ml_model a
|
LEFT JOIN t_ml_model_method b ON a.id = b.ml_model_id
|
LEFT JOIN t_ml_model_method_setting c ON b.id = c.ml_model_method_id
|
WHERE a.id = #{id}
|
ORDER BY b.sort,c.sort
|
</select>
|
<select id="getProjectModelCount" resultType="java.lang.Integer" parameterType="java.lang.String">
|
SELECT
|
count(*)
|
FROM
|
t_ml_project_model
|
WHERE
|
project_id = #{projectId}
|
</select>
|
<select id="getProjectModel" resultMap="mlModelMap" parameterType="java.util.Map">
|
SELECT
|
t3.*,
|
t4.id method_id,
|
t4.class_name,
|
t4.method_name,
|
t4.data_length,
|
t4.out_length,
|
t5.id setting_id,
|
t5.setting_key,
|
t5.name setting_name,
|
t5.setting_value,
|
t5.value_type
|
FROM
|
(
|
SELECT
|
t2.*
|
FROM
|
t_ml_project_model t1
|
LEFT JOIN t_ml_model t2 ON t1.model_id = t2.id
|
WHERE
|
t1.project_id = #{params.projectId}
|
<if test="params.modelFileName != null and params.modelFileName != ''">
|
AND t2.model_file_name LIKE CONCAT('%',#{params.modelFileName},'%')
|
</if>
|
ORDER BY
|
t2.create_date DESC
|
LIMIT #{params.offset},#{params.pageSize}
|
) t3
|
LEFT JOIN t_ml_model_method t4 ON t3.id = t4.ml_model_id
|
LEFT JOIN t_ml_model_method_setting t5 ON t4.id = t5.ml_model_method_id
|
</select>
|
</mapper>
|