TProjectInvestigateMapper.xml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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.TProjectInvestigateMapper">
  6. <resultMap type="TProjectInvestigate" id="TProjectInvestigateResult">
  7. <result property="id" column="id" />
  8. <result property="investigateName" column="investigate_name" />
  9. <result property="investigateCode" column="investigate_code" />
  10. <result property="projectPoolId" column="project_pool_id" />
  11. <result property="investigatePerson" column="investigate_person" />
  12. <result property="investigatePersonId" column="investigate_person_id" />
  13. <result property="investigateCost" column="investigate_cost" />
  14. <result property="describe" column="describe_" />
  15. <result property="remark" column="remark" />
  16. <result property="delFlag" column="del_flag" />
  17. <result property="status" column="status" />
  18. <result property="createBy" column="create_by" />
  19. <result property="createTime" column="create_time" />
  20. <result property="updateBy" column="update_by" />
  21. <result property="updateTime" column="update_time" />
  22. </resultMap>
  23. <sql id="selectTProjectInvestigateVo">
  24. select id, investigate_name, investigate_code, project_pool_id, investigate_person, investigate_person_id, investigate_cost, describe_, remark, status, del_flag, create_by, create_time, update_by, update_time from t_project_investigate
  25. </sql>
  26. <select id="selectTProjectInvestigateList" parameterType="TProjectInvestigate" resultMap="TProjectInvestigateResult">
  27. <include refid="selectTProjectInvestigateVo"/>
  28. <where>
  29. del_flag = 0
  30. <if test="investigateName != null and investigateName != ''"> and investigate_name like concat('%', #{investigateName}, '%')</if>
  31. <if test="investigateCode != null and investigateCode != ''"> and investigate_code = #{investigateCode}</if>
  32. <if test="projectPoolId != null and projectPoolId != ''"> and project_pool_id = #{projectPoolId}</if>
  33. <if test="investigatePerson != null and investigatePerson != ''"> and investigate_person = #{investigatePerson}</if>
  34. <if test="investigateCost != null and investigateCost != ''"> and investigate_cost = #{investigateCost}</if>
  35. <if test="describe != null and describe != ''"> and describe = #{describe}</if>
  36. </where>
  37. </select>
  38. <select id="selectTProjectInvestigateById" parameterType="String" resultMap="TProjectInvestigateResult">
  39. <include refid="selectTProjectInvestigateVo"/>
  40. where id = #{id}
  41. </select>
  42. <insert id="insertTProjectInvestigate" parameterType="TProjectInvestigate">
  43. insert into t_project_investigate
  44. <trim prefix="(" suffix=")" suffixOverrides=",">
  45. <if test="id != null">id,</if>
  46. <if test="investigateName != null">investigate_name,</if>
  47. <if test="investigateCode != null">investigate_code,</if>
  48. <if test="projectPoolId != null">project_pool_id,</if>
  49. <if test="investigatePerson != null">investigate_person,</if>
  50. <if test="investigatePersonId != null">investigate_person_id,</if>
  51. <if test="investigateCost != null">investigate_cost,</if>
  52. <if test="describe != null">describe_,</if>
  53. <if test="remark != null">remark,</if>
  54. <if test="status != null">status,</if>
  55. <if test="delFlag != null">del_flag,</if>
  56. <if test="createBy != null">create_by,</if>
  57. <if test="createTime != null">create_time,</if>
  58. <if test="updateBy != null">update_by,</if>
  59. <if test="updateTime != null">update_time,</if>
  60. </trim>
  61. <trim prefix="values (" suffix=")" suffixOverrides=",">
  62. <if test="id != null">#{id},</if>
  63. <if test="investigateName != null">#{investigateName},</if>
  64. <if test="investigateCode != null">#{investigateCode},</if>
  65. <if test="projectPoolId != null">#{projectPoolId},</if>
  66. <if test="investigatePerson != null">#{investigatePerson},</if>
  67. <if test="investigatePersonId != null">#{investigatePersonId},</if>
  68. <if test="investigateCost != null">#{investigateCost},</if>
  69. <if test="describe != null">#{describe},</if>
  70. <if test="remark != null">#{remark},</if>
  71. <if test="status != null">#{status},</if>
  72. <if test="delFlag != null">#{delFlag},</if>
  73. <if test="createBy != null">#{createBy},</if>
  74. <if test="createTime != null">#{createTime},</if>
  75. <if test="updateBy != null">#{updateBy},</if>
  76. <if test="updateTime != null">#{updateTime},</if>
  77. </trim>
  78. </insert>
  79. <update id="updateTProjectInvestigate" parameterType="TProjectInvestigate">
  80. update t_project_investigate
  81. <trim prefix="SET" suffixOverrides=",">
  82. <if test="investigateName != null">investigate_name = #{investigateName},</if>
  83. <if test="investigateCode != null">investigate_code = #{investigateCode},</if>
  84. <if test="projectPoolId != null">project_pool_id = #{projectPoolId},</if>
  85. <if test="investigatePerson != null">investigate_person = #{investigatePerson},</if>
  86. <if test="investigatePersonId != null">investigate_person_id = #{investigatePersonId},</if>
  87. <if test="investigateCost != null">investigate_cost = #{investigateCost},</if>
  88. <if test="describe != null">describe_ = #{describe},</if>
  89. <if test="remark != null">remark = #{remark},</if>
  90. <if test="status != null">status = #{status},</if>
  91. <if test="delFlag != null">del_flag = #{delFlag},</if>
  92. <if test="createBy != null">create_by = #{createBy},</if>
  93. <if test="createTime != null">create_time = #{createTime},</if>
  94. <if test="updateBy != null">update_by = #{updateBy},</if>
  95. <if test="updateTime != null">update_time = #{updateTime},</if>
  96. </trim>
  97. where id = #{id}
  98. </update>
  99. <delete id="deleteTProjectInvestigateById" parameterType="String">
  100. delete from t_project_investigate where id = #{id}
  101. </delete>
  102. <delete id="deleteTProjectInvestigateByIds" parameterType="String">
  103. delete from t_project_investigate where id in
  104. <foreach item="id" collection="array" open="(" separator="," close=")">
  105. #{id}
  106. </foreach>
  107. </delete>
  108. <update id="updateTProjectInvestigateByIds" parameterType="String">
  109. update t_project_investigate
  110. set del_flag = 1
  111. where id in
  112. <foreach item="id" collection="array" open="(" separator="," close=")">
  113. #{id}
  114. </foreach>
  115. </update>
  116. <select id="listProjectPoolId" parameterType="String" resultMap="TProjectInvestigateResult">
  117. <include refid="selectTProjectInvestigateVo"/>
  118. where project_pool_id = #{projectPoolId} and del_flag = 0
  119. </select>
  120. <select id="listProjectPoolIdNew" parameterType="String" resultMap="TProjectInvestigateResult">
  121. <include refid="selectTProjectInvestigateVo"/>
  122. where project_pool_id = #{projectPoolId} and del_flag = 0
  123. ORDER BY create_time DESC LIMIT 1
  124. </select>
  125. <update id="editStatus" parameterType="String">
  126. update t_project_investigate
  127. set status = 1
  128. where id = #{id}
  129. </update>
  130. </mapper>