generatorConfig.xml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE generatorConfiguration
  3. PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
  4. "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
  5. <generatorConfiguration>
  6. <context id="mysqlgenerator" targetRuntime="MyBatis3">
  7. <property name="autoDelimitKeywords" value="true"/>
  8. <!--可以使用``包括字段名,避免字段名与sql保留字冲突报错-->
  9. <property name="beginningDelimiter" value="`"/>
  10. <property name="endingDelimiter" value="`"/>
  11. <!-- 自动生成toString方法 -->
  12. <plugin type="org.mybatis.generator.plugins.ToStringPlugin"/>
  13. <!-- 自动生成equals方法和hashcode方法 -->
  14. <plugin type="org.mybatis.generator.plugins.EqualsHashCodePlugin"/>
  15. <!-- 非官方插件 https://github.com/itfsw/mybatis-generator-plugin -->
  16. <!-- 查询单条数据插件 -->
  17. <plugin type="com.itfsw.mybatis.generator.plugins.SelectOneByExamplePlugin"/>
  18. <!-- 查询结果选择性返回插件 -->
  19. <plugin type="com.itfsw.mybatis.generator.plugins.SelectSelectivePlugin"/>
  20. <!-- Example Criteria 增强插件 -->
  21. <plugin type="com.itfsw.mybatis.generator.plugins.ExampleEnhancedPlugin"/>
  22. <!-- 数据Model属性对应Column获取插件 -->
  23. <plugin type="com.itfsw.mybatis.generator.plugins.ModelColumnPlugin"/>
  24. <!-- 逻辑删除插件 -->
  25. <plugin type="com.itfsw.mybatis.generator.plugins.LogicalDeletePlugin">
  26. <!-- 这里配置的是全局逻辑删除列和逻辑删除值,当然在table中配置的值会覆盖该全局配置 -->
  27. <!-- 逻辑删除列类型只能为数字、字符串或者布尔类型 -->
  28. <property name="logicalDeleteColumn" value="deleted"/>
  29. <!-- 逻辑删除-已删除值 -->
  30. <property name="logicalDeleteValue" value="1"/>
  31. <!-- 逻辑删除-未删除值 -->
  32. <property name="logicalUnDeleteValue" value="0"/>
  33. </plugin>
  34. <commentGenerator>
  35. <property name="suppressDate" value="true"/>
  36. <!--<property name="suppressAllComments" value="true"/>-->
  37. </commentGenerator>
  38. <!--数据库连接信息-->
  39. <jdbcConnection driverClass="com.mysql.jdbc.Driver"
  40. connectionURL="jdbc:mysql://127.0.0.1:3306/litemall?useUnicode=true&amp;characterEncoding=UTF-8&amp;serverTimezone=UTC&amp;verifyServerCertificate=false&amp;useSSL=false&amp;nullCatalogMeansCurrent=true"
  41. userId="litemall"
  42. password="litemall123456"/>
  43. <javaTypeResolver>
  44. <property name="useJSR310Types" value="true"/>
  45. </javaTypeResolver>
  46. <javaModelGenerator targetPackage="org.linlinjava.litemall.db.domain" targetProject="src/main/java"/>
  47. <sqlMapGenerator targetPackage="org.linlinjava.litemall.db.dao" targetProject="src/main/resources"/>
  48. <javaClientGenerator type="XMLMAPPER" targetPackage="org.linlinjava.litemall.db.dao"
  49. targetProject="src/main/java"/>
  50. <!--表名-->
  51. <table tableName="litemall_ad">
  52. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  53. </table>
  54. <table tableName="litemall_address">
  55. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  56. </table>
  57. <table tableName="litemall_admin">
  58. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  59. <columnOverride column="role_ids" javaType="java.lang.Integer[]"
  60. typeHandler="org.linlinjava.litemall.db.mybatis.JsonIntegerArrayTypeHandler"/>
  61. </table>
  62. <table tableName="litemall_brand">
  63. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  64. </table>
  65. <table tableName="litemall_cart">
  66. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  67. <columnOverride column="specifications" javaType="java.lang.String[]"
  68. typeHandler="org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler"/>
  69. </table>
  70. <table tableName="litemall_category">
  71. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  72. </table>
  73. <table tableName="litemall_collect">
  74. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  75. </table>
  76. <table tableName="litemall_comment">
  77. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  78. <columnOverride column="pic_urls" javaType="java.lang.String[]"
  79. typeHandler="org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler"/>
  80. </table>
  81. <table tableName="litemall_feedback">
  82. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  83. <columnOverride column="pic_urls" javaType="java.lang.String[]"
  84. typeHandler="org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler"/>
  85. </table>
  86. <table tableName="litemall_footprint">
  87. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  88. </table>
  89. <table tableName="litemall_goods">
  90. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  91. <columnOverride column="gallery" javaType="java.lang.String[]"
  92. typeHandler="org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler"/>
  93. </table>
  94. <table tableName="litemall_goods_attribute">
  95. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  96. </table>
  97. <table tableName="litemall_goods_specification">
  98. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  99. </table>
  100. <table tableName="litemall_goods_product">
  101. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  102. <columnOverride column="specifications" javaType="java.lang.String[]"
  103. typeHandler="org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler"/>
  104. </table>
  105. <table tableName="litemall_issue">
  106. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  107. </table>
  108. <table tableName="litemall_keyword">
  109. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  110. </table>
  111. <table tableName="litemall_order">
  112. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  113. </table>
  114. <table tableName="litemall_order_goods">
  115. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  116. <columnOverride column="specifications" javaType="java.lang.String[]"
  117. typeHandler="org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler"/>
  118. <columnOverride column="comments" javaType="java.lang.Integer[]"
  119. typeHandler="org.linlinjava.litemall.db.mybatis.JsonIntegerArrayTypeHandler"/>
  120. </table>
  121. <table tableName="litemall_region">
  122. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  123. </table>
  124. <table tableName="litemall_search_history">
  125. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  126. </table>
  127. <table tableName="litemall_storage">
  128. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  129. </table>
  130. <table tableName="litemall_topic">
  131. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  132. <columnOverride column="goods" javaType="java.lang.Integer[]"
  133. typeHandler="org.linlinjava.litemall.db.mybatis.JsonIntegerArrayTypeHandler"/>
  134. </table>
  135. <table tableName="litemall_user">
  136. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  137. </table>
  138. <table tableName="litemall_system">
  139. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  140. </table>
  141. <table tableName="litemall_groupon_rules">
  142. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  143. </table>
  144. <table tableName="litemall_groupon">
  145. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  146. </table>
  147. <table tableName="litemall_coupon">
  148. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  149. <columnOverride column="goods_value" javaType="java.lang.Integer[]"
  150. typeHandler="org.linlinjava.litemall.db.mybatis.JsonIntegerArrayTypeHandler"/>
  151. </table>
  152. <table tableName="litemall_coupon_user">
  153. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  154. </table>
  155. <table tableName="litemall_role">
  156. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  157. </table>
  158. <table tableName="litemall_permission">
  159. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  160. </table>
  161. <table tableName="litemall_log">
  162. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  163. </table>
  164. <table tableName="litemall_notice">
  165. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  166. </table>
  167. <table tableName="litemall_notice_admin">
  168. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  169. </table>
  170. <table tableName="litemall_aftersale">
  171. <generatedKey column="id" sqlStatement="MySql" identity="true"/>
  172. <columnOverride column="pictures" javaType="java.lang.String[]"
  173. typeHandler="org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler"/>
  174. </table>
  175. </context>
  176. </generatorConfiguration>