AlgorithmExpandMapper.xml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.css.simulation.resource.common.infra.mysql.mapper.AlgorithmExpandMapper">
  4. <insert id="insert">
  5. insert into algorithm_expand(id, algorithm_id, algorithm_name, description, algorithm_type, algorithm_version,
  6. team, topic, status)
  7. value (#{id}, #{algorithmId}, #{algorithmName}, #{description}, #{algorithmType}, #{algorithmVersion},
  8. #{team}, #{topic}, #{status})
  9. </insert>
  10. <update id="update">
  11. update algorithm_expand
  12. set algorithm_name = #{algorithmName},
  13. description = #{description},
  14. algorithm_type = #{algorithmType},
  15. algorithm_version = #{algorithmVersion},
  16. team = #{team},
  17. topic = #{topic},
  18. status = #{status}
  19. where algorithm_id = #{algorithmId}
  20. </update>
  21. <select id="select"
  22. resultType="com.css.simulation.resource.common.infra.mysql.entity.AlgorithmExpandEntity">
  23. select id, algorithm_id, algorithm_name, description, algorithm_type, status
  24. from algorithm_expand
  25. where 1=1
  26. <if test="algorithmIds != null">
  27. and algorithm_id in
  28. <foreach item='item' collection='algorithmIds' separator=',' open='(' close=')'>
  29. #{item}
  30. </foreach>
  31. </if>
  32. <if test="algorithmId != null and algorithmId != ''">
  33. and algorithm_id = #{algorithmId}
  34. </if>
  35. </select>
  36. <select id="selectAlgorithmIds" resultType="java.lang.String">
  37. select algorithm_id
  38. from algorithm_expand
  39. where algorithm_id in
  40. <foreach item='item' collection='algorithmIds' separator=',' open='(' close=')'>
  41. #{item}
  42. </foreach>
  43. </select>
  44. </mapper>