ProjectStaffMapper.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.ruoyi.project.mapper.ProjectStaffMapper">
  4. <resultMap id="BaseResultMap" type="com.ruoyi.project.domain.ProjectStaff">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="pid" jdbcType="BIGINT" property="pid" />
  7. <result column="aid" jdbcType="BIGINT" property="aid" />
  8. <result column="name" jdbcType="VARCHAR" property="name" />
  9. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  10. <result column="remark" jdbcType="VARCHAR" property="remark" />
  11. </resultMap>
  12. <sql id="Base_Column_List">
  13. id, pid, aid, `name`, create_time, remark
  14. </sql>
  15. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  16. select
  17. <include refid="Base_Column_List" />
  18. from project_staff
  19. where id = #{id,jdbcType=BIGINT}
  20. </select>
  21. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  22. delete from project_staff
  23. where id = #{id,jdbcType=BIGINT}
  24. </delete>
  25. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.ruoyi.project.domain.ProjectStaff" useGeneratedKeys="true">
  26. insert into project_staff (pid, aid, `name`,
  27. create_time, remark)
  28. values (#{pid,jdbcType=BIGINT}, #{aid,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
  29. #{createTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR})
  30. </insert>
  31. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.ruoyi.project.domain.ProjectStaff" useGeneratedKeys="true">
  32. insert into project_staff
  33. <trim prefix="(" suffix=")" suffixOverrides=",">
  34. <if test="pid != null">
  35. pid,
  36. </if>
  37. <if test="aid != null">
  38. aid,
  39. </if>
  40. <if test="name != null">
  41. `name`,
  42. </if>
  43. <if test="createTime != null">
  44. create_time,
  45. </if>
  46. <if test="remark != null">
  47. remark,
  48. </if>
  49. </trim>
  50. <trim prefix="values (" suffix=")" suffixOverrides=",">
  51. <if test="pid != null">
  52. #{pid,jdbcType=BIGINT},
  53. </if>
  54. <if test="aid != null">
  55. #{aid,jdbcType=BIGINT},
  56. </if>
  57. <if test="name != null">
  58. #{name,jdbcType=VARCHAR},
  59. </if>
  60. <if test="createTime != null">
  61. #{createTime,jdbcType=TIMESTAMP},
  62. </if>
  63. <if test="remark != null">
  64. #{remark,jdbcType=VARCHAR},
  65. </if>
  66. </trim>
  67. </insert>
  68. <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.project.domain.ProjectStaff">
  69. update project_staff
  70. <set>
  71. <if test="pid != null">
  72. pid = #{pid,jdbcType=BIGINT},
  73. </if>
  74. <if test="aid != null">
  75. aid = #{aid,jdbcType=BIGINT},
  76. </if>
  77. <if test="name != null">
  78. `name` = #{name,jdbcType=VARCHAR},
  79. </if>
  80. <if test="createTime != null">
  81. create_time = #{createTime,jdbcType=TIMESTAMP},
  82. </if>
  83. <if test="remark != null">
  84. remark = #{remark,jdbcType=VARCHAR},
  85. </if>
  86. </set>
  87. where id = #{id,jdbcType=BIGINT}
  88. </update>
  89. <update id="updateByPrimaryKey" parameterType="com.ruoyi.project.domain.ProjectStaff">
  90. update project_staff
  91. set pid = #{pid,jdbcType=BIGINT},
  92. aid = #{aid,jdbcType=BIGINT},
  93. `name` = #{name,jdbcType=VARCHAR},
  94. create_time = #{createTime,jdbcType=TIMESTAMP},
  95. remark = #{remark,jdbcType=VARCHAR}
  96. where id = #{id,jdbcType=BIGINT}
  97. </update>
  98. <delete id="deleteBypid">
  99. delete from project_staff
  100. where pid = #{pid}
  101. </delete>
  102. <select id="selectByPid" parameterType="java.lang.Long" resultMap="BaseResultMap">
  103. select
  104. <include refid="Base_Column_List" />
  105. from project_staff
  106. where pid = #{pid}
  107. </select>
  108. </mapper>