BizInspectionMapper.xml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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.jjt.biz.mapper.BizInspectionMapper">
  6. <resultMap type="BizInspection" id="BizInspectionResult">
  7. <result property="inspectionId" column="INSPECTION_ID"/>
  8. <result property="modelId" column="MODEL_ID"/>
  9. <result property="inspectionTime" column="INSPECTION_TIME"/>
  10. <result property="modelScore" column="MODEL_SCORE"/>
  11. <result property="createBy" column="CREATE_BY"/>
  12. <result property="createTime" column="CREATE_TIME"/>
  13. <result property="updateBy" column="UPDATE_BY"/>
  14. <result property="updateTime" column="UPDATE_TIME"/>
  15. <result property="remark" column="REMARK"/>
  16. </resultMap>
  17. <sql id="selectBizInspectionVo">
  18. select INSPECTION_ID, MODEL_ID, INSPECTION_TIME, MODEL_SCORE, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, REMARK
  19. from biz_inspection
  20. </sql>
  21. <select id="selectBizInspectionList" parameterType="BizInspection" resultMap="BizInspectionResult">
  22. <include refid="selectBizInspectionVo"/>
  23. <where>
  24. <if test="modelId != null ">
  25. and MODEL_ID = #{modelId}
  26. </if>
  27. <if test="inspectionTime != null ">
  28. and INSPECTION_TIME = #{inspectionTime}
  29. </if>
  30. <if test="modelScore != null ">
  31. and MODEL_SCORE = #{modelScore}
  32. </if>
  33. <if test="createBy != null and createBy != ''">
  34. and CREATE_BY = #{createBy}
  35. </if>
  36. <if test="createTime != null ">
  37. and CREATE_TIME = #{createTime}
  38. </if>
  39. <if test="updateBy != null and updateBy != ''">
  40. and UPDATE_BY = #{updateBy}
  41. </if>
  42. <if test="updateTime != null ">
  43. and UPDATE_TIME = #{updateTime}
  44. </if>
  45. <if test="remark != null and remark != ''">
  46. and REMARK = #{remark}
  47. </if>
  48. </where>
  49. </select>
  50. <select id="selectBizInspectionByInspectionId" parameterType="Long"
  51. resultMap="BizInspectionResult">
  52. <include refid="selectBizInspectionVo"/>
  53. where INSPECTION_ID = #{inspectionId}
  54. </select>
  55. <insert id="insertBizInspection" parameterType="BizInspection" useGeneratedKeys="true"
  56. keyProperty="inspectionId">
  57. insert into biz_inspection
  58. <trim prefix="(" suffix=")" suffixOverrides=",">
  59. <if test="modelId != null">MODEL_ID,
  60. </if>
  61. <if test="inspectionTime != null">INSPECTION_TIME,
  62. </if>
  63. <if test="modelScore != null">MODEL_SCORE,
  64. </if>
  65. <if test="createBy != null">CREATE_BY,
  66. </if>
  67. <if test="createTime != null">CREATE_TIME,
  68. </if>
  69. <if test="updateBy != null">UPDATE_BY,
  70. </if>
  71. <if test="updateTime != null">UPDATE_TIME,
  72. </if>
  73. <if test="remark != null">REMARK,
  74. </if>
  75. </trim>
  76. <trim prefix="values (" suffix=")" suffixOverrides=",">
  77. <if test="modelId != null">#{modelId},
  78. </if>
  79. <if test="inspectionTime != null">#{inspectionTime},
  80. </if>
  81. <if test="modelScore != null">#{modelScore},
  82. </if>
  83. <if test="createBy != null">#{createBy},
  84. </if>
  85. <if test="createTime != null">#{createTime},
  86. </if>
  87. <if test="updateBy != null">#{updateBy},
  88. </if>
  89. <if test="updateTime != null">#{updateTime},
  90. </if>
  91. <if test="remark != null">#{remark},
  92. </if>
  93. </trim>
  94. </insert>
  95. <update id="updateBizInspection" parameterType="BizInspection">
  96. update biz_inspection
  97. <trim prefix="SET" suffixOverrides=",">
  98. <if test="modelId != null">MODEL_ID =
  99. #{modelId},
  100. </if>
  101. <if test="inspectionTime != null">INSPECTION_TIME =
  102. #{inspectionTime},
  103. </if>
  104. <if test="modelScore != null">MODEL_SCORE =
  105. #{modelScore},
  106. </if>
  107. <if test="createBy != null">CREATE_BY =
  108. #{createBy},
  109. </if>
  110. <if test="createTime != null">CREATE_TIME =
  111. #{createTime},
  112. </if>
  113. <if test="updateBy != null">UPDATE_BY =
  114. #{updateBy},
  115. </if>
  116. <if test="updateTime != null">UPDATE_TIME =
  117. #{updateTime},
  118. </if>
  119. <if test="remark != null">REMARK =
  120. #{remark},
  121. </if>
  122. </trim>
  123. where INSPECTION_ID = #{inspectionId}
  124. </update>
  125. <delete id="deleteBizInspectionByInspectionId" parameterType="Long">
  126. delete
  127. from biz_inspection where INSPECTION_ID = #{inspectionId}
  128. </delete>
  129. <delete id="deleteBizInspectionByInspectionIds" parameterType="String">
  130. delete from biz_inspection where INSPECTION_ID in
  131. <foreach item="inspectionId" collection="array" open="(" separator="," close=")">
  132. #{inspectionId}
  133. </foreach>
  134. </delete>
  135. </mapper>