BmConstructionEntryMapper.xml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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.ruoyi.system.mapper.project.BmConstructionEntryMapper">
  6. <resultMap type="BmConstructionEntry" id="BmConstructionEntryResult">
  7. <result property="id" column="id" />
  8. <result property="bmProjectId" column="bm_project_id" />
  9. <result property="createBy" column="create_by" />
  10. <result property="createTime" column="create_time" />
  11. <result property="updateBy" column="update_by" />
  12. <result property="updateTime" column="update_time" />
  13. <result property="isDel" column="is_del" />
  14. <result property="statisticsDate" column="statistics_date" />
  15. <result property="statisticsPhoto" column="statistics_photo" />
  16. </resultMap>
  17. <sql id="selectBmConstructionEntryVo">
  18. select id, bm_project_id, create_by, create_time, update_by, update_time, is_del, statistics_date, statistics_photo from bm_construction_entry
  19. </sql>
  20. <select id="selectBmConstructionEntryList" parameterType="BmConstructionEntry" resultMap="BmConstructionEntryResult">
  21. <include refid="selectBmConstructionEntryVo"/>
  22. <where>
  23. <if test="bmProjectId != null "> and bm_project_id = #{bmProjectId}</if>
  24. <if test="isDel != null "> and is_del = #{isDel}</if>
  25. <if test="statisticsDate != null "> and statistics_date = #{statisticsDate}</if>
  26. <if test="statisticsPhoto != null and statisticsPhoto != ''"> and statistics_photo = #{statisticsPhoto}</if>
  27. </where>
  28. </select>
  29. <select id="selectBmConstructionEntryById" parameterType="Long" resultMap="BmConstructionEntryResult">
  30. <include refid="selectBmConstructionEntryVo"/>
  31. where id = #{id}
  32. </select>
  33. <insert id="insertBmConstructionEntry" parameterType="BmConstructionEntry" useGeneratedKeys="true" keyProperty="id">
  34. insert into bm_construction_entry
  35. <trim prefix="(" suffix=")" suffixOverrides=",">
  36. <if test="bmProjectId != null">bm_project_id,</if>
  37. <if test="createBy != null">create_by,</if>
  38. <if test="createTime != null">create_time,</if>
  39. <if test="updateBy != null">update_by,</if>
  40. <if test="updateTime != null">update_time,</if>
  41. <if test="isDel != null">is_del,</if>
  42. <if test="statisticsDate != null">statistics_date,</if>
  43. <if test="statisticsPhoto != null">statistics_photo,</if>
  44. </trim>
  45. <trim prefix="values (" suffix=")" suffixOverrides=",">
  46. <if test="bmProjectId != null">#{bmProjectId},</if>
  47. <if test="createBy != null">#{createBy},</if>
  48. <if test="createTime != null">#{createTime},</if>
  49. <if test="updateBy != null">#{updateBy},</if>
  50. <if test="updateTime != null">#{updateTime},</if>
  51. <if test="isDel != null">#{isDel},</if>
  52. <if test="statisticsDate != null">#{statisticsDate},</if>
  53. <if test="statisticsPhoto != null">#{statisticsPhoto},</if>
  54. </trim>
  55. </insert>
  56. <update id="updateBmConstructionEntry" parameterType="BmConstructionEntry">
  57. update bm_construction_entry
  58. <trim prefix="SET" suffixOverrides=",">
  59. <if test="bmProjectId != null">bm_project_id = #{bmProjectId},</if>
  60. <if test="createBy != null">create_by = #{createBy},</if>
  61. <if test="createTime != null">create_time = #{createTime},</if>
  62. <if test="updateBy != null">update_by = #{updateBy},</if>
  63. <if test="updateTime != null">update_time = #{updateTime},</if>
  64. <if test="isDel != null">is_del = #{isDel},</if>
  65. <if test="statisticsDate != null">statistics_date = #{statisticsDate},</if>
  66. <if test="statisticsPhoto != null">statistics_photo = #{statisticsPhoto},</if>
  67. </trim>
  68. where id = #{id}
  69. </update>
  70. <delete id="deleteBmConstructionEntryById" parameterType="Long">
  71. delete from bm_construction_entry where id = #{id}
  72. </delete>
  73. <delete id="deleteBmConstructionEntryByIds" parameterType="String">
  74. delete from bm_construction_entry where id in
  75. <foreach item="id" collection="array" open="(" separator="," close=")">
  76. #{id}
  77. </foreach>
  78. </delete>
  79. </mapper>