XmProjectPersionMapper.xml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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.projectV2.XmProjectPersionMapper">
  6. <resultMap type="XmProjectPersion" id="XmProjectPersionResult">
  7. <result property="id" column="id" />
  8. <result property="xmId" column="xm_id" />
  9. <result property="xmbh" column="xmbh" />
  10. <result property="xmmc" column="xmmc" />
  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="isDel" column="is_del" />
  16. <result property="name" column="name" />
  17. <result property="address" column="address" />
  18. <result property="idcode" column="idcode" />
  19. <result property="phone" column="phone" />
  20. </resultMap>
  21. <sql id="selectXmProjectPersionVo">
  22. select id, xm_id, xmbh, xmmc, create_by, create_time, update_by, update_time, is_del, name, address, idcode, phone from xm_project_persion
  23. </sql>
  24. <select id="selectXmProjectPersionList" parameterType="XmProjectPersion" resultMap="XmProjectPersionResult">
  25. <include refid="selectXmProjectPersionVo"/>
  26. <where>
  27. <if test="xmId != null "> and xm_id = #{xmId}</if>
  28. <if test="xmbh != null and xmbh != ''"> and xmbh = #{xmbh}</if>
  29. <if test="isDel != null "> and is_del = #{isDel}</if>
  30. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  31. <if test="address != null and address != ''"> and address = #{address}</if>
  32. <if test="idcode != null and idcode != ''"> and idcode = #{idcode}</if>
  33. <if test="phone != null and phone != ''"> and phone = #{phone}</if>
  34. </where>
  35. order by create_time desc
  36. </select>
  37. <select id="selectXmProjectPersionById" parameterType="Long" resultMap="XmProjectPersionResult">
  38. <include refid="selectXmProjectPersionVo"/>
  39. where id = #{id}
  40. </select>
  41. <insert id="insertXmProjectPersion" parameterType="XmProjectPersion" useGeneratedKeys="true" keyProperty="id">
  42. insert into xm_project_persion
  43. <trim prefix="(" suffix=")" suffixOverrides=",">
  44. <if test="xmId != null">xm_id,</if>
  45. <if test="xmbh != null">xmbh,</if>
  46. <if test="xmmc != null">xmmc,</if>
  47. <if test="createBy != null">create_by,</if>
  48. <if test="createTime != null">create_time,</if>
  49. <if test="updateBy != null">update_by,</if>
  50. <if test="updateTime != null">update_time,</if>
  51. <if test="isDel != null">is_del,</if>
  52. <if test="name != null">name,</if>
  53. <if test="address != null">address,</if>
  54. <if test="idcode != null">idcode,</if>
  55. <if test="phone != null">phone,</if>
  56. </trim>
  57. <trim prefix="values (" suffix=")" suffixOverrides=",">
  58. <if test="xmId != null">#{xmId},</if>
  59. <if test="xmbh != null">#{xmbh},</if>
  60. <if test="xmmc != null">#{xmmc},</if>
  61. <if test="createBy != null">#{createBy},</if>
  62. <if test="createTime != null">#{createTime},</if>
  63. <if test="updateBy != null">#{updateBy},</if>
  64. <if test="updateTime != null">#{updateTime},</if>
  65. <if test="isDel != null">#{isDel},</if>
  66. <if test="name != null">#{name},</if>
  67. <if test="address != null">#{address},</if>
  68. <if test="idcode != null">#{idcode},</if>
  69. <if test="phone != null">#{phone},</if>
  70. </trim>
  71. </insert>
  72. <update id="updateXmProjectPersion" parameterType="XmProjectPersion">
  73. update xm_project_persion
  74. <trim prefix="SET" suffixOverrides=",">
  75. <if test="xmId != null">xm_id = #{xmId},</if>
  76. <if test="xmbh != null">xmbh = #{xmbh},</if>
  77. <if test="xmmc != null">xmmc = #{xmmc},</if>
  78. <if test="createBy != null">create_by = #{createBy},</if>
  79. <if test="createTime != null">create_time = #{createTime},</if>
  80. <if test="updateBy != null">update_by = #{updateBy},</if>
  81. <if test="updateTime != null">update_time = #{updateTime},</if>
  82. <if test="isDel != null">is_del = #{isDel},</if>
  83. <if test="name != null">name = #{name},</if>
  84. <if test="address != null">address = #{address},</if>
  85. <if test="idcode != null">idcode = #{idcode},</if>
  86. <if test="phone != null">phone = #{phone},</if>
  87. </trim>
  88. where id = #{id}
  89. </update>
  90. <update id="updateXmProjectPersionByXmbh">
  91. update xm_project_persion set xm_id = #{id}, xmmc=#{xmmc} where xmbh = #{xmbh}
  92. </update>
  93. <delete id="deleteXmProjectPersionById" parameterType="Long">
  94. delete from xm_project_persion where id = #{id}
  95. </delete>
  96. <delete id="deleteXmProjectPersionByIds" parameterType="String">
  97. delete from xm_project_persion where id in
  98. <foreach item="id" collection="array" open="(" separator="," close=")">
  99. #{id}
  100. </foreach>
  101. </delete>
  102. </mapper>