BmApplicationMapper.xml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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="maxToken" column="max_token" />
  19. <result property="paramDesc" column="param_desc"/>
  20. <result property="remark" column="remark" />
  21. <result property="createBy" column="create_by" />
  22. <result property="createTime" column="create_time" />
  23. <result property="updateBy" column="update_by" />
  24. <result property="updateTime" column="update_time" />
  25. <result property="knowledgeInfo" column="knowledge_info" />
  26. </resultMap>
  27. <sql id="selectSql">
  28. select appId, name, description, prompt, top_p, temperature, knowledge_ids, slice_count,model,icon_color,icon_type,
  29. max_token, create_by, create_time, remark, knowledge_info
  30. from bm_application
  31. </sql>
  32. <select id="selectApplicationList" parameterType="BmApplication" resultMap="BmApplicationResult">
  33. <include refid="selectSql"/>
  34. <where>
  35. <if test="appId != null and appId != ''">
  36. AND appId = #{appId}
  37. </if>
  38. </where>
  39. order by create_time asc
  40. </select>
  41. <select id="selectTargetApplication" parameterType="BmApplication" resultMap="BmApplicationResult">
  42. <include refid="selectSql"/>
  43. where appId = #{appId}
  44. </select>
  45. <insert id="insertApplication" parameterType="BmApplication">
  46. insert into bm_application(
  47. <if test="appId != null">appId,</if>
  48. <if test="name != null and name != ''">name,</if>
  49. <if test="desc != null and desc != ''">description,</if>
  50. <if test="prompt != null and prompt != ''">prompt,</if>
  51. <if test="topP != null and topP != ''">top_p,</if>
  52. <if test="temperature != null and temperature != ''">temperature,</if>
  53. <if test="knowledgeIds != null and knowledgeIds != ''">knowledge_ids,</if>
  54. <if test="sliceCount != null">slice_count,</if>
  55. <if test="model != null and model != ''">model,</if>
  56. <if test="iconColor != null and iconColor != ''">icon_color,</if>
  57. <if test="iconType != null and iconType != ''">icon_type,</if>
  58. <if test="remark != null and remark != ''">remark,</if>
  59. <if test="createBy != null and createBy != ''">create_by,</if>
  60. <if test="knowledgeInfo != null and knowledgeInfo != ''">knowledge_info,</if>
  61. <if test="maxToken != null and maxToken != ''">max_token,</if>
  62. create_time
  63. )values(
  64. <if test="appId != null">#{appId},</if>
  65. <if test="name != null and name != ''">#{name},</if>
  66. <if test="desc != null and desc != ''">#{desc},</if>
  67. <if test="prompt != null and prompt != ''">#{prompt},</if>
  68. <if test="topP != null and topP != ''">#{topP},</if>
  69. <if test="temperature != null and temperature != ''">#{temperature},</if>
  70. <if test="knowledgeIds != null and knowledgeIds != ''">#{knowledgeIds},</if>
  71. <if test="sliceCount != null">#{sliceCount},</if>
  72. <if test="model != null and model != ''">#{model},</if>
  73. <if test="iconColor != null and iconColor != ''">#{iconColor},</if>
  74. <if test="iconType != null and iconType != ''">#{iconType},</if>
  75. <if test="remark != null and remark != ''">#{remark},</if>
  76. <if test="createBy != null and createBy != ''">#{createBy},</if>
  77. <if test="knowledgeInfo != null and knowledgeInfo != ''">#{knowledgeInfo},</if>
  78. <if test="maxToken != null and maxToken != ''">#{maxToken},</if>
  79. sysdate()
  80. )
  81. </insert>
  82. <update id="updateApplication" parameterType="BmApplication">
  83. update bm_application
  84. <set>
  85. <if test="name != null and name != ''">name = #{name},</if>
  86. <if test="desc != null and desc != ''">description = #{desc},</if>
  87. <if test="prompt != null and prompt != ''">prompt = #{prompt},</if>
  88. <if test="topP != null and topP != ''">top_p = #{topP},</if>
  89. <if test="temperature != null and temperature != ''">temperature = #{temperature},</if>
  90. <if test="knowledgeIds != null and knowledgeIds != ''">knowledge_ids = #{knowledgeIds},</if>
  91. <if test="sliceCount != null">slice_count = #{sliceCount},</if>
  92. <if test="model != null and model != ''">model = #{model},</if>
  93. <if test="iconColor != null and iconColor != ''">icon_color = #{iconColor},</if>
  94. <if test="iconType != null and iconType != ''">icon_type = #{iconType},</if>
  95. <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  96. <if test="remark != null">remark = #{remark},</if>
  97. <if test="knowledgeInfo != null and knowledgeInfo != ''">knowledge_info = #{knowledgeInfo},</if>
  98. <if test="maxToken != null">max_token = #{maxToken},</if>
  99. update_time = sysdate()
  100. </set>
  101. where appId = #{appId}
  102. </update>
  103. <delete id="delApplication" parameterType="String">
  104. delete from bm_application where appId = #{appId}
  105. </delete>
  106. </mapper>