DictV1ServiceDaoImplMapper.xml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="dictV1ServiceDaoImpl">
  6. <!-- 保存字典表信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveDictInfo" parameterType="Map">
  8. insert into t_dict(
  9. table_columns,name,description,status_cd,table_name
  10. ) values (
  11. #{tableColumns},#{name},#{description},#{statusCd},#{tableName}
  12. )
  13. </insert>
  14. <!-- 查询字典表信息 add by wuxw 2018-07-03 -->
  15. <select id="getDictInfo" parameterType="Map" resultType="Map">
  16. select t.table_columns,t.table_columns tableColumns,t.name,t.description,t.status_cd,t.status_cd
  17. statusCd,t.id,t.table_name,t.table_name tableName
  18. from t_dict t
  19. where 1 =1
  20. <if test="tableColumns !=null and tableColumns != ''">
  21. and t.table_columns= #{tableColumns}
  22. </if>
  23. <if test="name !=null and name != ''">
  24. and t.name= #{name}
  25. </if>
  26. <if test="description !=null and description != ''">
  27. and t.description= #{description}
  28. </if>
  29. <if test="statusCd !=null and statusCd != ''">
  30. and t.status_cd= #{statusCd}
  31. </if>
  32. <if test="id !=null and id != ''">
  33. and t.id= #{id}
  34. </if>
  35. <if test="tableName !=null and tableName != ''">
  36. and t.table_name= #{tableName}
  37. </if>
  38. order by t.create_time desc
  39. <if test="page != -1 and page != null ">
  40. limit #{page}, #{row}
  41. </if>
  42. </select>
  43. <!-- 修改字典表信息 add by wuxw 2018-07-03 -->
  44. <update id="updateDictInfo" parameterType="Map">
  45. update t_dict t
  46. <set>
  47. <if test="statusCd != null and statusCd != ''">
  48. t.status_cd = #{statusCd},
  49. </if>
  50. <if test="tableColumns !=null and tableColumns != ''">
  51. t.table_columns= #{tableColumns},
  52. </if>
  53. <if test="name !=null and name != ''">
  54. t.name= #{name},
  55. </if>
  56. <if test="description !=null and description != ''">
  57. t.description= #{description},
  58. </if>
  59. <if test="tableName !=null and tableName != ''">
  60. t.table_name= #{tableName}
  61. </if>
  62. </set>
  63. where 1=1
  64. <if test="id !=null and id != ''">
  65. and t.id= #{id}
  66. </if>
  67. </update>
  68. <!-- 修改字典表信息 add by wuxw 2018-07-03 -->
  69. <delete id="deleteDictInfo" parameterType="Map">
  70. delete from t_dict
  71. where 1=1
  72. and id= #{id}
  73. </delete>
  74. <!-- 查询字典表数量 add by wuxw 2018-07-03 -->
  75. <select id="queryDictsCount" parameterType="Map" resultType="Map">
  76. select count(1) count
  77. from t_dict t
  78. where 1 =1
  79. <if test="tableColumns !=null and tableColumns != ''">
  80. and t.table_columns= #{tableColumns}
  81. </if>
  82. <if test="name !=null and name != ''">
  83. and t.name= #{name}
  84. </if>
  85. <if test="description !=null and description != ''">
  86. and t.description= #{description}
  87. </if>
  88. <if test="statusCd !=null and statusCd != ''">
  89. and t.status_cd= #{statusCd}
  90. </if>
  91. <if test="id !=null and id != ''">
  92. and t.id= #{id}
  93. </if>
  94. <if test="tableName !=null and tableName != ''">
  95. and t.table_name= #{tableName}
  96. </if>
  97. </select>
  98. <!-- 查询字典表数量 add by wuxw 2018-07-03 -->
  99. <select id="queryDictsAndSpecCount" parameterType="Map" resultType="Map">
  100. select count(1) count
  101. from t_dict t
  102. inner JOIN t_dict_spec ds on t.table_name = ds.table_name and t.table_columns = ds.table_columns
  103. where 1 =1
  104. <if test="specId !=null and specId != ''">
  105. and ds.spec_id = #{specId}
  106. </if>
  107. <if test="tableColumns !=null and tableColumns != ''">
  108. and t.table_columns= #{tableColumns}
  109. </if>
  110. <if test="name !=null and name != ''">
  111. and t.name= #{name}
  112. </if>
  113. <if test="description !=null and description != ''">
  114. and t.description= #{description}
  115. </if>
  116. <if test="statusCd !=null and statusCd != ''">
  117. and t.status_cd= #{statusCd}
  118. </if>
  119. <if test="id !=null and id != ''">
  120. and t.id= #{id}
  121. </if>
  122. <if test="tableName !=null and tableName != ''">
  123. and t.table_name= #{tableName}
  124. </if>
  125. </select>
  126. <!-- 查询字典表信息 add by wuxw 2018-07-03 -->
  127. <select id="getDictAndSpecInfo" parameterType="Map" resultType="Map">
  128. select t.table_columns,t.table_columns tableColumns,t.name,t.description,t.status_cd,t.status_cd
  129. statusCd,t.id,t.table_name,t.table_name tableName,ds.spec_name specName
  130. from t_dict t
  131. inner JOIN t_dict_spec ds on t.table_name = ds.table_name and t.table_columns = ds.table_columns
  132. where 1 =1
  133. <if test="specId !=null and specId != ''">
  134. and ds.spec_id = #{specId}
  135. </if>
  136. <if test="tableColumns !=null and tableColumns != ''">
  137. and t.table_columns= #{tableColumns}
  138. </if>
  139. <if test="name !=null and name != ''">
  140. and t.name= #{name}
  141. </if>
  142. <if test="description !=null and description != ''">
  143. and t.description= #{description}
  144. </if>
  145. <if test="statusCd !=null and statusCd != ''">
  146. and t.status_cd= #{statusCd}
  147. </if>
  148. <if test="id !=null and id != ''">
  149. and t.id= #{id}
  150. </if>
  151. <if test="tableName !=null and tableName != ''">
  152. and t.table_name= #{tableName}
  153. </if>
  154. order by t.create_time desc
  155. <if test="page != -1 and page != null ">
  156. limit #{page}, #{row}
  157. </if>
  158. </select>
  159. </mapper>