MappingServiceDaoImplMapper.xml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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="mappingServiceDaoImpl">
  6. <!-- 保存映射信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveMappingInfo" parameterType="Map">
  8. <![CDATA[
  9. insert into c_mapping select
  10. #{id},#{domain},#{name},#{key},#{value},#{remark},now(),'0'
  11. ]]>
  12. </insert>
  13. <!-- 查询映射信息(Business) add by wuxw 2018-07-03 -->
  14. <select id="getBusinessMappingInfo" parameterType="Map" resultType="Map">
  15. select t.operate,t.domain,t.name,t.remark,t.id,t.value,t.key
  16. from business_mapping t
  17. where 1 =1
  18. <if test="operate !=null and operate != ''">
  19. and t.operate= #{operate}
  20. </if>
  21. <if test="domain !=null and domain != ''">
  22. and t.domain= #{domain}
  23. </if>
  24. <if test="name !=null and name != ''">
  25. and t.name= #{name}
  26. </if>
  27. <if test="remark !=null and remark != ''">
  28. and t.remark= #{remark}
  29. </if>
  30. <if test="id !=null and id != ''">
  31. and t.id= #{id}
  32. </if>
  33. <if test="value !=null and value != ''">
  34. and t.value= #{value}
  35. </if>
  36. <if test="key !=null and key != ''">
  37. and t.`key`= #{key}
  38. </if>
  39. </select>
  40. <!-- 保存映射信息至 instance表中 add by wuxw 2018-07-03 -->
  41. <insert id="saveMappingInfoInstance" parameterType="Map">
  42. insert into c_mapping(
  43. domain,name,remark,status_cd,id,value,key
  44. ) select t.domain,t.name,t.remark,'0',t.id,t.value,t.key from business_mapping t where 1=1
  45. and t.operate= 'ADD'
  46. <if test="domain !=null and domain != ''">
  47. and t.domain= #{domain}
  48. </if>
  49. <if test="name !=null and name != ''">
  50. and t.name= #{name}
  51. </if>
  52. <if test="remark !=null and remark != ''">
  53. and t.remark= #{remark}
  54. </if>
  55. <if test="id !=null and id != ''">
  56. and t.id= #{id}
  57. </if>
  58. <if test="value !=null and value != ''">
  59. and t.value= #{value}
  60. </if>
  61. <if test="key !=null and key != ''">
  62. and t.key= #{key}
  63. </if>
  64. </insert>
  65. <!-- 查询映射信息 add by wuxw 2018-07-03 -->
  66. <select id="getMappingInfo" parameterType="Map" resultType="Map">
  67. select t.domain,t.name,t.remark,t.status_cd,t.status_cd statusCd,t.id,t.value,t.key
  68. from c_mapping t
  69. where 1 =1
  70. <if test="domain !=null and domain != ''">
  71. and t.domain= #{domain}
  72. </if>
  73. <if test="name !=null and name != ''">
  74. and t.name= #{name}
  75. </if>
  76. <if test="remark !=null and remark != ''">
  77. and t.remark= #{remark}
  78. </if>
  79. <if test="statusCd !=null and statusCd != ''">
  80. and t.status_cd= #{statusCd}
  81. </if>
  82. <if test="id !=null and id != ''">
  83. and t.id= #{id}
  84. </if>
  85. <if test="value !=null and value != ''">
  86. and t.value= #{value}
  87. </if>
  88. <if test="key !=null and key != ''">
  89. and t.key= #{key}
  90. </if>
  91. order by t.create_time desc
  92. <if test="page != -1 and page != null ">
  93. limit #{page}, #{row}
  94. </if>
  95. </select>
  96. <!-- 修改映射信息 add by wuxw 2018-07-03 -->
  97. <update id="updateMappingInfo" parameterType="Map">
  98. update c_mapping t set t.status_cd = #{statusCd}
  99. <if test="domain !=null and domain != ''">
  100. , t.domain= #{domain}
  101. </if>
  102. <if test="name !=null and name != ''">
  103. , t.name= #{name}
  104. </if>
  105. <if test="remark !=null and remark != ''">
  106. , t.remark= #{remark}
  107. </if>
  108. <if test="value !=null and value != ''">
  109. , t.value= #{value}
  110. </if>
  111. <if test="key !=null and key != ''">
  112. , t.`key`= #{key}
  113. </if>
  114. where 1=1
  115. <if test="id !=null and id != ''">
  116. and t.id= #{id}
  117. </if>
  118. </update>
  119. <!-- 查询映射数量 add by wuxw 2018-07-03 -->
  120. <select id="queryMappingsCount" parameterType="Map" resultType="Map">
  121. select count(1) count
  122. from c_mapping t
  123. where 1 =1
  124. <if test="domain !=null and domain != ''">
  125. and t.domain= #{domain}
  126. </if>
  127. <if test="name !=null and name != ''">
  128. and t.name= #{name}
  129. </if>
  130. <if test="remark !=null and remark != ''">
  131. and t.remark= #{remark}
  132. </if>
  133. <if test="statusCd !=null and statusCd != ''">
  134. and t.status_cd= #{statusCd}
  135. </if>
  136. <if test="id !=null and id != ''">
  137. and t.id= #{id}
  138. </if>
  139. <if test="value !=null and value != ''">
  140. and t.value= #{value}
  141. </if>
  142. <if test="key !=null and key != ''">
  143. and t.key= #{key}
  144. </if>
  145. </select>
  146. </mapper>