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