PublicExamineMapper.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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.goafanti.common.dao.PublicExamineMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.PublicExamine">
  5. <id column="id" jdbcType="INTEGER" property="id" />
  6. <result column="prid" jdbcType="INTEGER" property="prid" />
  7. <result column="aid" jdbcType="VARCHAR" property="aid" />
  8. <result column="status" jdbcType="INTEGER" property="status" />
  9. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  10. <result column="aname" jdbcType="VARCHAR" property="aname" />
  11. </resultMap>
  12. <sql id="Base_Column_List">
  13. id, prid, aid, `status`, create_time, aname
  14. </sql>
  15. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  16. select
  17. <include refid="Base_Column_List" />
  18. from public_examine
  19. where id = #{id,jdbcType=INTEGER}
  20. </select>
  21. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  22. delete from public_examine
  23. where id = #{id,jdbcType=INTEGER}
  24. </delete>
  25. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicExamine" useGeneratedKeys="true">
  26. insert into public_examine (prid, aid, `status`,
  27. create_time, aname)
  28. values (#{prid,jdbcType=INTEGER}, #{aid,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
  29. #{createTime,jdbcType=TIMESTAMP}, #{aname,jdbcType=VARCHAR})
  30. </insert>
  31. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicExamine" useGeneratedKeys="true">
  32. insert into public_examine
  33. <trim prefix="(" suffix=")" suffixOverrides=",">
  34. <if test="prid != null">
  35. prid,
  36. </if>
  37. <if test="aid != null">
  38. aid,
  39. </if>
  40. <if test="status != null">
  41. `status`,
  42. </if>
  43. <if test="createTime != null">
  44. create_time,
  45. </if>
  46. <if test="aname != null">
  47. aname,
  48. </if>
  49. </trim>
  50. <trim prefix="values (" suffix=")" suffixOverrides=",">
  51. <if test="prid != null">
  52. #{prid,jdbcType=INTEGER},
  53. </if>
  54. <if test="aid != null">
  55. #{aid,jdbcType=VARCHAR},
  56. </if>
  57. <if test="status != null">
  58. #{status,jdbcType=INTEGER},
  59. </if>
  60. <if test="createTime != null">
  61. #{createTime,jdbcType=TIMESTAMP},
  62. </if>
  63. <if test="aname != null">
  64. #{aname,jdbcType=VARCHAR},
  65. </if>
  66. </trim>
  67. </insert>
  68. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PublicExamine">
  69. update public_examine
  70. <set>
  71. <if test="prid != null">
  72. prid = #{prid,jdbcType=INTEGER},
  73. </if>
  74. <if test="aid != null">
  75. aid = #{aid,jdbcType=VARCHAR},
  76. </if>
  77. <if test="status != null">
  78. `status` = #{status,jdbcType=INTEGER},
  79. </if>
  80. <if test="createTime != null">
  81. create_time = #{createTime,jdbcType=TIMESTAMP},
  82. </if>
  83. <if test="aname != null">
  84. aname = #{aname,jdbcType=VARCHAR},
  85. </if>
  86. </set>
  87. where id = #{id,jdbcType=INTEGER}
  88. </update>
  89. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.PublicExamine">
  90. update public_examine
  91. set prid = #{prid,jdbcType=INTEGER},
  92. aid = #{aid,jdbcType=VARCHAR},
  93. `status` = #{status,jdbcType=INTEGER},
  94. create_time = #{createTime,jdbcType=TIMESTAMP},
  95. aname = #{aname,jdbcType=VARCHAR}
  96. where id = #{id,jdbcType=INTEGER}
  97. </update>
  98. <update id="updatePrid">
  99. update public_examine
  100. set `status` = #{status,jdbcType=INTEGER}
  101. where prid = #{prid,jdbcType=INTEGER}
  102. <if test="aid != null">
  103. and aid = #{aid,jdbcType=VARCHAR}
  104. </if>
  105. </update>
  106. <update id="updateAidByAid">
  107. update public_examine a ,(select id,name from admin where id=#{aid})b
  108. set a.aid=b.id ,a.aname =b.name
  109. where a.aid = #{oldAid}
  110. </update>
  111. <select id="selectByPrid" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  112. select
  113. <include refid="Base_Column_List" />
  114. from public_examine
  115. where prid = #{id,jdbcType=INTEGER}
  116. </select>
  117. <select id="selectByIds" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  118. select
  119. <include refid="Base_Column_List" />
  120. from public_examine
  121. where prid in
  122. <foreach close=")" collection="ids" item="id" open="(" separator=",">
  123. #{id}
  124. </foreach>
  125. </select>
  126. <delete id="deletePrid">
  127. delete from public_examine
  128. where prid = #{id,jdbcType=INTEGER}
  129. </delete>
  130. </mapper>