BmApplicationMapper.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.takai.bigmodel.mapper.BmApplicationMapper">
  6. <resultMap type="BmApplication" id="BmApplicationResult">
  7. <id property="appId" column="appId" />
  8. <result property="name" column="name" />
  9. <result property="desc" column="description" />
  10. <result property="prompt" column="prompt" />
  11. <result property="topP" column="top_p" />
  12. <result property="temperature" column="temperature" />
  13. <result property="knowledgeIds" column="knowledge_ids" />
  14. <result property="sliceCount" column="slice_count" />
  15. <result property="model" column="model" />
  16. <result property="iconColor" column="icon_color" />
  17. <result property="iconType" column="icon_type" />
  18. <result property="remark" column="remark" />
  19. <result property="createBy" column="create_by" />
  20. <result property="createTime" column="create_time" />
  21. <result property="updateBy" column="update_by" />
  22. <result property="updateTime" column="update_time" />
  23. </resultMap>
  24. <sql id="selectSql">
  25. select appId, name, description, prompt, top_p, temperature, knowledge_ids, slice_count,model,icon_color,icon_type,create_by, create_time, remark
  26. from bm_application
  27. </sql>
  28. <select id="selectApplicationList" parameterType="BmApplication" resultMap="BmApplicationResult">
  29. <include refid="selectSql"/>
  30. <where>
  31. <if test="appId != null and appId != ''">
  32. AND appId = #{appId}
  33. </if>
  34. </where>
  35. order by create_time asc
  36. </select>
  37. <select id="selectTargetApplication" parameterType="BmApplication" resultMap="BmApplicationResult">
  38. <include refid="selectSql"/>
  39. where app_id = #{appId}
  40. </select>
  41. <insert id="insertApplication" parameterType="BmApplication">
  42. insert into bm_application(
  43. <if test="appId != null">appId,</if>
  44. <if test="name != null and name != ''">name,</if>
  45. <if test="desc != null and desc != ''">description,</if>
  46. <if test="prompt != null and prompt != ''">prompt,</if>
  47. <if test="topP != null and topP != ''">top_p,</if>
  48. <if test="temperature != null and temperature != ''">temperature,</if>
  49. <if test="knowledgeIds != null and knowledgeIds != ''">knowledge_ids,</if>
  50. <if test="sliceCount != null">slice_count,</if>
  51. <if test="model != null and model != ''">model,</if>
  52. <if test="iconColor != null and iconColor != ''">icon_color,</if>
  53. <if test="iconType != null and iconType != ''">icon_type,</if>
  54. <if test="remark != null and remark != ''">remark,</if>
  55. <if test="createBy != null and createBy != ''">create_by,</if>
  56. create_time
  57. )values(
  58. <if test="appId != null">#{appId},</if>
  59. <if test="name != null and name != ''">#{name},</if>
  60. <if test="desc != null and desc != ''">#{desc},</if>
  61. <if test="prompt != null and prompt != ''">#{prompt},</if>
  62. <if test="topP != null and topP != ''">#{topP},</if>
  63. <if test="temperature != null and temperature != ''">#{temperature},</if>
  64. <if test="knowledgeIds != null and knowledgeIds != ''">#{knowledgeIds},</if>
  65. <if test="sliceCount != null">#{sliceCount},</if>
  66. <if test="model != null and model != ''">#{model},</if>
  67. <if test="iconColor != null and iconColor != ''">#{iconColor},</if>
  68. <if test="iconType != null and iconType != ''">#{iconType},</if>
  69. <if test="remark != null and remark != ''">#{remark},</if>
  70. <if test="createBy != null and createBy != ''">#{createBy},</if>
  71. sysdate()
  72. )
  73. </insert>
  74. <update id="updateApplication" parameterType="BmApplication">
  75. update mh_sys_config
  76. <set>
  77. <if test="name != null and name != ''">name = #{name},</if>
  78. <if test="desc != null and desc != ''">description = #{desc},</if>
  79. <if test="prompt != null and prompt != ''">prompt = #{prompt},</if>
  80. <if test="topP != null and topP != ''">top_p = #{topP},</if>
  81. <if test="temperature != null and temperature != ''">temperature = #{temperature},</if>
  82. <if test="knowledgeIds != null and knowledgeIds != ''">knowledge_ids = #{knowledgeIds},</if>
  83. <if test="sliceCount != null">slice_count = #{sliceCount},</if>
  84. <if test="model != null and model != ''">model = #{model},</if>
  85. <if test="iconColor != null and iconColor != ''">icon_color = #{iconColor},</if>
  86. <if test="iconType != null and iconType != ''">icon_type = #{iconType},</if>
  87. <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  88. <if test="remark != null">remark = #{remark},</if>
  89. update_time = sysdate()
  90. </set>
  91. where appId = #{appId}
  92. </update>
  93. </mapper>