PcLabelPostMapper.xml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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.hz.employmentsite.mapper.PcLabelPostMapper">
  4. <resultMap id="BaseResultMap" type="com.hz.employmentsite.model.PcLabelPost">
  5. <result column="LabelID" jdbcType="VARCHAR" property="labelID" />
  6. <result column="PostID" jdbcType="VARCHAR" property="postID" />
  7. </resultMap>
  8. <sql id="Example_Where_Clause">
  9. <where>
  10. <foreach collection="oredCriteria" item="criteria" separator="or">
  11. <if test="criteria.valid">
  12. <trim prefix="(" prefixOverrides="and" suffix=")">
  13. <foreach collection="criteria.criteria" item="criterion">
  14. <choose>
  15. <when test="criterion.noValue">
  16. and ${criterion.condition}
  17. </when>
  18. <when test="criterion.singleValue">
  19. and ${criterion.condition} #{criterion.value}
  20. </when>
  21. <when test="criterion.betweenValue">
  22. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  23. </when>
  24. <when test="criterion.listValue">
  25. and ${criterion.condition}
  26. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  27. #{listItem}
  28. </foreach>
  29. </when>
  30. </choose>
  31. </foreach>
  32. </trim>
  33. </if>
  34. </foreach>
  35. </where>
  36. </sql>
  37. <sql id="Update_By_Example_Where_Clause">
  38. <where>
  39. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  40. <if test="criteria.valid">
  41. <trim prefix="(" prefixOverrides="and" suffix=")">
  42. <foreach collection="criteria.criteria" item="criterion">
  43. <choose>
  44. <when test="criterion.noValue">
  45. and ${criterion.condition}
  46. </when>
  47. <when test="criterion.singleValue">
  48. and ${criterion.condition} #{criterion.value}
  49. </when>
  50. <when test="criterion.betweenValue">
  51. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  52. </when>
  53. <when test="criterion.listValue">
  54. and ${criterion.condition}
  55. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  56. #{listItem}
  57. </foreach>
  58. </when>
  59. </choose>
  60. </foreach>
  61. </trim>
  62. </if>
  63. </foreach>
  64. </where>
  65. </sql>
  66. <sql id="Base_Column_List">
  67. LabelID, PostID
  68. </sql>
  69. <select id="selectByExample" parameterType="com.hz.employmentsite.model.PcLabelPostExample" resultMap="BaseResultMap">
  70. select
  71. <if test="distinct">
  72. distinct
  73. </if>
  74. <include refid="Base_Column_List" />
  75. from pc_label_post
  76. <if test="_parameter != null">
  77. <include refid="Example_Where_Clause" />
  78. </if>
  79. <if test="orderByClause != null">
  80. order by ${orderByClause}
  81. </if>
  82. </select>
  83. <delete id="deleteByExample" parameterType="com.hz.employmentsite.model.PcLabelPostExample">
  84. delete from pc_label_post
  85. <if test="_parameter != null">
  86. <include refid="Example_Where_Clause" />
  87. </if>
  88. </delete>
  89. <insert id="insert" parameterType="com.hz.employmentsite.model.PcLabelPost">
  90. insert into pc_label_post (LabelID, PostID)
  91. values (#{labelID,jdbcType=VARCHAR}, #{postID,jdbcType=VARCHAR})
  92. </insert>
  93. <insert id="insertSelective" parameterType="com.hz.employmentsite.model.PcLabelPost">
  94. insert into pc_label_post
  95. <trim prefix="(" suffix=")" suffixOverrides=",">
  96. <if test="labelID != null">
  97. LabelID,
  98. </if>
  99. <if test="postID != null">
  100. PostID,
  101. </if>
  102. </trim>
  103. <trim prefix="values (" suffix=")" suffixOverrides=",">
  104. <if test="labelID != null">
  105. #{labelID,jdbcType=VARCHAR},
  106. </if>
  107. <if test="postID != null">
  108. #{postID,jdbcType=VARCHAR},
  109. </if>
  110. </trim>
  111. </insert>
  112. <select id="countByExample" parameterType="com.hz.employmentsite.model.PcLabelPostExample" resultType="java.lang.Long">
  113. select count(*) from pc_label_post
  114. <if test="_parameter != null">
  115. <include refid="Example_Where_Clause" />
  116. </if>
  117. </select>
  118. <update id="updateByExampleSelective" parameterType="map">
  119. update pc_label_post
  120. <set>
  121. <if test="row.labelID != null">
  122. LabelID = #{row.labelID,jdbcType=VARCHAR},
  123. </if>
  124. <if test="row.postID != null">
  125. PostID = #{row.postID,jdbcType=VARCHAR},
  126. </if>
  127. </set>
  128. <if test="example != null">
  129. <include refid="Update_By_Example_Where_Clause" />
  130. </if>
  131. </update>
  132. <update id="updateByExample" parameterType="map">
  133. update pc_label_post
  134. set LabelID = #{row.labelID,jdbcType=VARCHAR},
  135. PostID = #{row.postID,jdbcType=VARCHAR}
  136. <if test="example != null">
  137. <include refid="Update_By_Example_Where_Clause" />
  138. </if>
  139. </update>
  140. </mapper>