BmProjectPersionMapper.xml 4.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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.BmProjectPersionMapper">
  6. <resultMap type="BmProjectPersion" id="BmProjectPersionResult">
  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="name" column="name" />
  15. <result property="address" column="address" />
  16. <result property="idCode" column="idcode" />
  17. <result property="phone" column="phone" />
  18. </resultMap>
  19. <sql id="selectBmProjectPersionVo">
  20. select id, bm_project_id, create_by, create_time, update_by, update_time, is_del, name, address, idcode, phone from bm_project_persion
  21. </sql>
  22. <select id="selectBmProjectPersionList" parameterType="BmProjectPersion" resultMap="BmProjectPersionResult">
  23. <include refid="selectBmProjectPersionVo"/>
  24. <where>
  25. <if test="bmProjectId != null "> and bm_project_id = #{bmProjectId}</if>
  26. <if test="isDel != null "> and is_del = #{isDel}</if>
  27. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  28. <if test="address != null and address != ''"> and address = #{address}</if>
  29. <if test="idCode != null and idCode != ''"> and idcode = #{idCode}</if>
  30. <if test="phone != null and phone != ''"> and phone = #{phone}</if>
  31. </where>
  32. </select>
  33. <select id="selectBmProjectPersionById" parameterType="Long" resultMap="BmProjectPersionResult">
  34. <include refid="selectBmProjectPersionVo"/>
  35. where id = #{id}
  36. </select>
  37. <insert id="insertBmProjectPersion" parameterType="BmProjectPersion">
  38. insert into bm_project_persion
  39. <trim prefix="(" suffix=")" suffixOverrides=",">
  40. <if test="bmProjectId != null">bm_project_id,</if>
  41. <if test="createBy != null">create_by,</if>
  42. <if test="createTime != null">create_time,</if>
  43. <if test="updateBy != null">update_by,</if>
  44. <if test="updateTime != null">update_time,</if>
  45. <if test="isDel != null">is_del,</if>
  46. <if test="name != null">name,</if>
  47. <if test="address != null">address,</if>
  48. <if test="idCode != null">idcode,</if>
  49. <if test="phone != null">phone,</if>
  50. </trim>
  51. <trim prefix="values (" suffix=")" suffixOverrides=",">
  52. <if test="bmProjectId != null">#{bmProjectId},</if>
  53. <if test="createBy != null">#{createBy},</if>
  54. <if test="createTime != null">#{createTime},</if>
  55. <if test="updateBy != null">#{updateBy},</if>
  56. <if test="updateTime != null">#{updateTime},</if>
  57. <if test="isDel != null">#{isDel},</if>
  58. <if test="name != null">#{name},</if>
  59. <if test="address != null">#{address},</if>
  60. <if test="idCode != null">#{idCode},</if>
  61. <if test="phone != null">#{phone},</if>
  62. </trim>
  63. </insert>
  64. <update id="updateBmProjectPersion" parameterType="BmProjectPersion">
  65. update bm_project_persion
  66. <trim prefix="SET" suffixOverrides=",">
  67. <if test="bmProjectId != null">bm_project_id = #{bmProjectId},</if>
  68. <if test="createBy != null">create_by = #{createBy},</if>
  69. <if test="createTime != null">create_time = #{createTime},</if>
  70. <if test="updateBy != null">update_by = #{updateBy},</if>
  71. <if test="updateTime != null">update_time = #{updateTime},</if>
  72. <if test="isDel != null">is_del = #{isDel},</if>
  73. <if test="name != null">name = #{name},</if>
  74. <if test="address != null">address = #{address},</if>
  75. <if test="idCode != null">idcode = #{idCode},</if>
  76. <if test="phone != null">phone = #{phone},</if>
  77. </trim>
  78. where id = #{id}
  79. </update>
  80. <delete id="deleteBmProjectPersionById" parameterType="Long">
  81. delete from bm_project_persion where id = #{id}
  82. </delete>
  83. <delete id="deleteBmProjectPersionByIds" parameterType="String">
  84. delete from bm_project_persion where id in
  85. <foreach item="id" collection="array" open="(" separator="," close=")">
  86. #{id}
  87. </foreach>
  88. </delete>
  89. </mapper>