<?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.fibo.ddp.common.dao.strategyx.aimodel.MachineLearningModelsMapper">
  <sql id="Base_Column_List">
    id, model_name, description, model_type, file_name, file_path, model_field, mapping_field, 
    status, creator, modifier, organ_id, create_time, update_time, result_field_en
  </sql>

  <select id="getModelsListByOrganId" resultType="com.fibo.ddp.common.model.strategyx.aimodel.MachineLearningModels">
    select
    <include refid="Base_Column_List" />
    from t_machine_learning_models
    where status = 1 and organ_id = #{organId,jdbcType=INTEGER}
    <if test="searchString != null and searchString !=''">
       and (model_name like CONCAT('%',TRIM('${searchString}'),'%' ) or description like CONCAT('%',TRIM('${searchString}'),'%' ))
    </if>
  </select>

  <select id="getAllModelList" resultType="com.fibo.ddp.common.model.strategyx.aimodel.MachineLearningModels">
    select
    <include refid="Base_Column_List" />
    from t_machine_learning_models
    where status = 1
  </select>

</mapper>