GenTableDao.xml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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.jeeplus.modules.gen.dao.GenTableDao">
  4. <!---->
  5. <!--<sql id="genTableColumns">-->
  6. <!--a.*-->
  7. <!--</sql>-->
  8. <!---->
  9. <!--<sql id="genTableJoins">-->
  10. <!---->
  11. <!--</sql>-->
  12. <!---->
  13. <!--<select id="get" resultType="GenTable">-->
  14. <!--SELECT -->
  15. <!--<include refid="genTableColumns"/>-->
  16. <!--FROM gen_table a-->
  17. <!--<include refid="genTableJoins"/>-->
  18. <!--WHERE a.id = #{id}-->
  19. <!--</select>-->
  20. <!---->
  21. <!--<select id="findList" resultType="GenTable">-->
  22. <!--SELECT -->
  23. <!--<include refid="genTableColumns"/>-->
  24. <!--FROM gen_table a-->
  25. <!--<include refid="genTableJoins"/>-->
  26. <!--WHERE a.del_flag = #{DEL_FLAG_NORMAL} -->
  27. <!--<if test="name != null and name != ''">-->
  28. <!--AND a.name = #{name}-->
  29. <!--</if>-->
  30. <!--<if test="nameLike != null and nameLike != ''">-->
  31. <!--AND a.name LIKE -->
  32. <!--<if test="dbName == 'oracle'">'%'||#{nameLike}||'%'</if>-->
  33. <!--<if test="dbName == 'mssql'">'%'+#{nameLike}+'%'</if>-->
  34. <!--<if test="dbName == 'mysql'">concat('%',#{nameLike},'%')</if>-->
  35. <!--</if>-->
  36. <!--<if test="comments != null and comments != ''">-->
  37. <!--AND a.comments LIKE -->
  38. <!--<if test="dbName == 'oracle'">'%'||#{comments}||'%'</if>-->
  39. <!--<if test="dbName == 'mssql'">'%'+#{comments}+'%'</if>-->
  40. <!--<if test="dbName == 'mysql'">concat('%',#{comments},'%')</if>-->
  41. <!--</if>-->
  42. <!--<if test="parentTable != null and parentTable != ''">-->
  43. <!--AND a.parent_table = #{parentTable}-->
  44. <!--</if>-->
  45. <!--<choose>-->
  46. <!--<when test="page.orderBy != null and page.orderBy != ''">-->
  47. <!--ORDER BY ${page.orderBy}-->
  48. <!--</when>-->
  49. <!--<otherwise>-->
  50. <!--ORDER BY a.name ASC-->
  51. <!--</otherwise>-->
  52. <!--</choose>-->
  53. <!--</select>-->
  54. <!--<select id="findAllList" resultType="GenTable">-->
  55. <!--SELECT -->
  56. <!--<include refid="genTableColumns"/>-->
  57. <!--FROM gen_table a-->
  58. <!--<include refid="genTableJoins"/>-->
  59. <!--WHERE a.del_flag = #{DEL_FLAG_NORMAL}-->
  60. <!--<choose>-->
  61. <!--<when test="page !=null and page.orderBy != null and page.orderBy != ''">-->
  62. <!--ORDER BY ${page.orderBy}-->
  63. <!--</when>-->
  64. <!--<otherwise>-->
  65. <!--ORDER BY a.name ASC-->
  66. <!--</otherwise>-->
  67. <!--</choose>-->
  68. <!--</select>-->
  69. <!---->
  70. <!--<insert id="insert">-->
  71. <!--INSERT INTO gen_table(-->
  72. <!--id, -->
  73. <!--name, -->
  74. <!--comments, -->
  75. <!--table_type,-->
  76. <!--class_name, -->
  77. <!--parent_table, -->
  78. <!--parent_table_fk, -->
  79. <!--create_by, -->
  80. <!--create_date, -->
  81. <!--update_by, -->
  82. <!--update_date, -->
  83. <!--remarks, -->
  84. <!--del_flag,-->
  85. <!--issync-->
  86. <!--) VALUES (-->
  87. <!--#{id}, -->
  88. <!--#{name}, -->
  89. <!--#{comments},-->
  90. <!--#{tableType}, -->
  91. <!--#{className}, -->
  92. <!--#{parentTable}, -->
  93. <!--#{parentTableFk}, -->
  94. <!--#{createBy.id}, -->
  95. <!--#{createDate}, -->
  96. <!--#{updateBy.id}, -->
  97. <!--#{updateDate}, -->
  98. <!--#{remarks}, -->
  99. <!--#{delFlag},-->
  100. <!--#{isSync}-->
  101. <!--)-->
  102. <!--</insert>-->
  103. <!---->
  104. <!--<update id="update">-->
  105. <!--UPDATE gen_table SET &lt;!&ndash; -->
  106. <!--name = #{name}, &ndash;&gt;-->
  107. <!--comments = #{comments}, -->
  108. <!--table_type = #{tableType},-->
  109. <!--class_name = #{className}, -->
  110. <!--parent_table = #{parentTable}, -->
  111. <!--parent_table_fk = #{parentTableFk}, -->
  112. <!--update_by = #{updateBy.id}, -->
  113. <!--update_date = #{updateDate}, -->
  114. <!--remarks = #{remarks},-->
  115. <!--issync = #{isSync}-->
  116. <!--WHERE id = #{id}-->
  117. <!--</update>-->
  118. <!---->
  119. <!--<update id="delete">-->
  120. <!--DELETE FROM gen_table -->
  121. <!--WHERE id = #{id}-->
  122. <!--</update>-->
  123. <!---->
  124. <!--<update id="deleteByLogic">-->
  125. <!--UPDATE gen_table SET -->
  126. <!--del_flag = #{DEL_FLAG_DELETE}-->
  127. <!--WHERE id = #{id}-->
  128. <!--</update>-->
  129. <!---->
  130. <!--<update id="buildTable" statementType="STATEMENT"> -->
  131. <!--${sql}-->
  132. <!--</update>-->
  133. <!---->
  134. <!--&lt;!&ndash; 根据实体名称和字段名称和字段值获取唯一记录 &ndash;&gt;-->
  135. <!--<select id="findUniqueByProperty" resultType="GenTable" statementType="STATEMENT">-->
  136. <!--select * FROM gen_table where ${propertyName} = '${value}'-->
  137. <!--</select>-->
  138. <!---->
  139. </mapper>