TProjectInvestigatePersonMapper.xml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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.TProjectInvestigatePersonMapper">
  6. <resultMap type="TProjectInvestigatePerson" id="TProjectInvestigatePersonResult">
  7. <result property="id" column="id" />
  8. <result property="projectInvestigateId" column="project_investigate_id" />
  9. <result property="investigatePerson" column="investigate_person" />
  10. <result property="investigatePersonId" column="investigate_person_id" />
  11. <result property="deptId" column="dept_id" />
  12. <result property="deptName" column="dept_name" />
  13. <result property="remark" column="remark" />
  14. <result property="createBy" column="create_by" />
  15. <result property="createTime" column="create_time" />
  16. <result property="updateBy" column="update_by" />
  17. <result property="updateTime" column="update_time" />
  18. </resultMap>
  19. <sql id="selectTProjectInvestigatePersonVo">
  20. select id, project_investigate_id, investigate_person, investigate_person_id, dept_id, dept_name, remark, create_by, create_time, update_by, update_time from t_project_investigate_person
  21. </sql>
  22. <select id="selectTProjectInvestigatePersonList" parameterType="TProjectInvestigatePerson" resultMap="TProjectInvestigatePersonResult">
  23. <include refid="selectTProjectInvestigatePersonVo"/>
  24. <where>
  25. <if test="projectInvestigateId != null and projectInvestigateId != ''"> and project_investigate_id = #{projectInvestigateId}</if>
  26. <if test="investigatePerson != null and investigatePerson != ''"> and investigate_person = #{investigatePerson}</if>
  27. <if test="investigatePersonId != null and investigatePersonId != ''"> and investigate_person_id = #{investigatePersonId}</if>
  28. <if test="deptId != null "> and dept_id = #{deptId}</if>
  29. <if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
  30. </where>
  31. </select>
  32. <select id="selectTProjectInvestigatePersonById" parameterType="String" resultMap="TProjectInvestigatePersonResult">
  33. <include refid="selectTProjectInvestigatePersonVo"/>
  34. where id = #{id}
  35. </select>
  36. <insert id="insertTProjectInvestigatePerson" parameterType="TProjectInvestigatePerson">
  37. insert into t_project_investigate_person
  38. <trim prefix="(" suffix=")" suffixOverrides=",">
  39. <if test="id != null">id,</if>
  40. <if test="projectInvestigateId != null">project_investigate_id,</if>
  41. <if test="investigatePerson != null">investigate_person,</if>
  42. <if test="investigatePersonId != null">investigate_person_id,</if>
  43. <if test="deptId != null">dept_id,</if>
  44. <if test="deptName != null">dept_name,</if>
  45. <if test="remark != null">remark,</if>
  46. <if test="createBy != null">create_by,</if>
  47. <if test="createTime != null">create_time,</if>
  48. <if test="updateBy != null">update_by,</if>
  49. <if test="updateTime != null">update_time,</if>
  50. </trim>
  51. <trim prefix="values (" suffix=")" suffixOverrides=",">
  52. <if test="id != null">#{id},</if>
  53. <if test="projectInvestigateId != null">#{projectInvestigateId},</if>
  54. <if test="investigatePerson != null">#{investigatePerson},</if>
  55. <if test="investigatePersonId != null">#{investigatePersonId},</if>
  56. <if test="deptId != null">#{deptId},</if>
  57. <if test="deptName != null">#{deptName},</if>
  58. <if test="remark != null">#{remark},</if>
  59. <if test="createBy != null">#{createBy},</if>
  60. <if test="createTime != null">#{createTime},</if>
  61. <if test="updateBy != null">#{updateBy},</if>
  62. <if test="updateTime != null">#{updateTime},</if>
  63. </trim>
  64. </insert>
  65. <update id="updateTProjectInvestigatePerson" parameterType="TProjectInvestigatePerson">
  66. update t_project_investigate_person
  67. <trim prefix="SET" suffixOverrides=",">
  68. <if test="projectInvestigateId != null">project_investigate_id = #{projectInvestigateId},</if>
  69. <if test="investigatePerson != null">investigate_person = #{investigatePerson},</if>
  70. <if test="investigatePersonId != null">investigate_person_id = #{investigatePersonId},</if>
  71. <if test="deptId != null">dept_id = #{deptId},</if>
  72. <if test="deptName != null">dept_name = #{deptName},</if>
  73. <if test="remark != null">remark = #{remark},</if>
  74. <if test="createBy != null">create_by = #{createBy},</if>
  75. <if test="createTime != null">create_time = #{createTime},</if>
  76. <if test="updateBy != null">update_by = #{updateBy},</if>
  77. <if test="updateTime != null">update_time = #{updateTime},</if>
  78. </trim>
  79. where id = #{id}
  80. </update>
  81. <delete id="deleteTProjectInvestigatePersonById" parameterType="String">
  82. delete from t_project_investigate_person where id = #{id}
  83. </delete>
  84. <delete id="deleteTProjectInvestigatePersonByIds" parameterType="String">
  85. delete from t_project_investigate_person where id in
  86. <foreach item="id" collection="array" open="(" separator="," close=")">
  87. #{id}
  88. </foreach>
  89. </delete>
  90. <select id="selectByProjectInvestigateId" parameterType="TProjectInvestigatePerson" resultMap="TProjectInvestigatePersonResult">
  91. <include refid="selectTProjectInvestigatePersonVo"/>
  92. where project_investigate_id = #{projectInvestigateId} and investigate_person_id = #{userId}
  93. </select>
  94. <select id="selectProjectInvestigateIdList" parameterType="TProjectInvestigatePerson" resultMap="TProjectInvestigatePersonResult">
  95. <include refid="selectTProjectInvestigatePersonVo"/>
  96. where project_investigate_id = #{projectInvestigateId}
  97. </select>
  98. </mapper>