KwsReportTemplateMapper.xml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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.sckw.slope.detection.dao.mysql.KwsReportTemplateMapper">
  4. <resultMap id="BaseResultMap" type="com.sckw.slope.detection.model.dos.mysql.KwsReportTemplate">
  5. <!--@mbg.generated-->
  6. <!--@Table kws_report_template-->
  7. <id column="id" jdbcType="BIGINT" property="id"/>
  8. <result column="name" jdbcType="VARCHAR" property="name"/>
  9. <result column="type" jdbcType="INTEGER" property="type"/>
  10. <result column="company_id" jdbcType="VARCHAR" property="companyId"/>
  11. <result column="project_id" jdbcType="VARCHAR" property="projectId"/>
  12. <result column="part_names" jdbcType="VARCHAR" property="partNames"/>
  13. <result column="tabulation_time" jdbcType="VARCHAR" property="tabulationTime"/>
  14. <result column="intergration_names" jdbcType="VARCHAR" property="intergrationNames"/>
  15. <result column="status" jdbcType="INTEGER" property="status"/>
  16. <result column="create_by" jdbcType="BIGINT" property="createBy"/>
  17. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  18. <result column="update_by" jdbcType="BIGINT" property="updateBy"/>
  19. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
  20. <result column="del_flag" jdbcType="INTEGER" property="delFlag"/>
  21. </resultMap>
  22. <sql id="Base_Column_List">
  23. <!--@mbg.generated-->
  24. id,
  25. `name`,
  26. `type`,
  27. part_names,
  28. project_id,
  29. intergration_names,
  30. `status`,
  31. create_by,
  32. create_time,
  33. update_by,
  34. update_time,
  35. del_flag,
  36. company_id,
  37. tabulation_time
  38. </sql>
  39. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  40. <!--@mbg.generated-->
  41. select
  42. <include refid="Base_Column_List"/>
  43. from kws_report_template
  44. where id = #{id,jdbcType=BIGINT}
  45. </select>
  46. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  47. <!--@mbg.generated-->
  48. delete
  49. from kws_report_template
  50. where id = #{id,jdbcType=BIGINT}
  51. </delete>
  52. <insert id="insertSelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsReportTemplate">
  53. <!--@mbg.generated-->
  54. insert into kws_report_template
  55. <trim prefix="(" suffix=")" suffixOverrides=",">
  56. <if test="id != null">
  57. id,
  58. </if>
  59. <if test="name != null">
  60. `name`,
  61. </if>
  62. <if test="type != null">
  63. `type`,
  64. </if>
  65. <if test="partNames != null">
  66. part_names,
  67. </if>
  68. <if test="intergrationNames != null">
  69. intergration_names,
  70. </if>
  71. <if test="status != null">
  72. `status`,
  73. </if>
  74. <if test="createBy != null">
  75. create_by,
  76. </if>
  77. <if test="createTime != null">
  78. create_time,
  79. </if>
  80. <if test="updateBy != null">
  81. update_by,
  82. </if>
  83. <if test="updateTime != null">
  84. update_time,
  85. </if>
  86. <if test="delFlag != null">
  87. del_flag,
  88. </if>
  89. </trim>
  90. <trim prefix="values (" suffix=")" suffixOverrides=",">
  91. <if test="id != null">
  92. #{id,jdbcType=BIGINT},
  93. </if>
  94. <if test="name != null">
  95. #{name,jdbcType=VARCHAR},
  96. </if>
  97. <if test="type != null">
  98. #{type,jdbcType=INTEGER},
  99. </if>
  100. <if test="partNames != null">
  101. #{partNames,jdbcType=VARCHAR},
  102. </if>
  103. <if test="intergrationNames != null">
  104. #{intergrationNames,jdbcType=VARCHAR},
  105. </if>
  106. <if test="status != null">
  107. #{status,jdbcType=TINYINT},
  108. </if>
  109. <if test="createBy != null">
  110. #{createBy,jdbcType=BIGINT},
  111. </if>
  112. <if test="createTime != null">
  113. #{createTime,jdbcType=TIMESTAMP},
  114. </if>
  115. <if test="updateBy != null">
  116. #{updateBy,jdbcType=BIGINT},
  117. </if>
  118. <if test="updateTime != null">
  119. #{updateTime,jdbcType=TIMESTAMP},
  120. </if>
  121. <if test="delFlag != null">
  122. #{delFlag,jdbcType=TINYINT},
  123. </if>
  124. </trim>
  125. </insert>
  126. <update id="updateByPrimaryKeySelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsReportTemplate">
  127. <!--@mbg.generated-->
  128. update kws_report_template
  129. <set>
  130. <if test="name != null">
  131. `name` = #{name,jdbcType=VARCHAR},
  132. </if>
  133. <if test="type != null">
  134. `type` = #{type,jdbcType=INTEGER},
  135. </if>
  136. <if test="partNames != null">
  137. part_names = #{partNames,jdbcType=VARCHAR},
  138. </if>
  139. <if test="intergrationNames != null">
  140. intergration_names = #{intergrationNames,jdbcType=VARCHAR},
  141. </if>
  142. <if test="status != null">
  143. `status` = #{status,jdbcType=TINYINT},
  144. </if>
  145. <if test="createBy != null">
  146. create_by = #{createBy,jdbcType=BIGINT},
  147. </if>
  148. <if test="createTime != null">
  149. create_time = #{createTime,jdbcType=TIMESTAMP},
  150. </if>
  151. <if test="updateBy != null">
  152. update_by = #{updateBy,jdbcType=BIGINT},
  153. </if>
  154. <if test="updateTime != null">
  155. update_time = #{updateTime,jdbcType=TIMESTAMP},
  156. </if>
  157. <if test="delFlag != null">
  158. del_flag = #{delFlag,jdbcType=TINYINT},
  159. </if>
  160. </set>
  161. where id = #{id,jdbcType=BIGINT}
  162. </update>
  163. <update id="updateByPrimaryKey" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsReportTemplate">
  164. <!--@mbg.generated-->
  165. update kws_report_template
  166. set `name` = #{name,jdbcType=VARCHAR},
  167. `type` = #{type,jdbcType=INTEGER},
  168. part_names = #{partNames,jdbcType=VARCHAR},
  169. intergration_names = #{intergrationNames,jdbcType=VARCHAR},
  170. `status` = #{status,jdbcType=TINYINT},
  171. create_by = #{createBy,jdbcType=BIGINT},
  172. create_time = #{createTime,jdbcType=TIMESTAMP},
  173. update_by = #{updateBy,jdbcType=BIGINT},
  174. update_time = #{updateTime,jdbcType=TIMESTAMP},
  175. del_flag = #{delFlag,jdbcType=TINYINT}
  176. where id = #{id,jdbcType=BIGINT}
  177. </update>
  178. <select id="selectListByReportNameAndProjectIdAndCompany"
  179. resultType="com.sckw.slope.detection.model.vo.ReportStatementVO">
  180. SELECT STATUS,
  181. `name` AS reportName,
  182. type AS reportType,
  183. project_id AS projectId,
  184. create_time AS createTime
  185. FROM kws_report_template
  186. WHERE del_flag = 0
  187. <if test="query.projectId != null and query.projectId != ''">
  188. and project_id = #{query.projectId}
  189. </if>
  190. <if test="companyId != null and companyId != ''">
  191. and company_id = #{companyId,jdbcType=VARCHAR}
  192. </if>
  193. </select>
  194. <select id="selectListByReportNameAndProjectId" resultType="com.sckw.slope.detection.model.vo.ReportStatementVO">
  195. </select>
  196. <select id="selectDataAndTemplate" resultType="com.sckw.slope.detection.model.vo.ReportDetailVO">
  197. SELECT a.id,
  198. a.part_names AS partNames,
  199. a.intergration_names AS intergrationNames,
  200. a.type AS type,
  201. a.`status` AS STATUS,
  202. b.NAME AS NAME,
  203. FROM kws_report_template a
  204. LEFT JOIN kws_report_data b ON a.id = b.template_id
  205. WHERE id = #{id,jdbcType=BIGINT}
  206. </select>
  207. </mapper>