TestAaaMapper.xml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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.izouma.awesomeadmin.dao.TestAaaMapper" >
  4. <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.TestAaa" >
  5. <id column="id" property="id" jdbcType="INTEGER" />
  6. <result column="del_flag" property="delFlag" jdbcType="CHAR" />
  7. <result column="test_name" property="testName" jdbcType="VARCHAR" />
  8. <result column="remark" property="remark" jdbcType="VARCHAR" />
  9. </resultMap>
  10. <sql id="Base_Column_List" >
  11. id, del_flag, test_name, remark </sql>
  12. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  13. select
  14. <include refid="Base_Column_List" />
  15. from test_aaa
  16. where id = #{id,jdbcType=INTEGER}
  17. </select>
  18. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  19. delete from test_aaa
  20. where id = #{id,jdbcType=INTEGER}
  21. </delete>
  22. <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.TestAaa" useGeneratedKeys="true" keyProperty="id">
  23. insert into test_aaa
  24. <trim prefix="(" suffix=")" suffixOverrides="," >
  25. <if test="delFlag!= null" >
  26. del_flag,
  27. </if>
  28. <if test="testName!= null" >
  29. test_name,
  30. </if>
  31. <if test="remark!= null" >
  32. remark,
  33. </if>
  34. </trim>
  35. <trim prefix="values (" suffix=")" suffixOverrides="," >
  36. <if test="delFlag != null" >
  37. #{delFlag,jdbcType=CHAR},
  38. </if>
  39. <if test="testName != null" >
  40. #{testName,jdbcType=VARCHAR},
  41. </if>
  42. <if test="remark != null" >
  43. #{remark,jdbcType=VARCHAR},
  44. </if>
  45. </trim>
  46. </insert>
  47. <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.TestAaa" >
  48. update test_aaa
  49. <set >
  50. <if test="delFlag != null" >
  51. del_flag= #{delFlag,jdbcType=CHAR},
  52. </if>
  53. <if test="testName != null" >
  54. test_name= #{testName,jdbcType=VARCHAR},
  55. </if>
  56. <if test="remark != null" >
  57. remark= #{remark,jdbcType=VARCHAR},
  58. </if>
  59. </set>
  60. where id = #{id,jdbcType=INTEGER}
  61. </update>
  62. <select id="queryTestAaaByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestAaa">
  63. select <include refid="Base_Column_List"/> from test_aaa
  64. <where>
  65. and del_flag = 'N'
  66. <if test="record.id != null and !&quot;&quot;.equals(record.id)">
  67. and id = #{record.id}
  68. </if>
  69. <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
  70. and del_flag = #{record.delFlag}
  71. </if>
  72. <if test="record.testName != null and !&quot;&quot;.equals(record.testName)">
  73. and test_name = #{record.testName}
  74. </if>
  75. <if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
  76. and remark = #{record.remark}
  77. </if>
  78. </where>
  79. order by id desc
  80. </select>
  81. <select id="queryAllTestAaa" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestAaa">
  82. select <include refid="Base_Column_List"/> from test_aaa
  83. <where>
  84. and del_flag = 'N'
  85. <if test="id != null and !&quot;&quot;.equals(id)">
  86. and id = #{id}
  87. </if>
  88. <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
  89. and del_flag = #{delFlag}
  90. </if>
  91. <if test="testName != null and !&quot;&quot;.equals(testName)">
  92. and test_name = #{testName}
  93. </if>
  94. <if test="remark != null and !&quot;&quot;.equals(remark)">
  95. and remark = #{remark}
  96. </if>
  97. </where>
  98. order by id desc
  99. </select>
  100. <select id="queryTestAaa" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestAaa">
  101. select top 1 <include refid="Base_Column_List"/> from test_aaa
  102. <where>
  103. and del_flag = 'N'
  104. <if test="id != null and !&quot;&quot;.equals(id)">
  105. and id = #{id}
  106. </if>
  107. <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
  108. and del_flag = #{delFlag}
  109. </if>
  110. <if test="testName != null and !&quot;&quot;.equals(testName)">
  111. and test_name = #{testName}
  112. </if>
  113. <if test="remark != null and !&quot;&quot;.equals(remark)">
  114. and remark = #{remark}
  115. </if>
  116. </where>
  117. </select>
  118. <update id="delete">
  119. UPDATE test_aaa SET del_flag = 'Y'
  120. <where>
  121. AND id = #{id}
  122. </where>
  123. </update>
  124. <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestAaa">
  125. select <include refid="Base_Column_List"/> from test_aaa
  126. <where>
  127. and del_flag = 'N'
  128. </where>
  129. order by id desc
  130. </select>
  131. </mapper>