MarketLogV1ServiceDaoImplMapper.xml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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="marketLogV1ServiceDaoImpl">
  6. <!-- 保存营销记录信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveMarketLogInfo" parameterType="Map">
  8. insert into market_log(
  9. person_name,send_content,send_way,open_id,log_id,community_name,remark,rule_id,community_id,person_tel,business_type
  10. ) values (
  11. #{personName},#{sendContent},#{sendWay},#{openId},#{logId},#{communityName},#{remark},#{ruleId},#{communityId},#{personTel},#{businessType}
  12. )
  13. </insert>
  14. <!-- 查询营销记录信息 add by wuxw 2018-07-03 -->
  15. <select id="getMarketLogInfo" parameterType="Map" resultType="Map">
  16. select t.person_name,t.person_name personName,t.send_content,t.send_content sendContent,t.send_way,t.send_way
  17. sendWay,t.open_id,t.open_id openId,t.log_id,t.log_id logId,t.community_name,t.community_name
  18. communityName,t.status_cd,t.status_cd statusCd,t.remark,t.rule_id,t.rule_id ruleId,t.community_id,t.community_id
  19. communityId,t.person_tel,t.person_tel personTel,t.business_type,t.business_type businessType,mr.`name` ruleName,
  20. td.`name` sendWayName,td1.name businessTypeName,t.create_time createTime
  21. from market_log t
  22. left join market_rule mr on t.rule_id = mr.rule_id and mr.status_cd = '0'
  23. LEFT JOIN t_dict td on td.status_cd = t.send_way and td.table_name = 'market_log' and td.table_columns = 'send_way'
  24. LEFT JOIN t_dict td1 on td1.status_cd = t.business_type and td1.table_name = 'market_log' and td1.table_columns = 'business_type'
  25. where 1 =1
  26. <if test="personName !=null and personName != ''">
  27. and t.person_name= #{personName}
  28. </if>
  29. <if test="personNameLike !=null and personNameLike != ''">
  30. and t.person_name like concat('%', #{personName},'%')
  31. </if>
  32. <if test="startTime !=null and startTime != ''">
  33. and t.create_time &gt; #{startTime}
  34. </if>
  35. <if test="endTime !=null and endTime != ''">
  36. and t.create_time &lt; #{endTime}
  37. </if>
  38. <if test="sendContent !=null and sendContent != ''">
  39. and t.send_content= #{sendContent}
  40. </if>
  41. <if test="sendWay !=null and sendWay != ''">
  42. and t.send_way= #{sendWay}
  43. </if>
  44. <if test="openId !=null and openId != ''">
  45. and t.open_id= #{openId}
  46. </if>
  47. <if test="logId !=null and logId != ''">
  48. and t.log_id= #{logId}
  49. </if>
  50. <if test="communityName !=null and communityName != ''">
  51. and t.community_name= #{communityName}
  52. </if>
  53. <if test="statusCd !=null and statusCd != ''">
  54. and t.status_cd= #{statusCd}
  55. </if>
  56. <if test="remark !=null and remark != ''">
  57. and t.remark= #{remark}
  58. </if>
  59. <if test="ruleId !=null and ruleId != ''">
  60. and t.rule_id= #{ruleId}
  61. </if>
  62. <if test="communityId !=null and communityId != ''">
  63. and t.community_id= #{communityId}
  64. </if>
  65. <if test="personTel !=null and personTel != ''">
  66. and t.person_tel= #{personTel}
  67. </if>
  68. <if test="businessType !=null and businessType != ''">
  69. and t.business_type= #{businessType}
  70. </if>
  71. order by t.create_time desc
  72. <if test="page != -1 and page != null ">
  73. limit #{page}, #{row}
  74. </if>
  75. </select>
  76. <!-- 修改营销记录信息 add by wuxw 2018-07-03 -->
  77. <update id="updateMarketLogInfo" parameterType="Map">
  78. update market_log t set t.status_cd = #{statusCd}
  79. <if test="newBId != null and newBId != ''">
  80. ,t.b_id = #{newBId}
  81. </if>
  82. <if test="personName !=null and personName != ''">
  83. , t.person_name= #{personName}
  84. </if>
  85. <if test="sendContent !=null and sendContent != ''">
  86. , t.send_content= #{sendContent}
  87. </if>
  88. <if test="sendWay !=null and sendWay != ''">
  89. , t.send_way= #{sendWay}
  90. </if>
  91. <if test="openId !=null and openId != ''">
  92. , t.open_id= #{openId}
  93. </if>
  94. <if test="communityName !=null and communityName != ''">
  95. , t.community_name= #{communityName}
  96. </if>
  97. <if test="remark !=null and remark != ''">
  98. , t.remark= #{remark}
  99. </if>
  100. <if test="ruleId !=null and ruleId != ''">
  101. , t.rule_id= #{ruleId}
  102. </if>
  103. <if test="communityId !=null and communityId != ''">
  104. , t.community_id= #{communityId}
  105. </if>
  106. <if test="personTel !=null and personTel != ''">
  107. , t.person_tel= #{personTel}
  108. </if>
  109. <if test="businessType !=null and businessType != ''">
  110. , t.business_type= #{businessType}
  111. </if>
  112. where 1=1
  113. <if test="logId !=null and logId != ''">
  114. and t.log_id= #{logId}
  115. </if>
  116. </update>
  117. <!-- 查询营销记录数量 add by wuxw 2018-07-03 -->
  118. <select id="queryMarketLogsCount" parameterType="Map" resultType="Map">
  119. select count(1) count
  120. from market_log t
  121. where 1 =1
  122. <if test="personName !=null and personName != ''">
  123. and t.person_name= #{personName}
  124. </if>
  125. <if test="personNameLike !=null and personNameLike != ''">
  126. and t.person_name like concat('%', #{personName},'%')
  127. </if>
  128. <if test="startTime !=null and startTime != ''">
  129. and t.create_time &gt; #{startTime}
  130. </if>
  131. <if test="endTime !=null and endTime != ''">
  132. and t.create_time &lt; #{endTime}
  133. </if>
  134. <if test="sendContent !=null and sendContent != ''">
  135. and t.send_content= #{sendContent}
  136. </if>
  137. <if test="sendWay !=null and sendWay != ''">
  138. and t.send_way= #{sendWay}
  139. </if>
  140. <if test="openId !=null and openId != ''">
  141. and t.open_id= #{openId}
  142. </if>
  143. <if test="logId !=null and logId != ''">
  144. and t.log_id= #{logId}
  145. </if>
  146. <if test="communityName !=null and communityName != ''">
  147. and t.community_name= #{communityName}
  148. </if>
  149. <if test="statusCd !=null and statusCd != ''">
  150. and t.status_cd= #{statusCd}
  151. </if>
  152. <if test="remark !=null and remark != ''">
  153. and t.remark= #{remark}
  154. </if>
  155. <if test="ruleId !=null and ruleId != ''">
  156. and t.rule_id= #{ruleId}
  157. </if>
  158. <if test="communityId !=null and communityId != ''">
  159. and t.community_id= #{communityId}
  160. </if>
  161. <if test="personTel !=null and personTel != ''">
  162. and t.person_tel= #{personTel}
  163. </if>
  164. <if test="businessType !=null and businessType != ''">
  165. and t.business_type= #{businessType}
  166. </if>
  167. </select>
  168. </mapper>