TProjectRecordMapper.xml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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.invest.mapper.TProjectRecordMapper">
  6. <resultMap type="TProjectRecord" id="TProjectRecordResult">
  7. <result property="id" column="id" />
  8. <result property="projectId" column="project_id" />
  9. <result property="contacts" column="contacts" />
  10. <result property="realityUpDate" column="reality_up_date" />
  11. <result property="upPerson" column="up_person" />
  12. <result property="upWay" column="up_way" />
  13. <result property="upContent" column="up_content" />
  14. <result property="mark" column="mark" />
  15. <result property="delFlag" column="del_flag" />
  16. <result property="createBy" column="create_by" />
  17. <result property="createTime" column="create_time" />
  18. <result property="updateBy" column="update_by" />
  19. <result property="updateTime" column="update_time" />
  20. <association property="tProjectPool" javaType="TProjectPool" resultMap="TProjectPoolResult" />
  21. </resultMap>
  22. <resultMap type="TProjectPool" id="TProjectPoolResult">
  23. <result property="projectName" column="project_name" />
  24. <result property="projectStage" column="project_stage" />
  25. <result property="projectState" column="project_state" />
  26. </resultMap>
  27. <sql id="selectTProjectRecordVo">
  28. select a.id, a.project_id, a.contacts, a.reality_up_date, a.up_person, a.up_way, a.up_content, a.mark, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time,
  29. b.project_name, b.project_stage, b.project_state
  30. from t_project_record a
  31. left join t_project_pool b ON a.project_id = b.id
  32. </sql>
  33. <select id="selectTProjectRecordList" parameterType="TProjectRecord" resultMap="TProjectRecordResult">
  34. <include refid="selectTProjectRecordVo"/>
  35. <where>
  36. a.del_flag = 0
  37. <if test="projectName != null and projectName != ''"> and b.project_name like concat('%', #{projectName}, '%')</if>
  38. <if test="projectId != null and projectId != ''"> and a.project_id = #{projectId}</if>
  39. <if test="contacts != null and contacts != ''"> and a.contacts = #{contacts}</if>
  40. <if test="realityUpDate != null "> and a.reality_up_date = #{realityUpDate}</if>
  41. <if test="upPerson != null and upPerson != ''"> and a.up_person = #{upPerson}</if>
  42. <if test="upWay != null and upWay != ''"> and a.up_way = #{upWay}</if>
  43. </where>
  44. </select>
  45. <select id="selectTProjectRecordById" parameterType="String" resultMap="TProjectRecordResult">
  46. <include refid="selectTProjectRecordVo"/>
  47. where a.id = #{id}
  48. </select>
  49. <insert id="insertTProjectRecord" parameterType="TProjectRecord">
  50. insert into t_project_record
  51. <trim prefix="(" suffix=")" suffixOverrides=",">
  52. <if test="id != null">id,</if>
  53. <if test="projectId != null">project_id,</if>
  54. <if test="contacts != null">contacts,</if>
  55. <if test="realityUpDate != null">reality_up_date,</if>
  56. <if test="upPerson != null">up_person,</if>
  57. <if test="upWay != null">up_way,</if>
  58. <if test="upContent != null">up_content,</if>
  59. <if test="mark != null">mark,</if>
  60. <if test="delFlag != null">del_flag,</if>
  61. <if test="createBy != null">create_by,</if>
  62. <if test="createTime != null">create_time,</if>
  63. <if test="updateBy != null">update_by,</if>
  64. <if test="updateTime != null">update_time,</if>
  65. </trim>
  66. <trim prefix="values (" suffix=")" suffixOverrides=",">
  67. <if test="id != null">#{id},</if>
  68. <if test="projectId != null">#{projectId},</if>
  69. <if test="contacts != null">#{contacts},</if>
  70. <if test="realityUpDate != null">#{realityUpDate},</if>
  71. <if test="upPerson != null">#{upPerson},</if>
  72. <if test="upWay != null">#{upWay},</if>
  73. <if test="upContent != null">#{upContent},</if>
  74. <if test="mark != null">#{mark},</if>
  75. <if test="delFlag != null">#{delFlag},</if>
  76. <if test="createBy != null">#{createBy},</if>
  77. <if test="createTime != null">#{createTime},</if>
  78. <if test="updateBy != null">#{updateBy},</if>
  79. <if test="updateTime != null">#{updateTime},</if>
  80. </trim>
  81. </insert>
  82. <update id="updateTProjectRecord" parameterType="TProjectRecord">
  83. update t_project_record
  84. <trim prefix="SET" suffixOverrides=",">
  85. <if test="projectId != null">project_id = #{projectId},</if>
  86. <if test="contacts != null">contacts = #{contacts},</if>
  87. <if test="realityUpDate != null">reality_up_date = #{realityUpDate},</if>
  88. <if test="upPerson != null">up_person = #{upPerson},</if>
  89. <if test="upWay != null">up_way = #{upWay},</if>
  90. <if test="upContent != null">up_content = #{upContent},</if>
  91. <if test="mark != null">mark = #{mark},</if>
  92. <if test="delFlag != null">del_flag = #{delFlag},</if>
  93. <if test="createBy != null">create_by = #{createBy},</if>
  94. <if test="createTime != null">create_time = #{createTime},</if>
  95. <if test="updateBy != null">update_by = #{updateBy},</if>
  96. <if test="updateTime != null">update_time = #{updateTime},</if>
  97. </trim>
  98. where id = #{id}
  99. </update>
  100. <delete id="deleteTProjectRecordById" parameterType="String">
  101. delete from t_project_record where id = #{id}
  102. </delete>
  103. <delete id="deleteTProjectRecordByIds" parameterType="String">
  104. delete from t_project_record where id in
  105. <foreach item="id" collection="array" open="(" separator="," close=")">
  106. #{id}
  107. </foreach>
  108. </delete>
  109. <update id="updateTProjectRecordByIds" parameterType="String">
  110. update t_project_record
  111. set del_flag = 1
  112. where id in
  113. <foreach item="id" collection="array" open="(" separator="," close=")">
  114. #{id}
  115. </foreach>
  116. </update>
  117. <select id="listProjectId" parameterType="String" resultMap="TProjectRecordResult">
  118. <include refid="selectTProjectRecordVo"/>
  119. where a.project_id = #{projectId} and a.del_flag = 0
  120. </select>
  121. </mapper>