• CRM(Mapper层)详细代码


    Mapper详细代码:

     

    DicValueMapper:

    1. package com.bjpowernode.crm.settings.mapper;
    2. import com.bjpowernode.crm.settings.domain.DicValue;
    3. import java.util.List;
    4. public interface DicValueMapper {
    5. /**
    6. * This method was generated by MyBatis Generator.
    7. * This method corresponds to the database table tbl_dic_value
    8. *
    9. * @mbggenerated Tue Nov 03 17:09:33 CST 2020
    10. */
    11. int deleteByPrimaryKey(String id);
    12. /**
    13. * This method was generated by MyBatis Generator.
    14. * This method corresponds to the database table tbl_dic_value
    15. *
    16. * @mbggenerated Tue Nov 03 17:09:33 CST 2020
    17. */
    18. int insert(DicValue record);
    19. /**
    20. * This method was generated by MyBatis Generator.
    21. * This method corresponds to the database table tbl_dic_value
    22. *
    23. * @mbggenerated Tue Nov 03 17:09:33 CST 2020
    24. */
    25. int insertSelective(DicValue record);
    26. /**
    27. * This method was generated by MyBatis Generator.
    28. * This method corresponds to the database table tbl_dic_value
    29. *
    30. * @mbggenerated Tue Nov 03 17:09:33 CST 2020
    31. */
    32. DicValue selectByPrimaryKey(String id);
    33. /**
    34. * This method was generated by MyBatis Generator.
    35. * This method corresponds to the database table tbl_dic_value
    36. *
    37. * @mbggenerated Tue Nov 03 17:09:33 CST 2020
    38. */
    39. int updateByPrimaryKeySelective(DicValue record);
    40. /**
    41. * This method was generated by MyBatis Generator.
    42. * This method corresponds to the database table tbl_dic_value
    43. *
    44. * @mbggenerated Tue Nov 03 17:09:33 CST 2020
    45. */
    46. int updateByPrimaryKey(DicValue record);
    47. /**
    48. * 根据typeCode查询数据字典值
    49. * @param typeCode
    50. * @return
    51. */
    52. List<DicValue> selectDicValueByTypeCode(String typeCode);
    53. /**
    54. * 通过id查询对应的字典表数据
    55. * @param id 字典数据id
    56. * @return 字典表数据
    57. */
    58. DicValue selectDicValueById(String id);
    59. }

    DicValueMapper.xml:

    1. <?xml version="1.0" encoding="UTF-8" ?>
    2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
    3. <mapper namespace="com.bjpowernode.crm.settings.mapper.DicValueMapper" >
    4. <resultMap id="BaseResultMap" type="com.bjpowernode.crm.settings.domain.DicValue" >
    5. <!--
    6. WARNING - @mbggenerated
    7. This element is automatically generated by MyBatis Generator, do not modify.
    8. This element was generated on Tue Nov 03 17:09:33 CST 2020.
    9. -->
    10. <id column="id" property="id" jdbcType="CHAR" />
    11. <result column="value" property="value" jdbcType="VARCHAR" />
    12. <result column="text" property="text" jdbcType="VARCHAR" />
    13. <result column="order_no" property="orderNo" jdbcType="VARCHAR" />
    14. <result column="type_code" property="typeCode" jdbcType="VARCHAR" />
    15. </resultMap>
    16. <sql id="Base_Column_List" >
    17. <!--
    18. WARNING - @mbggenerated
    19. This element is automatically generated by MyBatis Generator, do not modify.
    20. This element was generated on Tue Nov 03 17:09:33 CST 2020.
    21. -->
    22. id, value, text, order_no, type_code
    23. </sql>
    24. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    25. <!--
    26. WARNING - @mbggenerated
    27. This element is automatically generated by MyBatis Generator, do not modify.
    28. This element was generated on Tue Nov 03 17:09:33 CST 2020.
    29. -->
    30. select
    31. <include refid="Base_Column_List" />
    32. from tbl_dic_value
    33. where id = #{id,jdbcType=CHAR}
    34. </select>
    35. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    36. <!--
    37. WARNING - @mbggenerated
    38. This element is automatically generated by MyBatis Generator, do not modify.
    39. This element was generated on Tue Nov 03 17:09:33 CST 2020.
    40. -->
    41. delete from tbl_dic_value
    42. where id = #{id,jdbcType=CHAR}
    43. </delete>
    44. <insert id="insert" parameterType="com.bjpowernode.crm.settings.domain.DicValue" >
    45. <!--
    46. WARNING - @mbggenerated
    47. This element is automatically generated by MyBatis Generator, do not modify.
    48. This element was generated on Tue Nov 03 17:09:33 CST 2020.
    49. -->
    50. insert into tbl_dic_value (id, value, text,
    51. order_no, type_code)
    52. values (#{id,jdbcType=CHAR}, #{value,jdbcType=VARCHAR}, #{text,jdbcType=VARCHAR},
    53. #{orderNo,jdbcType=VARCHAR}, #{typeCode,jdbcType=VARCHAR})
    54. </insert>
    55. <insert id="insertSelective" parameterType="com.bjpowernode.crm.settings.domain.DicValue" >
    56. <!--
    57. WARNING - @mbggenerated
    58. This element is automatically generated by MyBatis Generator, do not modify.
    59. This element was generated on Tue Nov 03 17:09:33 CST 2020.
    60. -->
    61. insert into tbl_dic_value
    62. <trim prefix="(" suffix=")" suffixOverrides="," >
    63. <if test="id != null" >
    64. id,
    65. </if>
    66. <if test="value != null" >
    67. value,
    68. </if>
    69. <if test="text != null" >
    70. text,
    71. </if>
    72. <if test="orderNo != null" >
    73. order_no,
    74. </if>
    75. <if test="typeCode != null" >
    76. type_code,
    77. </if>
    78. </trim>
    79. <trim prefix="values (" suffix=")" suffixOverrides="," >
    80. <if test="id != null" >
    81. #{id,jdbcType=CHAR},
    82. </if>
    83. <if test="value != null" >
    84. #{value,jdbcType=VARCHAR},
    85. </if>
    86. <if test="text != null" >
    87. #{text,jdbcType=VARCHAR},
    88. </if>
    89. <if test="orderNo != null" >
    90. #{orderNo,jdbcType=VARCHAR},
    91. </if>
    92. <if test="typeCode != null" >
    93. #{typeCode,jdbcType=VARCHAR},
    94. </if>
    95. </trim>
    96. </insert>
    97. <update id="updateByPrimaryKeySelective" parameterType="com.bjpowernode.crm.settings.domain.DicValue" >
    98. <!--
    99. WARNING - @mbggenerated
    100. This element is automatically generated by MyBatis Generator, do not modify.
    101. This element was generated on Tue Nov 03 17:09:33 CST 2020.
    102. -->
    103. update tbl_dic_value
    104. <set >
    105. <if test="value != null" >
    106. value = #{value,jdbcType=VARCHAR},
    107. </if>
    108. <if test="text != null" >
    109. text = #{text,jdbcType=VARCHAR},
    110. </if>
    111. <if test="orderNo != null" >
    112. order_no = #{orderNo,jdbcType=VARCHAR},
    113. </if>
    114. <if test="typeCode != null" >
    115. type_code = #{typeCode,jdbcType=VARCHAR},
    116. </if>
    117. </set>
    118. where id = #{id,jdbcType=CHAR}
    119. </update>
    120. <update id="updateByPrimaryKey" parameterType="com.bjpowernode.crm.settings.domain.DicValue" >
    121. <!--
    122. WARNING - @mbggenerated
    123. This element is automatically generated by MyBatis Generator, do not modify.
    124. This element was generated on Tue Nov 03 17:09:33 CST 2020.
    125. -->
    126. update tbl_dic_value
    127. set value = #{value,jdbcType=VARCHAR},
    128. text = #{text,jdbcType=VARCHAR},
    129. order_no = #{orderNo,jdbcType=VARCHAR},
    130. type_code = #{typeCode,jdbcType=VARCHAR}
    131. where id = #{id,jdbcType=CHAR}
    132. </update>
    133. <!--根据typeCode查询数据字典值 <include refid="Base_Column_List"/>:使用sql语句片段-->
    134. <select id="selectDicValueByTypeCode" parameterType="string" resultMap="BaseResultMap">
    135. select
    136. <include refid="Base_Column_List"/>
    137. from tbl_dic_value
    138. where type_code=#{typeCode}
    139. order by order_no asc
    140. </select>
    141. <select id="selectDicValueById" parameterType="string" resultMap="BaseResultMap">
    142. select <include refid="Base_Column_List" />
    143. from tbl_dic_value
    144. where id = #{id}
    145. </select>
    146. </mapper>

    UserMapper:

    1. package com.bjpowernode.crm.settings.mapper;
    2. import com.bjpowernode.crm.settings.domain.User;
    3. import java.util.List;
    4. import java.util.Map;
    5. public interface UserMapper {
    6. /**
    7. * This method was generated by MyBatis Generator.
    8. * This method corresponds to the database table tbl_user
    9. *
    10. * @mbggenerated Wed Sep 21 15:29:08 CST 2022
    11. */
    12. int deleteByPrimaryKey(String id);
    13. /**
    14. * This method was generated by MyBatis Generator.
    15. * This method corresponds to the database table tbl_user
    16. *
    17. * @mbggenerated Wed Sep 21 15:29:08 CST 2022
    18. */
    19. int insert(User record);
    20. /**
    21. * This method was generated by MyBatis Generator.
    22. * This method corresponds to the database table tbl_user
    23. *
    24. * @mbggenerated Wed Sep 21 15:29:08 CST 2022
    25. */
    26. int insertSelective(User record);
    27. /**
    28. * This method was generated by MyBatis Generator.
    29. * This method corresponds to the database table tbl_user
    30. *
    31. * @mbggenerated Wed Sep 21 15:29:08 CST 2022
    32. */
    33. User selectByPrimaryKey(String id);
    34. /**
    35. * This method was generated by MyBatis Generator.
    36. * This method corresponds to the database table tbl_user
    37. *
    38. * @mbggenerated Wed Sep 21 15:29:08 CST 2022
    39. */
    40. int updateByPrimaryKeySelective(User record);
    41. /**
    42. * This method was generated by MyBatis Generator.
    43. * This method corresponds to the database table tbl_user
    44. *
    45. * @mbggenerated Wed Sep 21 15:29:08 CST 2022
    46. */
    47. int updateByPrimaryKey(User record);
    48. //登录查询:根据账号和密码查询用户
    49. User selectUserByLoginActAndPwd(Map<String,Object> map);
    50. /**
    51. * 查询所有的用户
    52. * @return
    53. */
    54. List<User> selectAllUsers();
    55. }

     UserMapper.xml:

    1. <?xml version="1.0" encoding="UTF-8" ?>
    2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
    3. <mapper namespace="com.bjpowernode.crm.settings.mapper.UserMapper" >
    4. <resultMap id="BaseResultMap" type="com.bjpowernode.crm.settings.domain.User" >
    5. <!--
    6. WARNING - @mbggenerated
    7. This element is automatically generated by MyBatis Generator, do not modify.
    8. This element was generated on Wed Sep 21 15:29:08 CST 2022.
    9. -->
    10. <id column="id" property="id" jdbcType="CHAR" />
    11. <result column="login_act" property="loginAct" jdbcType="VARCHAR" />
    12. <result column="name" property="name" jdbcType="VARCHAR" />
    13. <result column="login_pwd" property="loginPwd" jdbcType="VARCHAR" />
    14. <result column="email" property="email" jdbcType="VARCHAR" />
    15. <result column="expire_time" property="expireTime" jdbcType="CHAR" />
    16. <result column="lock_state" property="lockState" jdbcType="CHAR" />
    17. <result column="deptno" property="deptno" jdbcType="CHAR" />
    18. <result column="allow_ips" property="allowIps" jdbcType="VARCHAR" />
    19. <result column="createTime" property="createtime" jdbcType="CHAR" />
    20. <result column="create_by" property="createBy" jdbcType="VARCHAR" />
    21. <result column="edit_time" property="editTime" jdbcType="CHAR" />
    22. <result column="edit_by" property="editBy" jdbcType="VARCHAR" />
    23. </resultMap>
    24. <sql id="Base_Column_List" >
    25. <!--
    26. WARNING - @mbggenerated
    27. This element is automatically generated by MyBatis Generator, do not modify.
    28. This element was generated on Wed Sep 21 15:29:08 CST 2022.
    29. -->
    30. id, login_act, name, login_pwd, email, expire_time, lock_state, deptno, allow_ips,
    31. createTime, create_by, edit_time, edit_by
    32. </sql>
    33. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    34. <!--
    35. WARNING - @mbggenerated
    36. This element is automatically generated by MyBatis Generator, do not modify.
    37. This element was generated on Wed Sep 21 15:29:08 CST 2022.
    38. -->
    39. select
    40. <include refid="Base_Column_List" />
    41. from tbl_user
    42. where id = #{id,jdbcType=CHAR}
    43. </select>
    44. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    45. <!--
    46. WARNING - @mbggenerated
    47. This element is automatically generated by MyBatis Generator, do not modify.
    48. This element was generated on Wed Sep 21 15:29:08 CST 2022.
    49. -->
    50. delete from tbl_user
    51. where id = #{id,jdbcType=CHAR}
    52. </delete>
    53. <insert id="insert" parameterType="com.bjpowernode.crm.settings.domain.User" >
    54. <!--
    55. WARNING - @mbggenerated
    56. This element is automatically generated by MyBatis Generator, do not modify.
    57. This element was generated on Wed Sep 21 15:29:08 CST 2022.
    58. -->
    59. insert into tbl_user (id, login_act, name,
    60. login_pwd, email, expire_time,
    61. lock_state, deptno, allow_ips,
    62. createTime, create_by, edit_time,
    63. edit_by)
    64. values (#{id,jdbcType=CHAR}, #{loginAct,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
    65. #{loginPwd,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{expireTime,jdbcType=CHAR},
    66. #{lockState,jdbcType=CHAR}, #{deptno,jdbcType=CHAR}, #{allowIps,jdbcType=VARCHAR},
    67. #{createtime,jdbcType=CHAR}, #{createBy,jdbcType=VARCHAR}, #{editTime,jdbcType=CHAR},
    68. #{editBy,jdbcType=VARCHAR})
    69. </insert>
    70. <insert id="insertSelective" parameterType="com.bjpowernode.crm.settings.domain.User" >
    71. <!--
    72. WARNING - @mbggenerated
    73. This element is automatically generated by MyBatis Generator, do not modify.
    74. This element was generated on Wed Sep 21 15:29:08 CST 2022.
    75. -->
    76. insert into tbl_user
    77. <trim prefix="(" suffix=")" suffixOverrides="," >
    78. <if test="id != null" >
    79. id,
    80. </if>
    81. <if test="loginAct != null" >
    82. login_act,
    83. </if>
    84. <if test="name != null" >
    85. name,
    86. </if>
    87. <if test="loginPwd != null" >
    88. login_pwd,
    89. </if>
    90. <if test="email != null" >
    91. email,
    92. </if>
    93. <if test="expireTime != null" >
    94. expire_time,
    95. </if>
    96. <if test="lockState != null" >
    97. lock_state,
    98. </if>
    99. <if test="deptno != null" >
    100. deptno,
    101. </if>
    102. <if test="allowIps != null" >
    103. allow_ips,
    104. </if>
    105. <if test="createtime != null" >
    106. createTime,
    107. </if>
    108. <if test="createBy != null" >
    109. create_by,
    110. </if>
    111. <if test="editTime != null" >
    112. edit_time,
    113. </if>
    114. <if test="editBy != null" >
    115. edit_by,
    116. </if>
    117. </trim>
    118. <trim prefix="values (" suffix=")" suffixOverrides="," >
    119. <if test="id != null" >
    120. #{id,jdbcType=CHAR},
    121. </if>
    122. <if test="loginAct != null" >
    123. #{loginAct,jdbcType=VARCHAR},
    124. </if>
    125. <if test="name != null" >
    126. #{name,jdbcType=VARCHAR},
    127. </if>
    128. <if test="loginPwd != null" >
    129. #{loginPwd,jdbcType=VARCHAR},
    130. </if>
    131. <if test="email != null" >
    132. #{email,jdbcType=VARCHAR},
    133. </if>
    134. <if test="expireTime != null" >
    135. #{expireTime,jdbcType=CHAR},
    136. </if>
    137. <if test="lockState != null" >
    138. #{lockState,jdbcType=CHAR},
    139. </if>
    140. <if test="deptno != null" >
    141. #{deptno,jdbcType=CHAR},
    142. </if>
    143. <if test="allowIps != null" >
    144. #{allowIps,jdbcType=VARCHAR},
    145. </if>
    146. <if test="createtime != null" >
    147. #{createtime,jdbcType=CHAR},
    148. </if>
    149. <if test="createBy != null" >
    150. #{createBy,jdbcType=VARCHAR},
    151. </if>
    152. <if test="editTime != null" >
    153. #{editTime,jdbcType=CHAR},
    154. </if>
    155. <if test="editBy != null" >
    156. #{editBy,jdbcType=VARCHAR},
    157. </if>
    158. </trim>
    159. </insert>
    160. <update id="updateByPrimaryKeySelective" parameterType="com.bjpowernode.crm.settings.domain.User" >
    161. <!--
    162. WARNING - @mbggenerated
    163. This element is automatically generated by MyBatis Generator, do not modify.
    164. This element was generated on Wed Sep 21 15:29:08 CST 2022.
    165. -->
    166. update tbl_user
    167. <set >
    168. <if test="loginAct != null" >
    169. login_act = #{loginAct,jdbcType=VARCHAR},
    170. </if>
    171. <if test="name != null" >
    172. name = #{name,jdbcType=VARCHAR},
    173. </if>
    174. <if test="loginPwd != null" >
    175. login_pwd = #{loginPwd,jdbcType=VARCHAR},
    176. </if>
    177. <if test="email != null" >
    178. email = #{email,jdbcType=VARCHAR},
    179. </if>
    180. <if test="expireTime != null" >
    181. expire_time = #{expireTime,jdbcType=CHAR},
    182. </if>
    183. <if test="lockState != null" >
    184. lock_state = #{lockState,jdbcType=CHAR},
    185. </if>
    186. <if test="deptno != null" >
    187. deptno = #{deptno,jdbcType=CHAR},
    188. </if>
    189. <if test="allowIps != null" >
    190. allow_ips = #{allowIps,jdbcType=VARCHAR},
    191. </if>
    192. <if test="createtime != null" >
    193. createTime = #{createtime,jdbcType=CHAR},
    194. </if>
    195. <if test="createBy != null" >
    196. create_by = #{createBy,jdbcType=VARCHAR},
    197. </if>
    198. <if test="editTime != null" >
    199. edit_time = #{editTime,jdbcType=CHAR},
    200. </if>
    201. <if test="editBy != null" >
    202. edit_by = #{editBy,jdbcType=VARCHAR},
    203. </if>
    204. </set>
    205. where id = #{id,jdbcType=CHAR}
    206. </update>
    207. <update id="updateByPrimaryKey" parameterType="com.bjpowernode.crm.settings.domain.User" >
    208. <!--
    209. WARNING - @mbggenerated
    210. This element is automatically generated by MyBatis Generator, do not modify.
    211. This element was generated on Wed Sep 21 15:29:08 CST 2022.
    212. -->
    213. update tbl_user
    214. set login_act = #{loginAct,jdbcType=VARCHAR},
    215. name = #{name,jdbcType=VARCHAR},
    216. login_pwd = #{loginPwd,jdbcType=VARCHAR},
    217. email = #{email,jdbcType=VARCHAR},
    218. expire_time = #{expireTime,jdbcType=CHAR},
    219. lock_state = #{lockState,jdbcType=CHAR},
    220. deptno = #{deptno,jdbcType=CHAR},
    221. allow_ips = #{allowIps,jdbcType=VARCHAR},
    222. createTime = #{createtime,jdbcType=CHAR},
    223. create_by = #{createBy,jdbcType=VARCHAR},
    224. edit_time = #{editTime,jdbcType=CHAR},
    225. edit_by = #{editBy,jdbcType=VARCHAR}
    226. where id = #{id,jdbcType=CHAR}
    227. </update>
    228. <!--查询登录sql <include refid="Base_Column_List"/> 复用上面所有字段-->
    229. <select id="selectUserByLoginActAndPwd" parameterType="map" resultMap="BaseResultMap">
    230. select
    231. <include refid="Base_Column_List"/>
    232. from tbl_user
    233. where login_act=#{loginAct} and login_pwd=#{loginPwd}
    234. </select>
    235. <!--查询所有用户 <include refid="Base_Column_List"/> 复用上面所有字段 -->
    236. <select id="selectAllUsers" resultMap="BaseResultMap">
    237. select
    238. <include refid="Base_Column_List"/>
    239. from tbl_user
    240. where lock_state='1'
    241. </select>
    242. </mapper>

     

    ActivityMapper:

    1. package com.bjpowernode.crm.workbench.mapper;
    2. import com.bjpowernode.crm.workbench.domain.Activity;
    3. import com.bjpowernode.crm.workbench.domain.FunnelVO;
    4. import java.util.List;
    5. import java.util.Map;
    6. public interface ActivityMapper {
    7. /**
    8. * This method was generated by MyBatis Generator.
    9. * This method corresponds to the database table tbl_activity
    10. *
    11. * @mbggenerated Fri Sep 23 16:59:16 CST 2022
    12. */
    13. int deleteByPrimaryKey(String id);
    14. /**
    15. * This method was generated by MyBatis Generator.
    16. * This method corresponds to the database table tbl_activity
    17. *
    18. * @mbggenerated Fri Sep 23 16:59:16 CST 2022
    19. */
    20. int insert(Activity record);
    21. /**
    22. * This method was generated by MyBatis Generator.
    23. * This method corresponds to the database table tbl_activity
    24. *
    25. * @mbggenerated Fri Sep 23 16:59:16 CST 2022
    26. */
    27. int insertSelective(Activity record);
    28. /**
    29. * This method was generated by MyBatis Generator.
    30. * This method corresponds to the database table tbl_activity
    31. *
    32. * @mbggenerated Fri Sep 23 16:59:16 CST 2022
    33. */
    34. Activity selectByPrimaryKey(String id);
    35. /**
    36. * This method was generated by MyBatis Generator.
    37. * This method corresponds to the database table tbl_activity
    38. *
    39. * @mbggenerated Fri Sep 23 16:59:16 CST 2022
    40. */
    41. int updateByPrimaryKeySelective(Activity record);
    42. /**
    43. * This method was generated by MyBatis Generator.
    44. * This method corresponds to the database table tbl_activity
    45. *
    46. * @mbggenerated Fri Sep 23 16:59:16 CST 2022
    47. */
    48. int updateByPrimaryKey(Activity record);
    49. //保存创建的市场活动
    50. int insertActivity(Activity record);
    51. /**
    52. * 根据条件分页查询市场活动的列表
    53. * @param map
    54. * @return
    55. */
    56. List<Activity> selectActivityByConditionForPage(Map<String,Object> map);
    57. /**
    58. * 根据条件查询市场活动的总条数
    59. * @param map
    60. * @return
    61. */
    62. int selectCountOfActivityByCondition(Map<String,Object> map);
    63. /**
    64. * 根据ids数组批量删除市场活动
    65. * @param ids
    66. * @return
    67. */
    68. int deleteActivityByIds(String[] ids);
    69. /**
    70. * 根据id查询市场活动的信息
    71. * @param id
    72. * @return
    73. */
    74. Activity selectActivityById(String id);
    75. /**
    76. * 保存修改的市场活动
    77. * @param activity
    78. * @return
    79. */
    80. int updateActivity(Activity activity);
    81. /**
    82. * 查询所有的市场活动进行导出
    83. * @return
    84. */
    85. List<Activity> selectAllActivitys();
    86. /**
    87. * 批量保存创建的市场活动
    88. * @param activityList
    89. * @return
    90. */
    91. int insertActivityByList(List<Activity> activityList);
    92. /**
    93. * 根据id查询市场活动的明细信息
    94. * @param id
    95. * @return
    96. */
    97. Activity selectActivityForDetailById(String id);
    98. /**
    99. * 根据clueId查询该线索相关联的市场活动的明细信息
    100. * @param clueId
    101. * @return
    102. */
    103. List<Activity> selectActivityForDetailByClueId(String clueId);
    104. /**
    105. * 根据name模糊查询市场活动,并且把已经跟clueId关联过的市场活动排除
    106. * @param map
    107. * @return
    108. */
    109. List<Activity> selectActivityForDetailByNameClueId(Map<String,Object> map);
    110. /**
    111. * 根据name模糊查询市场活动,并且查询那些跟clueId关联过的市场活动
    112. * @param map
    113. * @return
    114. */
    115. List<Activity> selectActivityForConvertByNameClueId(Map<String,Object> map);
    116. /**
    117. * 通过市场活动id数组查询所有市场活动
    118. * @param ids 市场活动id数组
    119. * @return 市场活动集合
    120. */
    121. List<Activity> selectActivityForDetailByIds(String[] ids);
    122. /**
    123. * 通过市场活动模糊查询市场活动,并且查询那些跟clueId关联过的市场活动
    124. * @param map 封装的线索id和市场活动名参数
    125. * @return 市场活动集合
    126. */
    127. List<Activity> selectActivityForConvertByNameAndClueId(Map<String, Object> map);
    128. /**
    129. * 通过联系人id查询该联系人绑定的所有市场活动
    130. * @param contactsId 联系人id
    131. * @return 市场活动集合
    132. */
    133. List<Activity> selectActivityForDetailByContactsId(String contactsId);
    134. /**
    135. * 通过市场活动名和联系人id模糊查询市场活动
    136. * @param map 封装的联系人id和市场活动名参数
    137. * @return 市场活动集合
    138. */
    139. List<Activity> selectActivityForDetailByNameAndContactsId(Map<String, Object> map);
    140. /**
    141. * 通过市场活动名称进行模糊查询
    142. * @param activityName 市场活动模糊名称
    143. * @return 查询到的对应的市场活动
    144. */
    145. List<Activity> selectActivityByFuzzyName(String activityName);
    146. /**
    147. * 查询市场活动表中各个所有者的数据量
    148. * @return 数据集合
    149. */
    150. List<FunnelVO> selectCountOfActivityGroupByOwner();
    151. }

     ActivityMappe.xmlr:

    1. <?xml version="1.0" encoding="UTF-8" ?>
    2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
    3. <mapper namespace="com.bjpowernode.crm.workbench.mapper.ActivityMapper" >
    4. <resultMap id="BaseResultMap" type="com.bjpowernode.crm.workbench.domain.Activity" >
    5. <!--
    6. WARNING - @mbggenerated
    7. This element is automatically generated by MyBatis Generator, do not modify.
    8. This element was generated on Fri Sep 23 16:59:16 CST 2022.
    9. -->
    10. <id column="id" property="id" jdbcType="CHAR" />
    11. <result column="owner" property="owner" jdbcType="CHAR" />
    12. <result column="name" property="name" jdbcType="VARCHAR" />
    13. <result column="start_date" property="startDate" jdbcType="CHAR" />
    14. <result column="end_date" property="endDate" jdbcType="CHAR" />
    15. <result column="cost" property="cost" jdbcType="VARCHAR" />
    16. <result column="description" property="description" jdbcType="VARCHAR" />
    17. <result column="create_time" property="createTime" jdbcType="CHAR" />
    18. <result column="create_by" property="createBy" jdbcType="VARCHAR" />
    19. <result column="edit_time" property="editTime" jdbcType="CHAR" />
    20. <result column="edit_by" property="editBy" jdbcType="VARCHAR" />
    21. </resultMap>
    22. <sql id="Base_Column_List" >
    23. <!--
    24. WARNING - @mbggenerated
    25. This element is automatically generated by MyBatis Generator, do not modify.
    26. This element was generated on Fri Sep 23 16:59:16 CST 2022.
    27. -->
    28. id, owner, name, start_date, end_date, cost, description, create_time, create_by,
    29. edit_time, edit_by
    30. </sql>
    31. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    32. <!--
    33. WARNING - @mbggenerated
    34. This element is automatically generated by MyBatis Generator, do not modify.
    35. This element was generated on Fri Sep 23 16:59:16 CST 2022.
    36. -->
    37. select
    38. <include refid="Base_Column_List" />
    39. from tbl_activity
    40. where id = #{id,jdbcType=CHAR}
    41. </select>
    42. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    43. <!--
    44. WARNING - @mbggenerated
    45. This element is automatically generated by MyBatis Generator, do not modify.
    46. This element was generated on Fri Sep 23 16:59:16 CST 2022.
    47. -->
    48. delete from tbl_activity
    49. where id = #{id,jdbcType=CHAR}
    50. </delete>
    51. <insert id="insertSelective" parameterType="com.bjpowernode.crm.workbench.domain.Activity" >
    52. <!--
    53. WARNING - @mbggenerated
    54. This element is automatically generated by MyBatis Generator, do not modify.
    55. This element was generated on Fri Sep 23 16:59:16 CST 2022.
    56. -->
    57. insert into tbl_activity
    58. <trim prefix="(" suffix=")" suffixOverrides="," >
    59. <if test="id != null" >
    60. id,
    61. </if>
    62. <if test="owner != null" >
    63. owner,
    64. </if>
    65. <if test="name != null" >
    66. name,
    67. </if>
    68. <if test="startDate != null" >
    69. start_date,
    70. </if>
    71. <if test="endDate != null" >
    72. end_date,
    73. </if>
    74. <if test="cost != null" >
    75. cost,
    76. </if>
    77. <if test="description != null" >
    78. description,
    79. </if>
    80. <if test="createTime != null" >
    81. create_time,
    82. </if>
    83. <if test="createBy != null" >
    84. create_by,
    85. </if>
    86. <if test="editTime != null" >
    87. edit_time,
    88. </if>
    89. <if test="editBy != null" >
    90. edit_by,
    91. </if>
    92. </trim>
    93. <trim prefix="values (" suffix=")" suffixOverrides="," >
    94. <if test="id != null" >
    95. #{id,jdbcType=CHAR},
    96. </if>
    97. <if test="owner != null" >
    98. #{owner,jdbcType=CHAR},
    99. </if>
    100. <if test="name != null" >
    101. #{name,jdbcType=VARCHAR},
    102. </if>
    103. <if test="startDate != null" >
    104. #{startDate,jdbcType=CHAR},
    105. </if>
    106. <if test="endDate != null" >
    107. #{endDate,jdbcType=CHAR},
    108. </if>
    109. <if test="cost != null" >
    110. #{cost,jdbcType=VARCHAR},
    111. </if>
    112. <if test="description != null" >
    113. #{description,jdbcType=VARCHAR},
    114. </if>
    115. <if test="createTime != null" >
    116. #{createTime,jdbcType=CHAR},
    117. </if>
    118. <if test="createBy != null" >
    119. #{createBy,jdbcType=VARCHAR},
    120. </if>
    121. <if test="editTime != null" >
    122. #{editTime,jdbcType=CHAR},
    123. </if>
    124. <if test="editBy != null" >
    125. #{editBy,jdbcType=VARCHAR},
    126. </if>
    127. </trim>
    128. </insert>
    129. <update id="updateByPrimaryKeySelective" parameterType="com.bjpowernode.crm.workbench.domain.Activity" >
    130. <!--
    131. WARNING - @mbggenerated
    132. This element is automatically generated by MyBatis Generator, do not modify.
    133. This element was generated on Fri Sep 23 16:59:16 CST 2022.
    134. -->
    135. update tbl_activity
    136. <set >
    137. <if test="owner != null" >
    138. owner = #{owner,jdbcType=CHAR},
    139. </if>
    140. <if test="name != null" >
    141. name = #{name,jdbcType=VARCHAR},
    142. </if>
    143. <if test="startDate != null" >
    144. start_date = #{startDate,jdbcType=CHAR},
    145. </if>
    146. <if test="endDate != null" >
    147. end_date = #{endDate,jdbcType=CHAR},
    148. </if>
    149. <if test="cost != null" >
    150. cost = #{cost,jdbcType=VARCHAR},
    151. </if>
    152. <if test="description != null" >
    153. description = #{description,jdbcType=VARCHAR},
    154. </if>
    155. <if test="createTime != null" >
    156. create_time = #{createTime,jdbcType=CHAR},
    157. </if>
    158. <if test="createBy != null" >
    159. create_by = #{createBy,jdbcType=VARCHAR},
    160. </if>
    161. <if test="editTime != null" >
    162. edit_time = #{editTime,jdbcType=CHAR},
    163. </if>
    164. <if test="editBy != null" >
    165. edit_by = #{editBy,jdbcType=VARCHAR},
    166. </if>
    167. </set>
    168. where id = #{id,jdbcType=CHAR}
    169. </update>
    170. <update id="updateByPrimaryKey" parameterType="com.bjpowernode.crm.workbench.domain.Activity" >
    171. <!--
    172. WARNING - @mbggenerated
    173. This element is automatically generated by MyBatis Generator, do not modify.
    174. This element was generated on Fri Sep 23 16:59:16 CST 2022.
    175. -->
    176. update tbl_activity
    177. set owner = #{owner,jdbcType=CHAR},
    178. name = #{name,jdbcType=VARCHAR},
    179. start_date = #{startDate,jdbcType=CHAR},
    180. end_date = #{endDate,jdbcType=CHAR},
    181. cost = #{cost,jdbcType=VARCHAR},
    182. description = #{description,jdbcType=VARCHAR},
    183. create_time = #{createTime,jdbcType=CHAR},
    184. create_by = #{createBy,jdbcType=VARCHAR},
    185. edit_time = #{editTime,jdbcType=CHAR},
    186. edit_by = #{editBy,jdbcType=VARCHAR}
    187. where id = #{id,jdbcType=CHAR}
    188. </update>
    189. <!--添加市场活动-->
    190. <insert id="insertActivity" parameterType="com.bjpowernode.crm.workbench.domain.Activity" >
    191. <!--
    192. WARNING - @mbggenerated
    193. This element is automatically generated by MyBatis Generator, do not modify.
    194. This element was generated on Thu Oct 22 08:57:21 CST 2020.
    195. -->
    196. insert into tbl_activity (id, owner, name, start_date,
    197. end_date, cost, description,
    198. create_time, create_by)
    199. values (#{id,jdbcType=CHAR}, #{owner,jdbcType=CHAR}, #{name,jdbcType=VARCHAR}, #{startDate,jdbcType=CHAR},
    200. #{endDate,jdbcType=CHAR}, #{cost,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
    201. #{createTime,jdbcType=CHAR}, #{createBy,jdbcType=VARCHAR})
    202. </insert>
    203. <!--条件分页查询市场活动的列表-->
    204. <select id="selectActivityByConditionForPage" parameterType="map" resultMap="BaseResultMap">
    205. select a.id,u1.name as owner,a.name,a.start_date,a.end_date,a.cost,a.description,a.create_time,
    206. u2.name as create_by,a.edit_time,u3.name as edit_by
    207. from tbl_activity a
    208. join tbl_user u1 on a.owner=u1.id
    209. join tbl_user u2 on a.create_by=u2.id
    210. left join tbl_user u3 on a.edit_by=u3.id
    211. <where>
    212. <if test="name!=null and name!=''">
    213. and a.name like '%' #{name} '%'
    214. </if>
    215. <if test="owner!=null and owner!=''">
    216. and u1.name like '%' #{owner} '%'
    217. </if>
    218. <if test="startDate!=null and startDate!=''">
    219. and a.start_date&gt;=#{startDate}
    220. </if>
    221. <if test="endDate!=null and endDate!=''">
    222. and a.end_date&lt;=#{endDate}
    223. </if>
    224. </where>
    225. order by a.create_time desc
    226. limit #{beginNo},#{pageSize}
    227. </select>
    228. <!--根据条件查询市场活动的总条数-->
    229. <select id="selectCountOfActivityByCondition" parameterType="map" resultType="int">
    230. select count(*)
    231. from tbl_activity a
    232. join tbl_user u1 on a.owner=u1.id
    233. join tbl_user u2 on a.create_by=u2.id
    234. left join tbl_user u3 on a.edit_by=u3.id
    235. <where>
    236. <if test="name!=null and name!=''">
    237. and a.name like '%' #{name} '%'
    238. </if>
    239. <if test="owner!=null and owner!=''">
    240. and u1.name like '%' #{owner} '%'
    241. </if>
    242. <if test="startDate!=null and startDate!=''">
    243. and a.start_date&gt;=#{startDate}
    244. </if>
    245. <if test="endDate!=null and endDate!=''">
    246. and a.end_date&lt;=#{endDate}
    247. </if>
    248. </where>
    249. </select>
    250. <!--根据ids数组批量删除市场活动-->
    251. <delete id="deleteActivityByIds" parameterType="string">
    252. delete from tbl_activity where id in
    253. <foreach collection="array" item="id" separator="," open="(" close=")">
    254. #{id}
    255. </foreach>
    256. </delete>
    257. <!--根据id查询市场活动的信息 引用sql语句片段-->
    258. <select id="selectActivityById" parameterType="string" resultMap="BaseResultMap">
    259. select
    260. <include refid="Base_Column_List"/>
    261. from tbl_activity
    262. where id=#{id}
    263. </select>
    264. <!--保存修改的市场活动-->
    265. <update id="updateActivity" parameterType="com.bjpowernode.crm.workbench.domain.Activity">
    266. update tbl_activity
    267. set owner=#{owner},name=#{name},start_date=#{startDate},end_date=#{endDate},cost=#{cost},description=#{description},
    268. edit_time=#{editTime},edit_by=#{editBy}
    269. where id=#{id}
    270. </update>
    271. <!--查询所有的市场活动进行导出-->
    272. <select id="selectAllActivitys" resultMap="BaseResultMap">
    273. select a.id,u1.name as owner,a.name,a.start_date,a.end_date,a.cost,a.description,a.create_time,
    274. u2.name as create_by,a.edit_time,u3.name as edit_by
    275. from tbl_activity a
    276. join tbl_user u1 on a.owner=u1.id
    277. join tbl_user u2 on a.create_by=u2.id
    278. left join tbl_user u3 on a.edit_by=u3.id
    279. order by a.create_time desc
    280. </select>
    281. <!--批量保存创建的市场活动-->
    282. <insert id="insertActivityByList" parameterType="com.bjpowernode.crm.workbench.domain.Activity">
    283. insert into tbl_activity(id, owner, name, start_date, end_date, cost, description, create_time, create_by)
    284. values
    285. <foreach collection="list" item="obj" separator=",">
    286. (#{obj.id},#{obj.owner},#{obj.name},#{obj.startDate},#{obj.endDate},#{obj.cost},#{obj.description},#{obj.createTime},#{obj.createBy})
    287. </foreach>
    288. </insert>
    289. <!--根据id查询市场活动的明细信息-->
    290. <select id="selectActivityForDetailById" parameterType="string" resultMap="BaseResultMap">
    291. select a.id,u1.name as owner,a.name,a.start_date,a.end_date,a.cost,a.description,a.create_time,u2.name as create_by,
    292. a.edit_time,u3.name as edit_by
    293. from tbl_activity a
    294. join tbl_user u1 on a.owner=u1.id
    295. join tbl_user u2 on a.create_by=u2.id
    296. left join tbl_user u3 on a.edit_by=u3.id
    297. where a.id=#{id}
    298. </select>
    299. <!--根据clueId查询该线索相关联的市场活动的明细信息-->
    300. <select id="selectActivityForDetailByClueId" parameterType="string" resultMap="BaseResultMap">
    301. select a.id,a.name,a.start_date,a.end_date,u.name as owner
    302. from tbl_activity a
    303. join tbl_user u on a.owner=u.id
    304. join tbl_clue_activity_relation car on car.activity_id=a.id
    305. where car.clue_id=#{clueId}
    306. </select>
    307. <!--根据name模糊查询市场活动,并且把已经跟clueId关联过的市场活动排除-->
    308. <select id="selectActivityForDetailByNameClueId" parameterType="map" resultMap="BaseResultMap">
    309. select a.id,a.name,a.start_date,a.end_date,u.name as owner
    310. from tbl_activity a
    311. join tbl_user u on a.owner=u.id
    312. where a.name like '%' #{activityName} '%' and a.id not in (
    313. select activity_id
    314. from tbl_clue_activity_relation
    315. where clue_id=#{clueId}
    316. )
    317. </select>
    318. <!--通过市场活动id数组查询所有市场活动-->
    319. <select id="selectActivityForDetailByIds" parameterType="string" resultMap="BaseResultMap">
    320. select a.id,a.name,a.start_date,a.end_date,u.name as owner
    321. from tbl_activity a
    322. join tbl_user u on a.owner=u.id
    323. where a.id in
    324. <foreach collection="array" item="id" separator="," open="(" close=")">
    325. #{id, jdbcType=VARCHAR}
    326. </foreach>
    327. </select>
    328. <!--通过市场活动模糊查询市场活动,并且查询那些跟clueId关联过的市场活动-->
    329. <select id="selectActivityForConvertByNameAndClueId" parameterType="map" resultMap="BaseResultMap">
    330. select a.id,a.name,a.start_date,a.end_date,u.name as owner
    331. from tbl_activity a
    332. join tbl_user u on a.owner=u.id
    333. where a.name like '%' #{activityName} '%' and a.id in (
    334. select activity_id
    335. from tbl_clue_activity_relation
    336. where clue_id=#{clueId}
    337. )
    338. </select>
    339. <select id="selectActivityForDetailByContactsId" parameterType="string" resultMap="BaseResultMap">
    340. select a.id,a.name,a.start_date,a.end_date,u.name as owner
    341. from tbl_activity a
    342. join tbl_user u on a.owner=u.id
    343. join tbl_contacts_activity_relation car on car.activity_id=a.id
    344. where car.contacts_id=#{contactsId}
    345. </select>
    346. <select id="selectActivityForDetailByNameAndContactsId" parameterType="map" resultMap="BaseResultMap">
    347. select a.id,a.name,a.start_date,a.end_date,u.name as owner
    348. from tbl_activity a
    349. join tbl_user u on a.owner=u.id
    350. where a.name like '%' #{activityName} '%' and a.id not in (
    351. select activity_id
    352. from tbl_contacts_activity_relation
    353. where contacts_id=#{contactsId}
    354. )
    355. </select>
    356. <select id="selectActivityByFuzzyName" parameterType="string" resultMap="BaseResultMap">
    357. select a.id,a.name,a.start_date,a.end_date,u.name as owner
    358. from tbl_activity a
    359. join tbl_user u on a.owner=u.id
    360. where a.name like '%' #{activityName} '%';
    361. </select>
    362. <select id="selectCountOfActivityGroupByOwner" resultType="com.bjpowernode.crm.workbench.domain.FunnelVO">
    363. select count(*) as value,u.name as name
    364. from tbl_activity a
    365. join tbl_user u on a.owner=u.id
    366. group by u.name
    367. </select>
    368. </mapper>

    ActivityRemarkMapper:

    1. package com.bjpowernode.crm.workbench.mapper;
    2. import com.bjpowernode.crm.workbench.domain.ActivityRemark;
    3. import java.util.List;
    4. public interface ActivityRemarkMapper {
    5. /**
    6. * This method was generated by MyBatis Generator.
    7. * This method corresponds to the database table tbl_activity_remark
    8. *
    9. * @mbggenerated Sat Oct 31 14:13:10 CST 2020
    10. */
    11. int deleteByPrimaryKey(String id);
    12. /**
    13. * This method was generated by MyBatis Generator.
    14. * This method corresponds to the database table tbl_activity_remark
    15. *
    16. * @mbggenerated Sat Oct 31 14:13:10 CST 2020
    17. */
    18. int insert(ActivityRemark record);
    19. /**
    20. * This method was generated by MyBatis Generator.
    21. * This method corresponds to the database table tbl_activity_remark
    22. *
    23. * @mbggenerated Sat Oct 31 14:13:10 CST 2020
    24. */
    25. int insertSelective(ActivityRemark record);
    26. /**
    27. * This method was generated by MyBatis Generator.
    28. * This method corresponds to the database table tbl_activity_remark
    29. *
    30. * @mbggenerated Sat Oct 31 14:13:10 CST 2020
    31. */
    32. ActivityRemark selectByPrimaryKey(String id);
    33. /**
    34. * This method was generated by MyBatis Generator.
    35. * This method corresponds to the database table tbl_activity_remark
    36. *
    37. * @mbggenerated Sat Oct 31 14:13:10 CST 2020
    38. */
    39. int updateByPrimaryKeySelective(ActivityRemark record);
    40. /**
    41. * This method was generated by MyBatis Generator.
    42. * This method corresponds to the database table tbl_activity_remark
    43. *
    44. * @mbggenerated Sat Oct 31 14:13:10 CST 2020
    45. */
    46. int updateByPrimaryKey(ActivityRemark record);
    47. /**
    48. * 根据activityId查询该市场活动下所有备注的明细信息
    49. * @param activityId
    50. * @return
    51. */
    52. List<ActivityRemark> selectActivityRemarkForDetailByActivityId(String activityId);
    53. /**
    54. * 保存创建的市场活动备注
    55. * @param remark
    56. * @return
    57. */
    58. int insertActivityRemark(ActivityRemark remark);
    59. /**
    60. * 根据id删除市场活动备注
    61. * @param id
    62. * @return
    63. */
    64. int deleteActivityRemarkById(String id);
    65. /**
    66. * 保存修改的市场活动备注
    67. * @param remark
    68. * @return
    69. */
    70. int updateActivityRemark(ActivityRemark remark);
    71. }

    ActivityRemarkMapper.xml:

    1. <?xml version="1.0" encoding="UTF-8" ?>
    2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
    3. <mapper namespace="com.bjpowernode.crm.workbench.mapper.ActivityRemarkMapper" >
    4. <resultMap id="BaseResultMap" type="com.bjpowernode.crm.workbench.domain.ActivityRemark" >
    5. <!--
    6. WARNING - @mbggenerated
    7. This element is automatically generated by MyBatis Generator, do not modify.
    8. This element was generated on Sat Oct 31 14:13:10 CST 2020.
    9. -->
    10. <id column="id" property="id" jdbcType="CHAR" />
    11. <result column="note_content" property="noteContent" jdbcType="VARCHAR" />
    12. <result column="create_time" property="createTime" jdbcType="CHAR" />
    13. <result column="create_by" property="createBy" jdbcType="VARCHAR" />
    14. <result column="edit_time" property="editTime" jdbcType="CHAR" />
    15. <result column="edit_by" property="editBy" jdbcType="VARCHAR" />
    16. <result column="edit_flag" property="editFlag" jdbcType="CHAR" />
    17. <result column="activity_id" property="activityId" jdbcType="CHAR" />
    18. </resultMap>
    19. <sql id="Base_Column_List" >
    20. <!--
    21. WARNING - @mbggenerated
    22. This element is automatically generated by MyBatis Generator, do not modify.
    23. This element was generated on Sat Oct 31 14:13:10 CST 2020.
    24. -->
    25. id, note_content, create_time, create_by, edit_time, edit_by, edit_flag, activity_id
    26. </sql>
    27. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    28. <!--
    29. WARNING - @mbggenerated
    30. This element is automatically generated by MyBatis Generator, do not modify.
    31. This element was generated on Sat Oct 31 14:13:10 CST 2020.
    32. -->
    33. select
    34. <include refid="Base_Column_List" />
    35. from tbl_activity_remark
    36. where id = #{id,jdbcType=CHAR}
    37. </select>
    38. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    39. <!--
    40. WARNING - @mbggenerated
    41. This element is automatically generated by MyBatis Generator, do not modify.
    42. This element was generated on Sat Oct 31 14:13:10 CST 2020.
    43. -->
    44. delete from tbl_activity_remark
    45. where id = #{id,jdbcType=CHAR}
    46. </delete>
    47. <insert id="insert" parameterType="com.bjpowernode.crm.workbench.domain.ActivityRemark" >
    48. <!--
    49. WARNING - @mbggenerated
    50. This element is automatically generated by MyBatis Generator, do not modify.
    51. This element was generated on Sat Oct 31 14:13:10 CST 2020.
    52. -->
    53. insert into tbl_activity_remark (id, note_content, create_time,
    54. create_by, edit_time, edit_by,
    55. edit_flag, activity_id)
    56. values (#{id,jdbcType=CHAR}, #{noteContent,jdbcType=VARCHAR}, #{createTime,jdbcType=CHAR},
    57. #{createBy,jdbcType=VARCHAR}, #{editTime,jdbcType=CHAR}, #{editBy,jdbcType=VARCHAR},
    58. #{editFlag,jdbcType=CHAR}, #{activityId,jdbcType=CHAR})
    59. </insert>
    60. <insert id="insertSelective" parameterType="com.bjpowernode.crm.workbench.domain.ActivityRemark" >
    61. <!--
    62. WARNING - @mbggenerated
    63. This element is automatically generated by MyBatis Generator, do not modify.
    64. This element was generated on Sat Oct 31 14:13:10 CST 2020.
    65. -->
    66. insert into tbl_activity_remark
    67. <trim prefix="(" suffix=")" suffixOverrides="," >
    68. <if test="id != null" >
    69. id,
    70. </if>
    71. <if test="noteContent != null" >
    72. note_content,
    73. </if>
    74. <if test="createTime != null" >
    75. create_time,
    76. </if>
    77. <if test="createBy != null" >
    78. create_by,
    79. </if>
    80. <if test="editTime != null" >
    81. edit_time,
    82. </if>
    83. <if test="editBy != null" >
    84. edit_by,
    85. </if>
    86. <if test="editFlag != null" >
    87. edit_flag,
    88. </if>
    89. <if test="activityId != null" >
    90. activity_id,
    91. </if>
    92. </trim>
    93. <trim prefix="values (" suffix=")" suffixOverrides="," >
    94. <if test="id != null" >
    95. #{id,jdbcType=CHAR},
    96. </if>
    97. <if test="noteContent != null" >
    98. #{noteContent,jdbcType=VARCHAR},
    99. </if>
    100. <if test="createTime != null" >
    101. #{createTime,jdbcType=CHAR},
    102. </if>
    103. <if test="createBy != null" >
    104. #{createBy,jdbcType=VARCHAR},
    105. </if>
    106. <if test="editTime != null" >
    107. #{editTime,jdbcType=CHAR},
    108. </if>
    109. <if test="editBy != null" >
    110. #{editBy,jdbcType=VARCHAR},
    111. </if>
    112. <if test="editFlag != null" >
    113. #{editFlag,jdbcType=CHAR},
    114. </if>
    115. <if test="activityId != null" >
    116. #{activityId,jdbcType=CHAR},
    117. </if>
    118. </trim>
    119. </insert>
    120. <update id="updateByPrimaryKeySelective" parameterType="com.bjpowernode.crm.workbench.domain.ActivityRemark" >
    121. <!--
    122. WARNING - @mbggenerated
    123. This element is automatically generated by MyBatis Generator, do not modify.
    124. This element was generated on Sat Oct 31 14:13:10 CST 2020.
    125. -->
    126. update tbl_activity_remark
    127. <set >
    128. <if test="noteContent != null" >
    129. note_content = #{noteContent,jdbcType=VARCHAR},
    130. </if>
    131. <if test="createTime != null" >
    132. create_time = #{createTime,jdbcType=CHAR},
    133. </if>
    134. <if test="createBy != null" >
    135. create_by = #{createBy,jdbcType=VARCHAR},
    136. </if>
    137. <if test="editTime != null" >
    138. edit_time = #{editTime,jdbcType=CHAR},
    139. </if>
    140. <if test="editBy != null" >
    141. edit_by = #{editBy,jdbcType=VARCHAR},
    142. </if>
    143. <if test="editFlag != null" >
    144. edit_flag = #{editFlag,jdbcType=CHAR},
    145. </if>
    146. <if test="activityId != null" >
    147. activity_id = #{activityId,jdbcType=CHAR},
    148. </if>
    149. </set>
    150. where id = #{id,jdbcType=CHAR}
    151. </update>
    152. <update id="updateByPrimaryKey" parameterType="com.bjpowernode.crm.workbench.domain.ActivityRemark" >
    153. <!--
    154. WARNING - @mbggenerated
    155. This element is automatically generated by MyBatis Generator, do not modify.
    156. This element was generated on Sat Oct 31 14:13:10 CST 2020.
    157. -->
    158. update tbl_activity_remark
    159. set note_content = #{noteContent,jdbcType=VARCHAR},
    160. create_time = #{createTime,jdbcType=CHAR},
    161. create_by = #{createBy,jdbcType=VARCHAR},
    162. edit_time = #{editTime,jdbcType=CHAR},
    163. edit_by = #{editBy,jdbcType=VARCHAR},
    164. edit_flag = #{editFlag,jdbcType=CHAR},
    165. activity_id = #{activityId,jdbcType=CHAR}
    166. where id = #{id,jdbcType=CHAR}
    167. </update>
    168. <!--根据activityId查询该市场活动下所有备注的明细信息-->
    169. <select id="selectActivityRemarkForDetailByActivityId" parameterType="string" resultMap="BaseResultMap">
    170. select ar.id,ar.note_content,ar.create_time,u1.name as create_by,ar.edit_time,u2.name as edit_by,ar.edit_flag
    171. from tbl_activity_remark ar
    172. join tbl_user u1 on ar.create_by=u1.id
    173. left join tbl_user u2 on ar.edit_by=u2.id
    174. where ar.activity_id=#{activityId}
    175. order by ar.create_time asc
    176. </select>
    177. <!--保存创建的市场活动备注-->
    178. <insert id="insertActivityRemark" parameterType="com.bjpowernode.crm.workbench.domain.ActivityRemark">
    179. insert into tbl_activity_remark(id, note_content, create_time, create_by, edit_flag, activity_id)
    180. values(#{id},#{ noteContent},#{ createTime},#{ createBy},#{ editFlag},#{ activityId})
    181. </insert>
    182. <!--根据id删除市场活动备注-->
    183. <delete id="deleteActivityRemarkById" parameterType="string">
    184. delete from tbl_activity_remark where id=#{id}
    185. </delete>
    186. <!--保存修改的市场活动备注-->
    187. <update id="updateActivityRemark" parameterType="com.bjpowernode.crm.workbench.domain.ActivityRemark">
    188. update tbl_activity_remark
    189. set note_content=#{noteContent},edit_time=#{editTime},edit_by=#{editBy},edit_flag=#{editFlag}
    190. where id=#{id}
    191. </update>
    192. </mapper>

    ClueActivityRelationMapper:

    1. package com.bjpowernode.crm.workbench.mapper;
    2. import com.bjpowernode.crm.workbench.domain.ClueActivityRelation;
    3. import java.util.List;
    4. public interface ClueActivityRelationMapper {
    5. /**
    6. * This method was generated by MyBatis Generator.
    7. * This method corresponds to the database table tbl_clue_activity_relation
    8. *
    9. * @mbggenerated Sun Mar 20 16:47:36 CST 2022
    10. */
    11. int deleteByPrimaryKey(String id);
    12. /**
    13. * This method was generated by MyBatis Generator.
    14. * This method corresponds to the database table tbl_clue_activity_relation
    15. *
    16. * @mbggenerated Sun Mar 20 16:47:36 CST 2022
    17. */
    18. int insert(ClueActivityRelation record);
    19. /**
    20. * This method was generated by MyBatis Generator.
    21. * This method corresponds to the database table tbl_clue_activity_relation
    22. *
    23. * @mbggenerated Sun Mar 20 16:47:36 CST 2022
    24. */
    25. int insertSelective(ClueActivityRelation record);
    26. /**
    27. * This method was generated by MyBatis Generator.
    28. * This method corresponds to the database table tbl_clue_activity_relation
    29. *
    30. * @mbggenerated Sun Mar 20 16:47:36 CST 2022
    31. */
    32. ClueActivityRelation selectByPrimaryKey(String id);
    33. /**
    34. * This method was generated by MyBatis Generator.
    35. * This method corresponds to the database table tbl_clue_activity_relation
    36. *
    37. * @mbggenerated Sun Mar 20 16:47:36 CST 2022
    38. */
    39. int updateByPrimaryKeySelective(ClueActivityRelation record);
    40. /**
    41. * This method was generated by MyBatis Generator.
    42. * This method corresponds to the database table tbl_clue_activity_relation
    43. *
    44. * @mbggenerated Sun Mar 20 16:47:36 CST 2022
    45. */
    46. int updateByPrimaryKey(ClueActivityRelation record);
    47. /**
    48. * 批量保存线索新增关联的市场活动
    49. * @param clueActivityRelationList 线索和市场活动的关联关系集合
    50. * @return 新增条数
    51. */
    52. int insertCreateClueActivityRelationByList(List<ClueActivityRelation> clueActivityRelationList);
    53. /**
    54. * 通过市场活动id和线索id删除两者间的关系(绑定的市场活动)
    55. * @param clueActivityRelation 线索和市场活动的关联关系
    56. * @return 删除条数
    57. */
    58. int deleteClueActivityRelationByClueIdAndActivityId(ClueActivityRelation clueActivityRelation);
    59. /**
    60. * 通过线索id数组(因为可能删除多个线索和市场活动对应的关联关系)
    61. * @param clueIds 线索id数组
    62. * @return 删除的条数
    63. */
    64. int deleteClueActivityRelationByClueIds(String[] clueIds);
    65. /**
    66. * 通过线索id查询所有对应线索和市场活动关联关系
    67. * @param clueId 线索id
    68. * @return 关联关系集合
    69. */
    70. List<ClueActivityRelation> selectClueActivityRelationByClueId(String clueId);
    71. }

     ClueActivityRelationMapper.xml:

    1. <?xml version="1.0" encoding="UTF-8" ?>
    2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
    3. <mapper namespace="com.bjpowernode.crm.workbench.mapper.ClueActivityRelationMapper" >
    4. <resultMap id="BaseResultMap" type="com.bjpowernode.crm.workbench.domain.ClueActivityRelation" >
    5. <!--
    6. WARNING - @mbggenerated
    7. This element is automatically generated by MyBatis Generator, do not modify.
    8. This element was generated on Sun Mar 20 16:47:36 CST 2022.
    9. -->
    10. <id column="id" property="id" jdbcType="CHAR" />
    11. <result column="clue_id" property="clueId" jdbcType="CHAR" />
    12. <result column="activity_id" property="activityId" jdbcType="CHAR" />
    13. </resultMap>
    14. <sql id="Base_Column_List" >
    15. <!--
    16. WARNING - @mbggenerated
    17. This element is automatically generated by MyBatis Generator, do not modify.
    18. This element was generated on Sun Mar 20 16:47:36 CST 2022.
    19. -->
    20. id, clue_id, activity_id
    21. </sql>
    22. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    23. <!--
    24. WARNING - @mbggenerated
    25. This element is automatically generated by MyBatis Generator, do not modify.
    26. This element was generated on Sun Mar 20 16:47:36 CST 2022.
    27. -->
    28. select
    29. <include refid="Base_Column_List" />
    30. from tbl_clue_activity_relation
    31. where id = #{id,jdbcType=CHAR}
    32. </select>
    33. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    34. <!--
    35. WARNING - @mbggenerated
    36. This element is automatically generated by MyBatis Generator, do not modify.
    37. This element was generated on Sun Mar 20 16:47:36 CST 2022.
    38. -->
    39. delete from tbl_clue_activity_relation
    40. where id = #{id,jdbcType=CHAR}
    41. </delete>
    42. <insert id="insert" parameterType="com.bjpowernode.crm.workbench.domain.ClueActivityRelation" >
    43. <!--
    44. WARNING - @mbggenerated
    45. This element is automatically generated by MyBatis Generator, do not modify.
    46. This element was generated on Sun Mar 20 16:47:36 CST 2022.
    47. -->
    48. insert into tbl_clue_activity_relation (id, clue_id, activity_id
    49. )
    50. values (#{id,jdbcType=CHAR}, #{clueId,jdbcType=CHAR}, #{activityId,jdbcType=CHAR}
    51. )
    52. </insert>
    53. <insert id="insertSelective" parameterType="com.bjpowernode.crm.workbench.domain.ClueActivityRelation" >
    54. <!--
    55. WARNING - @mbggenerated
    56. This element is automatically generated by MyBatis Generator, do not modify.
    57. This element was generated on Sun Mar 20 16:47:36 CST 2022.
    58. -->
    59. insert into tbl_clue_activity_relation
    60. <trim prefix="(" suffix=")" suffixOverrides="," >
    61. <if test="id != null" >
    62. id,
    63. </if>
    64. <if test="clueId != null" >
    65. clue_id,
    66. </if>
    67. <if test="activityId != null" >
    68. activity_id,
    69. </if>
    70. </trim>
    71. <trim prefix="values (" suffix=")" suffixOverrides="," >
    72. <if test="id != null" >
    73. #{id,jdbcType=CHAR},
    74. </if>
    75. <if test="clueId != null" >
    76. #{clueId,jdbcType=CHAR},
    77. </if>
    78. <if test="activityId != null" >
    79. #{activityId,jdbcType=CHAR},
    80. </if>
    81. </trim>
    82. </insert>
    83. <update id="updateByPrimaryKeySelective" parameterType="com.bjpowernode.crm.workbench.domain.ClueActivityRelation" >
    84. <!--
    85. WARNING - @mbggenerated
    86. This element is automatically generated by MyBatis Generator, do not modify.
    87. This element was generated on Sun Mar 20 16:47:36 CST 2022.
    88. -->
    89. update tbl_clue_activity_relation
    90. <set >
    91. <if test="clueId != null" >
    92. clue_id = #{clueId,jdbcType=CHAR},
    93. </if>
    94. <if test="activityId != null" >
    95. activity_id = #{activityId,jdbcType=CHAR},
    96. </if>
    97. </set>
    98. where id = #{id,jdbcType=CHAR}
    99. </update>
    100. <update id="updateByPrimaryKey" parameterType="com.bjpowernode.crm.workbench.domain.ClueActivityRelation" >
    101. <!--
    102. WARNING - @mbggenerated
    103. This element is automatically generated by MyBatis Generator, do not modify.
    104. This element was generated on Sun Mar 20 16:47:36 CST 2022.
    105. -->
    106. update tbl_clue_activity_relation
    107. set clue_id = #{clueId,jdbcType=CHAR},
    108. activity_id = #{activityId,jdbcType=CHAR}
    109. where id = #{id,jdbcType=CHAR}
    110. </update>
    111. <!--批量保存线索新增关联的市场活动-->
    112. <insert id="insertCreateClueActivityRelationByList" parameterType="com.bjpowernode.crm.workbench.domain.ClueActivityRelation">
    113. insert into tbl_clue_activity_relation(id, clue_id, activity_id)
    114. values
    115. <foreach collection="list" item="obj" separator=",">
    116. (#{obj.id},#{obj.clueId},#{obj.activityId})
    117. </foreach>
    118. </insert>
    119. <!--通过市场活动id和线索id删除两者间的关系(绑定的市场活动)-->
    120. <delete id="deleteClueActivityRelationByClueIdAndActivityId" parameterType="com.bjpowernode.crm.workbench.domain.ClueActivityRelation">
    121. delete from tbl_clue_activity_relation
    122. where clue_id=#{clueId} and activity_id=#{activityId}
    123. </delete>
    124. <!--通过线索id数组(因为可能删除多个线索和市场活动对应的关联关系)-->
    125. <delete id="deleteClueActivityRelationByClueIds" parameterType="string">
    126. delete from tbl_clue_activity_relation
    127. where clue_id in
    128. <foreach collection="array" item="id" separator="," open="(" close=")">
    129. #{id}
    130. </foreach>
    131. </delete>
    132. <!--通过线索id查询所有对应线索和市场活动关联关系-->
    133. <select id="selectClueActivityRelationByClueId" parameterType="string" resultMap="BaseResultMap">
    134. select id,clue_id,activity_id
    135. from tbl_clue_activity_relation
    136. where clue_id=#{clueId}
    137. </select>
    138. </mapper>

    ClueMapper:

    1. package com.bjpowernode.crm.workbench.mapper;
    2. import com.bjpowernode.crm.workbench.domain.Clue;
    3. import java.util.List;
    4. import java.util.Map;
    5. public interface ClueMapper {
    6. /**
    7. * This method was generated by MyBatis Generator.
    8. * This method corresponds to the database table tbl_clue
    9. *
    10. * @mbggenerated Thu Mar 17 15:29:56 CST 2022
    11. */
    12. int deleteByPrimaryKey(String id);
    13. /**
    14. * This method was generated by MyBatis Generator.
    15. * This method corresponds to the database table tbl_clue
    16. *
    17. * @mbggenerated Thu Mar 17 15:29:56 CST 2022
    18. */
    19. int insert(Clue record);
    20. /**
    21. * This method was generated by MyBatis Generator.
    22. * This method corresponds to the database table tbl_clue
    23. *
    24. * @mbggenerated Thu Mar 17 15:29:56 CST 2022
    25. */
    26. int insertSelective(Clue record);
    27. /**
    28. * This method was generated by MyBatis Generator.
    29. * This method corresponds to the database table tbl_clue
    30. *
    31. * @mbggenerated Thu Mar 17 15:29:56 CST 2022
    32. */
    33. Clue selectByPrimaryKey(String id);
    34. /**
    35. * This method was generated by MyBatis Generator.
    36. * This method corresponds to the database table tbl_clue
    37. *
    38. * @mbggenerated Thu Mar 17 15:29:56 CST 2022
    39. */
    40. int updateByPrimaryKeySelective(Clue record);
    41. /**
    42. * This method was generated by MyBatis Generator.
    43. * This method corresponds to the database table tbl_clue
    44. *
    45. * @mbggenerated Thu Mar 17 15:29:56 CST 2022
    46. */
    47. int updateByPrimaryKey(Clue record);
    48. /**
    49. * 新增线索
    50. * @param clue 新增的线索
    51. * @return 新增条数
    52. */
    53. int insertClue(Clue clue);
    54. /**
    55. * 根据条件分页查询线索列表
    56. * @param map 查询条件
    57. * @return 查询到的线索
    58. */
    59. List<Clue> selectClueByConditionForPage(Map<String, Object> map);
    60. /**
    61. * 根据条件查询线索总条数
    62. * @param map 查询条件
    63. * @return 线索总条数
    64. */
    65. int selectCountOfClueByCondition(Map<String, Object> map);
    66. /**
    67. * 通过id删除选则的线索
    68. * @param clueIds 线索id数组
    69. * @return 删除的条数
    70. */
    71. int deleteClueByIds(String[] clueIds);
    72. /**
    73. * 通过id查询线索
    74. * @param id 线索id
    75. * @return 对应id的线索
    76. */
    77. Clue selectClueById(String id);
    78. /**
    79. * 更新对应线索的数据
    80. * @param clue 更新的线索
    81. * @return 更新条数
    82. */
    83. int updateClue(Clue clue);
    84. /**
    85. * 通过id查询线索详情
    86. * @param id 线索id
    87. * @return 对应id的线索
    88. */
    89. Clue selectClueForDetailById(String id);
    90. List<String> selectClueStageOfClueGroupByClueStage();
    91. List<Integer> selectCountOfClueGroupByClueStage();
    92. }

    ClueMapper.xml:

    1. <?xml version="1.0" encoding="UTF-8" ?>
    2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
    3. <mapper namespace="com.bjpowernode.crm.workbench.mapper.ClueMapper" >
    4. <resultMap id="BaseResultMap" type="com.bjpowernode.crm.workbench.domain.Clue" >
    5. <!--
    6. WARNING - @mbggenerated
    7. This element is automatically generated by MyBatis Generator, do not modify.
    8. This element was generated on Tue Nov 03 17:43:22 CST 2020.
    9. -->
    10. <id column="id" property="id" jdbcType="CHAR" />
    11. <result column="fullname" property="fullname" jdbcType="VARCHAR" />
    12. <result column="appellation" property="appellation" jdbcType="VARCHAR" />
    13. <result column="owner" property="owner" jdbcType="CHAR" />
    14. <result column="company" property="company" jdbcType="VARCHAR" />
    15. <result column="job" property="job" jdbcType="VARCHAR" />
    16. <result column="email" property="email" jdbcType="VARCHAR" />
    17. <result column="phone" property="phone" jdbcType="VARCHAR" />
    18. <result column="website" property="website" jdbcType="VARCHAR" />
    19. <result column="mphone" property="mphone" jdbcType="VARCHAR" />
    20. <result column="state" property="state" jdbcType="VARCHAR" />
    21. <result column="source" property="source" jdbcType="VARCHAR" />
    22. <result column="create_by" property="createBy" jdbcType="VARCHAR" />
    23. <result column="create_time" property="createTime" jdbcType="CHAR" />
    24. <result column="edit_by" property="editBy" jdbcType="VARCHAR" />
    25. <result column="edit_time" property="editTime" jdbcType="CHAR" />
    26. <result column="description" property="description" jdbcType="VARCHAR" />
    27. <result column="contact_summary" property="contactSummary" jdbcType="VARCHAR" />
    28. <result column="next_contact_time" property="nextContactTime" jdbcType="CHAR" />
    29. <result column="address" property="address" jdbcType="VARCHAR" />
    30. </resultMap>
    31. <sql id="Base_Column_List" >
    32. <!--
    33. WARNING - @mbggenerated
    34. This element is automatically generated by MyBatis Generator, do not modify.
    35. This element was generated on Tue Nov 03 17:43:22 CST 2020.
    36. -->
    37. id, fullname, appellation, owner, company, job, email, phone, website, mphone, state,
    38. source, create_by, create_time, edit_by, edit_time, description, contact_summary,
    39. next_contact_time, address
    40. </sql>
    41. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    42. <!--
    43. WARNING - @mbggenerated
    44. This element is automatically generated by MyBatis Generator, do not modify.
    45. This element was generated on Tue Nov 03 17:43:22 CST 2020.
    46. -->
    47. select
    48. <include refid="Base_Column_List" />
    49. from tbl_clue
    50. where id = #{id,jdbcType=CHAR}
    51. </select>
    52. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    53. <!--
    54. WARNING - @mbggenerated
    55. This element is automatically generated by MyBatis Generator, do not modify.
    56. This element was generated on Tue Nov 03 17:43:22 CST 2020.
    57. -->
    58. delete from tbl_clue
    59. where id = #{id,jdbcType=CHAR}
    60. </delete>
    61. <insert id="insert" parameterType="com.bjpowernode.crm.workbench.domain.Clue" >
    62. <!--
    63. WARNING - @mbggenerated
    64. This element is automatically generated by MyBatis Generator, do not modify.
    65. This element was generated on Tue Nov 03 17:43:22 CST 2020.
    66. -->
    67. insert into tbl_clue (id, fullname, appellation,
    68. owner, company, job, email,
    69. phone, website, mphone,
    70. state, source, create_by,
    71. create_time, edit_by, edit_time,
    72. description, contact_summary, next_contact_time,
    73. address)
    74. values (#{id,jdbcType=CHAR}, #{fullname,jdbcType=VARCHAR}, #{appellation,jdbcType=VARCHAR},
    75. #{owner,jdbcType=CHAR}, #{company,jdbcType=VARCHAR}, #{job,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR},
    76. #{phone,jdbcType=VARCHAR}, #{website,jdbcType=VARCHAR}, #{mphone,jdbcType=VARCHAR},
    77. #{state,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
    78. #{createTime,jdbcType=CHAR}, #{editBy,jdbcType=VARCHAR}, #{editTime,jdbcType=CHAR},
    79. #{description,jdbcType=VARCHAR}, #{contactSummary,jdbcType=VARCHAR}, #{nextContactTime,jdbcType=CHAR},
    80. #{address,jdbcType=VARCHAR})
    81. </insert>
    82. <insert id="insertSelective" parameterType="com.bjpowernode.crm.workbench.domain.Clue" >
    83. <!--
    84. WARNING - @mbggenerated
    85. This element is automatically generated by MyBatis Generator, do not modify.
    86. This element was generated on Tue Nov 03 17:43:22 CST 2020.
    87. -->
    88. insert into tbl_clue
    89. <trim prefix="(" suffix=")" suffixOverrides="," >
    90. <if test="id != null" >
    91. id,
    92. </if>
    93. <if test="fullname != null" >
    94. fullname,
    95. </if>
    96. <if test="appellation != null" >
    97. appellation,
    98. </if>
    99. <if test="owner != null" >
    100. owner,
    101. </if>
    102. <if test="company != null" >
    103. company,
    104. </if>
    105. <if test="job != null" >
    106. job,
    107. </if>
    108. <if test="email != null" >
    109. email,
    110. </if>
    111. <if test="phone != null" >
    112. phone,
    113. </if>
    114. <if test="website != null" >
    115. website,
    116. </if>
    117. <if test="mphone != null" >
    118. mphone,
    119. </if>
    120. <if test="state != null" >
    121. state,
    122. </if>
    123. <if test="source != null" >
    124. source,
    125. </if>
    126. <if test="createBy != null" >
    127. create_by,
    128. </if>
    129. <if test="createTime != null" >
    130. create_time,
    131. </if>
    132. <if test="editBy != null" >
    133. edit_by,
    134. </if>
    135. <if test="editTime != null" >
    136. edit_time,
    137. </if>
    138. <if test="description != null" >
    139. description,
    140. </if>
    141. <if test="contactSummary != null" >
    142. contact_summary,
    143. </if>
    144. <if test="nextContactTime != null" >
    145. next_contact_time,
    146. </if>
    147. <if test="address != null" >
    148. address,
    149. </if>
    150. </trim>
    151. <trim prefix="values (" suffix=")" suffixOverrides="," >
    152. <if test="id != null" >
    153. #{id,jdbcType=CHAR},
    154. </if>
    155. <if test="fullname != null" >
    156. #{fullname,jdbcType=VARCHAR},
    157. </if>
    158. <if test="appellation != null" >
    159. #{appellation,jdbcType=VARCHAR},
    160. </if>
    161. <if test="owner != null" >
    162. #{owner,jdbcType=CHAR},
    163. </if>
    164. <if test="company != null" >
    165. #{company,jdbcType=VARCHAR},
    166. </if>
    167. <if test="job != null" >
    168. #{job,jdbcType=VARCHAR},
    169. </if>
    170. <if test="email != null" >
    171. #{email,jdbcType=VARCHAR},
    172. </if>
    173. <if test="phone != null" >
    174. #{phone,jdbcType=VARCHAR},
    175. </if>
    176. <if test="website != null" >
    177. #{website,jdbcType=VARCHAR},
    178. </if>
    179. <if test="mphone != null" >
    180. #{mphone,jdbcType=VARCHAR},
    181. </if>
    182. <if test="state != null" >
    183. #{state,jdbcType=VARCHAR},
    184. </if>
    185. <if test="source != null" >
    186. #{source,jdbcType=VARCHAR},
    187. </if>
    188. <if test="createBy != null" >
    189. #{createBy,jdbcType=VARCHAR},
    190. </if>
    191. <if test="createTime != null" >
    192. #{createTime,jdbcType=CHAR},
    193. </if>
    194. <if test="editBy != null" >
    195. #{editBy,jdbcType=VARCHAR},
    196. </if>
    197. <if test="editTime != null" >
    198. #{editTime,jdbcType=CHAR},
    199. </if>
    200. <if test="description != null" >
    201. #{description,jdbcType=VARCHAR},
    202. </if>
    203. <if test="contactSummary != null" >
    204. #{contactSummary,jdbcType=VARCHAR},
    205. </if>
    206. <if test="nextContactTime != null" >
    207. #{nextContactTime,jdbcType=CHAR},
    208. </if>
    209. <if test="address != null" >
    210. #{address,jdbcType=VARCHAR},
    211. </if>
    212. </trim>
    213. </insert>
    214. <update id="updateByPrimaryKeySelective" parameterType="com.bjpowernode.crm.workbench.domain.Clue" >
    215. <!--
    216. WARNING - @mbggenerated
    217. This element is automatically generated by MyBatis Generator, do not modify.
    218. This element was generated on Tue Nov 03 17:43:22 CST 2020.
    219. -->
    220. update tbl_clue
    221. <set >
    222. <if test="fullname != null" >
    223. fullname = #{fullname,jdbcType=VARCHAR},
    224. </if>
    225. <if test="appellation != null" >
    226. appellation = #{appellation,jdbcType=VARCHAR},
    227. </if>
    228. <if test="owner != null" >
    229. owner = #{owner,jdbcType=CHAR},
    230. </if>
    231. <if test="company != null" >
    232. company = #{company,jdbcType=VARCHAR},
    233. </if>
    234. <if test="job != null" >
    235. job = #{job,jdbcType=VARCHAR},
    236. </if>
    237. <if test="email != null" >
    238. email = #{email,jdbcType=VARCHAR},
    239. </if>
    240. <if test="phone != null" >
    241. phone = #{phone,jdbcType=VARCHAR},
    242. </if>
    243. <if test="website != null" >
    244. website = #{website,jdbcType=VARCHAR},
    245. </if>
    246. <if test="mphone != null" >
    247. mphone = #{mphone,jdbcType=VARCHAR},
    248. </if>
    249. <if test="state != null" >
    250. state = #{state,jdbcType=VARCHAR},
    251. </if>
    252. <if test="source != null" >
    253. source = #{source,jdbcType=VARCHAR},
    254. </if>
    255. <if test="createBy != null" >
    256. create_by = #{createBy,jdbcType=VARCHAR},
    257. </if>
    258. <if test="createTime != null" >
    259. create_time = #{createTime,jdbcType=CHAR},
    260. </if>
    261. <if test="editBy != null" >
    262. edit_by = #{editBy,jdbcType=VARCHAR},
    263. </if>
    264. <if test="editTime != null" >
    265. edit_time = #{editTime,jdbcType=CHAR},
    266. </if>
    267. <if test="description != null" >
    268. description = #{description,jdbcType=VARCHAR},
    269. </if>
    270. <if test="contactSummary != null" >
    271. contact_summary = #{contactSummary,jdbcType=VARCHAR},
    272. </if>
    273. <if test="nextContactTime != null" >
    274. next_contact_time = #{nextContactTime,jdbcType=CHAR},
    275. </if>
    276. <if test="address != null" >
    277. address = #{address,jdbcType=VARCHAR},
    278. </if>
    279. </set>
    280. where id = #{id,jdbcType=CHAR}
    281. </update>
    282. <update id="updateByPrimaryKey" parameterType="com.bjpowernode.crm.workbench.domain.Clue" >
    283. <!--
    284. WARNING - @mbggenerated
    285. This element is automatically generated by MyBatis Generator, do not modify.
    286. This element was generated on Tue Nov 03 17:43:22 CST 2020.
    287. -->
    288. update tbl_clue
    289. set fullname = #{fullname,jdbcType=VARCHAR},
    290. appellation = #{appellation,jdbcType=VARCHAR},
    291. owner = #{owner,jdbcType=CHAR},
    292. company = #{company,jdbcType=VARCHAR},
    293. job = #{job,jdbcType=VARCHAR},
    294. email = #{email,jdbcType=VARCHAR},
    295. phone = #{phone,jdbcType=VARCHAR},
    296. website = #{website,jdbcType=VARCHAR},
    297. mphone = #{mphone,jdbcType=VARCHAR},
    298. state = #{state,jdbcType=VARCHAR},
    299. source = #{source,jdbcType=VARCHAR},
    300. create_by = #{createBy,jdbcType=VARCHAR},
    301. create_time = #{createTime,jdbcType=CHAR},
    302. edit_by = #{editBy,jdbcType=VARCHAR},
    303. edit_time = #{editTime,jdbcType=CHAR},
    304. description = #{description,jdbcType=VARCHAR},
    305. contact_summary = #{contactSummary,jdbcType=VARCHAR},
    306. next_contact_time = #{nextContactTime,jdbcType=CHAR},
    307. address = #{address,jdbcType=VARCHAR}
    308. where id = #{id,jdbcType=CHAR}
    309. </update>
    310. <!--保存创建的线索:新增线索-->
    311. <insert id="insertClue" parameterType="com.bjpowernode.crm.workbench.domain.Clue">
    312. insert into tbl_clue(id, fullname, appellation, owner, company, job, email, phone, website, mphone, state,source, create_by, create_time, description, contact_summary,next_contact_time, address)
    313. values (#{id},#{ fullname},#{ appellation},#{ owner},#{ company},#{ job},#{ email},#{ phone},#{ website},#{ mphone},#{ state},#{source},#{ createBy},#{ createTime},#{ description},#{ contactSummary},#{nextContactTime},#{ address})
    314. </insert>
    315. <select id="selectClueByConditionForPage" parameterType="map" resultMap="BaseResultMap">
    316. select cl.id,cl.fullname,dicv1.value as appellation,u1.name as owner,cl.company,cl.job,cl.email,cl.phone,
    317. cl.website,cl.mphone,ifnull(dicv2.value, ' ') as state,ifnull(dicv3.value, ' ') as source,u2.name as create_by,cl.create_time,
    318. u3.name as edit_by,cl.edit_time,cl.description,cl.contact_summary,cl.next_contact_time,cl.address
    319. from tbl_clue cl
    320. left join tbl_dic_value dicv1 on cl.appellation=dicv1.id
    321. left join tbl_dic_value dicv2 on cl.state=dicv2.id
    322. left join tbl_dic_value dicv3 on cl.source=dicv3.id
    323. join tbl_user u1 on cl.owner=u1.id
    324. join tbl_user u2 on cl.create_by=u2.id
    325. left join tbl_user u3 on cl.edit_by=u3.id
    326. <where>
    327. <if test="fullname!=null and fullname!=''">
    328. and cl.fullname like '%' #{fullname} '%'
    329. </if>
    330. <if test="company!=null and company!=''">
    331. and cl.company like '%' #{company} '%'
    332. </if>
    333. <if test="phone!=null and phone!=''">
    334. and cl.phone like '%' #{phone} '%'
    335. </if>
    336. <if test="source!=null and source!=''">
    337. and dicv3.value like '%' #{source} '%'
    338. </if>
    339. <if test="owner!=null and owner!=''">
    340. and u1.name like '%' #{owner} '%'
    341. </if>
    342. <if test="mphone!=null and mphone!=''">
    343. and cl.mphone like '%' #{mphone} '%'
    344. </if>
    345. <if test="state!=null and state!=''">
    346. and dicv2.value like '%' #{state} '%'
    347. </if>
    348. </where>
    349. order by cl.create_time desc
    350. limit #{beginNo},#{pageSize}
    351. </select>
    352. <select id="selectCountOfClueByCondition" resultType="int" parameterType="map">
    353. select count(*)
    354. from tbl_clue cl
    355. left join tbl_dic_value dicv1 on cl.appellation=dicv1.id
    356. left join tbl_dic_value dicv2 on cl.state=dicv2.id
    357. left join tbl_dic_value dicv3 on cl.source=dicv3.id
    358. join tbl_user u1 on cl.owner=u1.id
    359. join tbl_user u2 on cl.create_by=u2.id
    360. left join tbl_user u3 on cl.edit_by=u3.id
    361. <where>
    362. <if test="fullname!=null and fullname!=''">
    363. and cl.fullname like '%' #{fullname} '%'
    364. </if>
    365. <if test="company!=null and company!=''">
    366. and cl.company like '%' #{company} '%'
    367. </if>
    368. <if test="phone!=null and phone!=''">
    369. and cl.phone like '%' #{phone} '%'
    370. </if>
    371. <if test="source!=null and source!=''">
    372. and dicv3.value like '%' #{source} '%'
    373. </if>
    374. <if test="owner!=null and owner!=''">
    375. and u1.name like '%' #{owner} '%'
    376. </if>
    377. <if test="mphone!=null and mphone!=''">
    378. and cl.mphone like '%' #{mphone} '%'
    379. </if>
    380. <if test="state!=null and state!=''">
    381. and dicv2.value like '%' #{state} '%'
    382. </if>
    383. </where>
    384. </select>
    385. <!--通过id删除选则的线索-->
    386. <delete id="deleteClueByIds" parameterType="string">
    387. delete from tbl_clue
    388. where id in
    389. <foreach collection="array" item="id" separator="," open="(" close=")">
    390. #{id, jdbcType=VARCHAR}
    391. </foreach>
    392. </delete>
    393. <!--通过id查询线索-->
    394. <select id="selectClueById" parameterType="string" resultMap="BaseResultMap">
    395. select
    396. <include refid="Base_Column_List" />
    397. from tbl_clue
    398. where id = #{id,jdbcType=CHAR}
    399. </select>
    400. <update id="updateClue" parameterType="com.bjpowernode.crm.workbench.domain.Clue">
    401. update tbl_clue
    402. set fullname=#{fullname}, appellation=#{appellation}, owner=#{owner}, company=#{company}, job=#{job}, email=#{email},
    403. phone=#{phone}, website=#{website}, mphone=#{mphone}, state=#{state}, source=#{source}, edit_by=#{editBy},
    404. edit_time=#{editTime}, description=#{description}, contact_summary=#{contactSummary},
    405. next_contact_time=#{nextContactTime}, address=#{address}
    406. where id=#{id}
    407. </update>
    408. <!--通过id查询线索详情-->
    409. <select id="selectClueForDetailById" parameterType="string" resultMap="BaseResultMap">
    410. select cl.id,cl.fullname,dicv1.value as appellation,u1.name as owner,cl.company,cl.job,cl.email,cl.phone,
    411. cl.website,cl.mphone,dicv2.value as state,dicv3.value as source,u2.name as create_by,cl.create_time,
    412. u3.name as edit_by,cl.edit_time,cl.description,cl.contact_summary,cl.next_contact_time,cl.address
    413. from tbl_clue cl
    414. left join tbl_dic_value dicv1 on cl.appellation=dicv1.id
    415. left join tbl_dic_value dicv2 on cl.state=dicv2.id
    416. left join tbl_dic_value dicv3 on cl.source=dicv3.id
    417. join tbl_user u1 on cl.owner=u1.id
    418. join tbl_user u2 on cl.create_by=u2.id
    419. left join tbl_user u3 on cl.edit_by=u3.id
    420. where cl.id = #{id,jdbcType=CHAR}
    421. </select>
    422. <select id="selectClueStageOfClueGroupByClueStage" resultType="string">
    423. select d.value as clueStage
    424. from tbl_clue c
    425. join tbl_dic_value d on c.state = d.id
    426. group by c.state
    427. </select>
    428. <select id="selectCountOfClueGroupByClueStage" resultType="java.lang.Integer">
    429. select count(*) as value
    430. from tbl_clue c
    431. join tbl_dic_value d on c.state = d.id
    432. group by c.state
    433. </select>
    434. </mapper>

    ClueRemarkMapper:

    1. package com.bjpowernode.crm.workbench.mapper;
    2. import com.bjpowernode.crm.workbench.domain.ClueRemark;
    3. import java.util.List;
    4. public interface ClueRemarkMapper {
    5. /**
    6. * This method was generated by MyBatis Generator.
    7. * This method corresponds to the database table tbl_clue_remark
    8. *
    9. * @mbggenerated Fri Mar 18 20:26:12 CST 2022
    10. */
    11. int deleteByPrimaryKey(String id);
    12. /**
    13. * This method was generated by MyBatis Generator.
    14. * This method corresponds to the database table tbl_clue_remark
    15. *
    16. * @mbggenerated Fri Mar 18 20:26:12 CST 2022
    17. */
    18. int insert(ClueRemark record);
    19. /**
    20. * This method was generated by MyBatis Generator.
    21. * This method corresponds to the database table tbl_clue_remark
    22. *
    23. * @mbggenerated Fri Mar 18 20:26:12 CST 2022
    24. */
    25. int insertSelective(ClueRemark record);
    26. /**
    27. * This method was generated by MyBatis Generator.
    28. * This method corresponds to the database table tbl_clue_remark
    29. *
    30. * @mbggenerated Fri Mar 18 20:26:12 CST 2022
    31. */
    32. ClueRemark selectByPrimaryKey(String id);
    33. /**
    34. * This method was generated by MyBatis Generator.
    35. * This method corresponds to the database table tbl_clue_remark
    36. *
    37. * @mbggenerated Fri Mar 18 20:26:12 CST 2022
    38. */
    39. int updateByPrimaryKeySelective(ClueRemark record);
    40. /**
    41. * This method was generated by MyBatis Generator.
    42. * This method corresponds to the database table tbl_clue_remark
    43. *
    44. * @mbggenerated Fri Mar 18 20:26:12 CST 2022
    45. */
    46. int updateByPrimaryKey(ClueRemark record);
    47. /**
    48. * 根据线索id查询该线索的所有备注详细信息
    49. * @param clueId 线索id
    50. * @return 备注列表
    51. */
    52. List<ClueRemark> selectClueRemarkForDetailByClueId(String clueId);
    53. /**
    54. * 添加线索备注
    55. * @param clueRemark 线索备注
    56. * @return 添加的条数
    57. */
    58. int insertClueRemark(ClueRemark clueRemark);
    59. /**
    60. * 通过线索id删除备注(用于删除线索时同时删除该线索备注;因为可能一次性会删除多个线索,所以传入的id是线索id数组)
    61. * @param clueIds 线索id
    62. * @return 删除的条数
    63. */
    64. int deleteClueRemarkByClueId(String[] clueIds);
    65. /**
    66. * 通过线索备注的id删除线索备注
    67. * @param id 线索备注的id
    68. * @return 删除的条数
    69. */
    70. int deleteClueRemarkById(String id);
    71. /**
    72. * 更新线索备注
    73. * @param clueRemark 更新的线索备注
    74. * @return 更新的条数
    75. */
    76. int updateClueRemark(ClueRemark clueRemark);
    77. /**
    78. * 通过线索id查询市场活动备注
    79. * @param clueId 线索id
    80. * @return 该线索的所有备注集合
    81. */
    82. List<ClueRemark> selectClueRemarkByClueId(String clueId);
    83. }

    ClueRemarkMapper.xml:

    1. <?xml version="1.0" encoding="UTF-8" ?>
    2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
    3. <mapper namespace="com.bjpowernode.crm.workbench.mapper.ClueRemarkMapper" >
    4. <resultMap id="BaseResultMap" type="com.bjpowernode.crm.workbench.domain.ClueRemark" >
    5. <!--
    6. WARNING - @mbggenerated
    7. This element is automatically generated by MyBatis Generator, do not modify.
    8. This element was generated on Fri Mar 18 20:26:12 CST 2022.
    9. -->
    10. <id column="id" property="id" jdbcType="CHAR" />
    11. <result column="note_content" property="noteContent" jdbcType="VARCHAR" />
    12. <result column="create_by" property="createBy" jdbcType="VARCHAR" />
    13. <result column="create_time" property="createTime" jdbcType="CHAR" />
    14. <result column="edit_by" property="editBy" jdbcType="VARCHAR" />
    15. <result column="edit_time" property="editTime" jdbcType="CHAR" />
    16. <result column="edit_flag" property="editFlag" jdbcType="CHAR" />
    17. <result column="clue_id" property="clueId" jdbcType="CHAR" />
    18. </resultMap>
    19. <sql id="Base_Column_List" >
    20. <!--
    21. WARNING - @mbggenerated
    22. This element is automatically generated by MyBatis Generator, do not modify.
    23. This element was generated on Fri Mar 18 20:26:12 CST 2022.
    24. -->
    25. id, note_content, create_by, create_time, edit_by, edit_time, edit_flag, clue_id
    26. </sql>
    27. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    28. <!--
    29. WARNING - @mbggenerated
    30. This element is automatically generated by MyBatis Generator, do not modify.
    31. This element was generated on Fri Mar 18 20:26:12 CST 2022.
    32. -->
    33. select
    34. <include refid="Base_Column_List" />
    35. from tbl_clue_remark
    36. where id = #{id,jdbcType=CHAR}
    37. </select>
    38. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    39. <!--
    40. WARNING - @mbggenerated
    41. This element is automatically generated by MyBatis Generator, do not modify.
    42. This element was generated on Fri Mar 18 20:26:12 CST 2022.
    43. -->
    44. delete from tbl_clue_remark
    45. where id = #{id,jdbcType=CHAR}
    46. </delete>
    47. <insert id="insert" parameterType="com.bjpowernode.crm.workbench.domain.ClueRemark" >
    48. <!--
    49. WARNING - @mbggenerated
    50. This element is automatically generated by MyBatis Generator, do not modify.
    51. This element was generated on Fri Mar 18 20:26:12 CST 2022.
    52. -->
    53. insert into tbl_clue_remark (id, note_content, create_by,
    54. create_time, edit_by, edit_time,
    55. edit_flag, clue_id)
    56. values (#{id,jdbcType=CHAR}, #{noteContent,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
    57. #{createTime,jdbcType=CHAR}, #{editBy,jdbcType=VARCHAR}, #{editTime,jdbcType=CHAR},
    58. #{editFlag,jdbcType=CHAR}, #{clueId,jdbcType=CHAR})
    59. </insert>
    60. <insert id="insertSelective" parameterType="com.bjpowernode.crm.workbench.domain.ClueRemark" >
    61. <!--
    62. WARNING - @mbggenerated
    63. This element is automatically generated by MyBatis Generator, do not modify.
    64. This element was generated on Fri Mar 18 20:26:12 CST 2022.
    65. -->
    66. insert into tbl_clue_remark
    67. <trim prefix="(" suffix=")" suffixOverrides="," >
    68. <if test="id != null" >
    69. id,
    70. </if>
    71. <if test="noteContent != null" >
    72. note_content,
    73. </if>
    74. <if test="createBy != null" >
    75. create_by,
    76. </if>
    77. <if test="createTime != null" >
    78. create_time,
    79. </if>
    80. <if test="editBy != null" >
    81. edit_by,
    82. </if>
    83. <if test="editTime != null" >
    84. edit_time,
    85. </if>
    86. <if test="editFlag != null" >
    87. edit_flag,
    88. </if>
    89. <if test="clueId != null" >
    90. clue_id,
    91. </if>
    92. </trim>
    93. <trim prefix="values (" suffix=")" suffixOverrides="," >
    94. <if test="id != null" >
    95. #{id,jdbcType=CHAR},
    96. </if>
    97. <if test="noteContent != null" >
    98. #{noteContent,jdbcType=VARCHAR},
    99. </if>
    100. <if test="createBy != null" >
    101. #{createBy,jdbcType=VARCHAR},
    102. </if>
    103. <if test="createTime != null" >
    104. #{createTime,jdbcType=CHAR},
    105. </if>
    106. <if test="editBy != null" >
    107. #{editBy,jdbcType=VARCHAR},
    108. </if>
    109. <if test="editTime != null" >
    110. #{editTime,jdbcType=CHAR},
    111. </if>
    112. <if test="editFlag != null" >
    113. #{editFlag,jdbcType=CHAR},
    114. </if>
    115. <if test="clueId != null" >
    116. #{clueId,jdbcType=CHAR},
    117. </if>
    118. </trim>
    119. </insert>
    120. <update id="updateByPrimaryKeySelective" parameterType="com.bjpowernode.crm.workbench.domain.ClueRemark" >
    121. <!--
    122. WARNING - @mbggenerated
    123. This element is automatically generated by MyBatis Generator, do not modify.
    124. This element was generated on Fri Mar 18 20:26:12 CST 2022.
    125. -->
    126. update tbl_clue_remark
    127. <set >
    128. <if test="noteContent != null" >
    129. note_content = #{noteContent,jdbcType=VARCHAR},
    130. </if>
    131. <if test="createBy != null" >
    132. create_by = #{createBy,jdbcType=VARCHAR},
    133. </if>
    134. <if test="createTime != null" >
    135. create_time = #{createTime,jdbcType=CHAR},
    136. </if>
    137. <if test="editBy != null" >
    138. edit_by = #{editBy,jdbcType=VARCHAR},
    139. </if>
    140. <if test="editTime != null" >
    141. edit_time = #{editTime,jdbcType=CHAR},
    142. </if>
    143. <if test="editFlag != null" >
    144. edit_flag = #{editFlag,jdbcType=CHAR},
    145. </if>
    146. <if test="clueId != null" >
    147. clue_id = #{clueId,jdbcType=CHAR},
    148. </if>
    149. </set>
    150. where id = #{id,jdbcType=CHAR}
    151. </update>
    152. <update id="updateByPrimaryKey" parameterType="com.bjpowernode.crm.workbench.domain.ClueRemark" >
    153. <!--
    154. WARNING - @mbggenerated
    155. This element is automatically generated by MyBatis Generator, do not modify.
    156. This element was generated on Fri Mar 18 20:26:12 CST 2022.
    157. -->
    158. update tbl_clue_remark
    159. set note_content = #{noteContent,jdbcType=VARCHAR},
    160. create_by = #{createBy,jdbcType=VARCHAR},
    161. create_time = #{createTime,jdbcType=CHAR},
    162. edit_by = #{editBy,jdbcType=VARCHAR},
    163. edit_time = #{editTime,jdbcType=CHAR},
    164. edit_flag = #{editFlag,jdbcType=CHAR},
    165. clue_id = #{clueId,jdbcType=CHAR}
    166. where id = #{id,jdbcType=CHAR}
    167. </update>
    168. <!--根据线索id查询该线索的所有备注详细信息-->
    169. <select id="selectClueRemarkForDetailByClueId" parameterType="string" resultMap="BaseResultMap">
    170. select cr.id,cr.note_content,u1.name as create_by,cr.create_time,u2.name as edit_by,cr.edit_time,cr.edit_flag
    171. from tbl_clue_remark cr
    172. join tbl_user u1 on cr.create_by=u1.id
    173. left join tbl_user u2 on cr.edit_by=u2.id
    174. where cr.clue_id=#{clueId}
    175. </select>
    176. <insert id="insertClueRemark" parameterType="com.bjpowernode.crm.workbench.domain.ClueRemark">
    177. insert into
    178. tbl_clue_remark(id, note_content, create_time, create_by, edit_flag, clue_id)
    179. values(#{id},#{noteContent},#{createTime},#{createBy},#{editFlag},#{clueId})
    180. </insert>
    181. <!--通过线索id删除备注(用于删除线索时同时删除该线索备注;因为可能一次性会删除多个线索,所以传入的id是线索id数组)-->
    182. <delete id="deleteClueRemarkByClueId" parameterType="string">
    183. delete from tbl_clue_remark
    184. where clue_id in
    185. <foreach collection="array" item="id" separator="," open="(" close=")">
    186. #{id, jdbcType=VARCHAR}
    187. </foreach>
    188. </delete>
    189. <delete id="deleteClueRemarkById" parameterType="string">
    190. delete from tbl_clue_remark
    191. where id=#{id}
    192. </delete>
    193. <update id="updateClueRemark" parameterType="com.bjpowernode.crm.workbench.domain.ClueRemark">
    194. update tbl_clue_remark
    195. set note_content=#{noteContent},edit_time=#{editTime},edit_by=#{editBy},edit_flag=#{editFlag}
    196. where id=#{id}
    197. </update>
    198. <!--通过线索id查询市场活动备注-->
    199. <select id="selectClueRemarkByClueId" parameterType="string" resultMap="BaseResultMap">
    200. select
    201. <include refid="Base_Column_List" />
    202. from tbl_clue_remark
    203. where clue_id=#{clueId}
    204. </select>
    205. </mapper>

    ContactsActivityRelationMapper :

    1. package com.bjpowernode.crm.workbench.mapper;
    2. import com.bjpowernode.crm.workbench.domain.ContactsActivityRelation;
    3. import java.util.List;
    4. public interface ContactsActivityRelationMapper {
    5. /**
    6. * This method was generated by MyBatis Generator.
    7. * This method corresponds to the database table tbl_contacts_activity_relation
    8. *
    9. * @mbggenerated Sun Mar 27 09:53:44 CST 2022
    10. */
    11. int deleteByPrimaryKey(String id);
    12. /**
    13. * This method was generated by MyBatis Generator.
    14. * This method corresponds to the database table tbl_contacts_activity_relation
    15. *
    16. * @mbggenerated Sun Mar 27 09:53:44 CST 2022
    17. */
    18. int insert(ContactsActivityRelation record);
    19. /**
    20. * This method was generated by MyBatis Generator.
    21. * This method corresponds to the database table tbl_contacts_activity_relation
    22. *
    23. * @mbggenerated Sun Mar 27 09:53:44 CST 2022
    24. */
    25. int insertSelective(ContactsActivityRelation record);
    26. /**
    27. * This method was generated by MyBatis Generator.
    28. * This method corresponds to the database table tbl_contacts_activity_relation
    29. *
    30. * @mbggenerated Sun Mar 27 09:53:44 CST 2022
    31. */
    32. ContactsActivityRelation selectByPrimaryKey(String id);
    33. /**
    34. * This method was generated by MyBatis Generator.
    35. * This method corresponds to the database table tbl_contacts_activity_relation
    36. *
    37. * @mbggenerated Sun Mar 27 09:53:44 CST 2022
    38. */
    39. int updateByPrimaryKeySelective(ContactsActivityRelation record);
    40. /**
    41. * This method was generated by MyBatis Generator.
    42. * This method corresponds to the database table tbl_contacts_activity_relation
    43. *
    44. * @mbggenerated Sun Mar 27 09:53:44 CST 2022
    45. */
    46. int updateByPrimaryKey(ContactsActivityRelation record);
    47. /**
    48. * 通过集合插入联系人和市场活动关系的数据
    49. * @param contactsActivityRelationList 联系人和市场活动关系数据集合
    50. * @return 插入的条数
    51. */
    52. int insertContactsActivityRelationByList(List<ContactsActivityRelation> contactsActivityRelationList);
    53. int deleteContactsActivityRelationByContactsIdAndActivityId(ContactsActivityRelation contactsActivityRelation);
    54. int deleteContactsActivityRelationByContactsIds(String[] contactsIds);
    55. }

    ContactsActivityRelationMapper .xml:

    1. <?xml version="1.0" encoding="UTF-8" ?>
    2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
    3. <mapper namespace="com.bjpowernode.crm.workbench.mapper.ContactsActivityRelationMapper" >
    4. <resultMap id="BaseResultMap" type="com.bjpowernode.crm.workbench.domain.ContactsActivityRelation" >
    5. <!--
    6. WARNING - @mbggenerated
    7. This element is automatically generated by MyBatis Generator, do not modify.
    8. This element was generated on Sun Mar 27 09:53:44 CST 2022.
    9. -->
    10. <id column="id" property="id" jdbcType="CHAR" />
    11. <result column="contacts_id" property="contactsId" jdbcType="CHAR" />
    12. <result column="activity_id" property="activityId" jdbcType="CHAR" />
    13. </resultMap>
    14. <sql id="Base_Column_List" >
    15. <!--
    16. WARNING - @mbggenerated
    17. This element is automatically generated by MyBatis Generator, do not modify.
    18. This element was generated on Sun Mar 27 09:53:44 CST 2022.
    19. -->
    20. id, contacts_id, activity_id
    21. </sql>
    22. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    23. <!--
    24. WARNING - @mbggenerated
    25. This element is automatically generated by MyBatis Generator, do not modify.
    26. This element was generated on Sun Mar 27 09:53:44 CST 2022.
    27. -->
    28. select
    29. <include refid="Base_Column_List" />
    30. from tbl_contacts_activity_relation
    31. where id = #{id,jdbcType=CHAR}
    32. </select>
    33. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    34. <!--
    35. WARNING - @mbggenerated
    36. This element is automatically generated by MyBatis Generator, do not modify.
    37. This element was generated on Sun Mar 27 09:53:44 CST 2022.
    38. -->
    39. delete from tbl_contacts_activity_relation
    40. where id = #{id,jdbcType=CHAR}
    41. </delete>
    42. <insert id="insert" parameterType="com.bjpowernode.crm.workbench.domain.ContactsActivityRelation" >
    43. <!--
    44. WARNING - @mbggenerated
    45. This element is automatically generated by MyBatis Generator, do not modify.
    46. This element was generated on Sun Mar 27 09:53:44 CST 2022.
    47. -->
    48. insert into tbl_contacts_activity_relation (id, contacts_id, activity_id
    49. )
    50. values (#{id,jdbcType=CHAR}, #{contactsId,jdbcType=CHAR}, #{activityId,jdbcType=CHAR}
    51. )
    52. </insert>
    53. <insert id="insertSelective" parameterType="com.bjpowernode.crm.workbench.domain.ContactsActivityRelation" >
    54. <!--
    55. WARNING - @mbggenerated
    56. This element is automatically generated by MyBatis Generator, do not modify.
    57. This element was generated on Sun Mar 27 09:53:44 CST 2022.
    58. -->
    59. insert into tbl_contacts_activity_relation
    60. <trim prefix="(" suffix=")" suffixOverrides="," >
    61. <if test="id != null" >
    62. id,
    63. </if>
    64. <if test="contactsId != null" >
    65. contacts_id,
    66. </if>
    67. <if test="activityId != null" >
    68. activity_id,
    69. </if>
    70. </trim>
    71. <trim prefix="values (" suffix=")" suffixOverrides="," >
    72. <if test="id != null" >
    73. #{id,jdbcType=CHAR},
    74. </if>
    75. <if test="contactsId != null" >
    76. #{contactsId,jdbcType=CHAR},
    77. </if>
    78. <if test="activityId != null" >
    79. #{activityId,jdbcType=CHAR},
    80. </if>
    81. </trim>
    82. </insert>
    83. <update id="updateByPrimaryKeySelective" parameterType="com.bjpowernode.crm.workbench.domain.ContactsActivityRelation" >
    84. <!--
    85. WARNING - @mbggenerated
    86. This element is automatically generated by MyBatis Generator, do not modify.
    87. This element was generated on Sun Mar 27 09:53:44 CST 2022.
    88. -->
    89. update tbl_contacts_activity_relation
    90. <set >
    91. <if test="contactsId != null" >
    92. contacts_id = #{contactsId,jdbcType=CHAR},
    93. </if>
    94. <if test="activityId != null" >
    95. activity_id = #{activityId,jdbcType=CHAR},
    96. </if>
    97. </set>
    98. where id = #{id,jdbcType=CHAR}
    99. </update>
    100. <update id="updateByPrimaryKey" parameterType="com.bjpowernode.crm.workbench.domain.ContactsActivityRelation" >
    101. <!--
    102. WARNING - @mbggenerated
    103. This element is automatically generated by MyBatis Generator, do not modify.
    104. This element was generated on Sun Mar 27 09:53:44 CST 2022.
    105. -->
    106. update tbl_contacts_activity_relation
    107. set contacts_id = #{contactsId,jdbcType=CHAR},
    108. activity_id = #{activityId,jdbcType=CHAR}
    109. where id = #{id,jdbcType=CHAR}
    110. </update>
    111. <!--通过集合插入联系人和市场活动关系的数据-->
    112. <insert id="insertContactsActivityRelationByList" parameterType="com.bjpowernode.crm.workbench.domain.ContactsActivityRelation">
    113. insert into tbl_contacts_activity_relation(id, contacts_id, activity_id)
    114. values
    115. <foreach collection="list" item="obj" separator=",">
    116. (#{obj.id}, #{obj.contactsId}, #{obj.activityId})
    117. </foreach>
    118. </insert>
    119. <delete id="deleteContactsActivityRelationByContactsIdAndActivityId" parameterType="com.bjpowernode.crm.workbench.domain.ContactsActivityRelation">
    120. delete from tbl_contacts_activity_relation
    121. where contacts_id=#{contactsId} and activity_id=#{activityId}
    122. </delete>
    123. <delete id="deleteContactsActivityRelationByContactsIds" parameterType="string">
    124. delete from tbl_contacts_activity_relation
    125. where contacts_id in
    126. <foreach collection="array" item="id" separator="," open="(" close=")">
    127. #{id}
    128. </foreach>
    129. </delete>
    130. </mapper>

    ContactsMapper:

    1. package com.bjpowernode.crm.workbench.mapper;
    2. import com.bjpowernode.crm.workbench.domain.Contacts;
    3. import com.bjpowernode.crm.workbench.domain.FunnelVO;
    4. import java.util.List;
    5. import java.util.Map;
    6. public interface ContactsMapper {
    7. /**
    8. * This method was generated by MyBatis Generator.
    9. * This method corresponds to the database table tbl_contacts
    10. *
    11. * @mbggenerated Thu Mar 24 21:35:58 CST 2022
    12. */
    13. int deleteByPrimaryKey(String id);
    14. /**
    15. * This method was generated by MyBatis Generator.
    16. * This method corresponds to the database table tbl_contacts
    17. *
    18. * @mbggenerated Thu Mar 24 21:35:58 CST 2022
    19. */
    20. int insert(Contacts record);
    21. /**
    22. * This method was generated by MyBatis Generator.
    23. * This method corresponds to the database table tbl_contacts
    24. *
    25. * @mbggenerated Thu Mar 24 21:35:58 CST 2022
    26. */
    27. int insertSelective(Contacts record);
    28. /**
    29. * This method was generated by MyBatis Generator.
    30. * This method corresponds to the database table tbl_contacts
    31. *
    32. * @mbggenerated Thu Mar 24 21:35:58 CST 2022
    33. */
    34. Contacts selectByPrimaryKey(String id);
    35. /**
    36. * This method was generated by MyBatis Generator.
    37. * This method corresponds to the database table tbl_contacts
    38. *
    39. * @mbggenerated Thu Mar 24 21:35:58 CST 2022
    40. */
    41. int updateByPrimaryKeySelective(Contacts record);
    42. /**
    43. * This method was generated by MyBatis Generator.
    44. * This method corresponds to the database table tbl_contacts
    45. *
    46. * @mbggenerated Thu Mar 24 21:35:58 CST 2022
    47. */
    48. int updateByPrimaryKey(Contacts record);
    49. /**
    50. * 保存新增联系
    51. * @param contacts 联系对象封装的参数
    52. * @return 新增条数
    53. */
    54. int insertContacts(Contacts contacts);
    55. /**
    56. * 根据条件分页查询联系人列表
    57. * @param map 查询条件
    58. * @return 查询到的联系人
    59. */
    60. List<Contacts> selectContactsByConditionForPage(Map<String, Object> map);
    61. /**
    62. * 根据条件查询联系人总条数
    63. * @param map 查询条件
    64. * @return 联系人总条数
    65. */
    66. int selectCountOfContactsByCondition(Map<String, Object> map);
    67. /**
    68. * 通过id查询联系人
    69. * @param id 联系人id
    70. * @return 对应id的联系人
    71. */
    72. Contacts selectContactsById(String id);
    73. /**
    74. * 更新对应联系人的数据
    75. * @param contacts 更新的联系人
    76. * @return 更新条数
    77. */
    78. int updateContacts(Contacts contacts);
    79. /**
    80. * 通过id删除选则的联系人
    81. * @param contactsIds 联系人id数组
    82. * @return 删除的条数
    83. */
    84. int deleteContactsByIds(String[] contactsIds);
    85. /**
    86. * 通过联系人id查询联系人的详细信息
    87. * @param id 联系人id
    88. * @return 查询的联系人详细信息
    89. */
    90. Contacts selectContactsForDetailById(String id);
    91. /**
    92. * 通过姓名模糊查询联系人
    93. * @param contactsName 模糊姓名
    94. * @return 查询到的线索
    95. */
    96. List<Contacts> selectContactsByFuzzyName(String contactsName);
    97. List<FunnelVO> selectCountOfCustomerAndContactsGroupByCustomer();
    98. }

    ContactsMapper.xml:

    1. <?xml version="1.0" encoding="UTF-8" ?>
    2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
    3. <mapper namespace="com.bjpowernode.crm.workbench.mapper.ContactsMapper" >
    4. <resultMap id="BaseResultMap" type="com.bjpowernode.crm.workbench.domain.Contacts" >
    5. <!--
    6. WARNING - @mbggenerated
    7. This element is automatically generated by MyBatis Generator, do not modify.
    8. This element was generated on Thu Mar 24 21:35:58 CST 2022.
    9. -->
    10. <id column="id" property="id" jdbcType="CHAR" />
    11. <result column="owner" property="owner" jdbcType="CHAR" />
    12. <result column="source" property="source" jdbcType="VARCHAR" />
    13. <result column="customer_id" property="customerId" jdbcType="CHAR" />
    14. <result column="fullname" property="fullname" jdbcType="VARCHAR" />
    15. <result column="appellation" property="appellation" jdbcType="VARCHAR" />
    16. <result column="email" property="email" jdbcType="VARCHAR" />
    17. <result column="mphone" property="mphone" jdbcType="VARCHAR" />
    18. <result column="job" property="job" jdbcType="VARCHAR" />
    19. <result column="create_by" property="createBy" jdbcType="VARCHAR" />
    20. <result column="create_time" property="createTime" jdbcType="CHAR" />
    21. <result column="edit_by" property="editBy" jdbcType="VARCHAR" />
    22. <result column="edit_time" property="editTime" jdbcType="CHAR" />
    23. <result column="description" property="description" jdbcType="VARCHAR" />
    24. <result column="contact_summary" property="contactSummary" jdbcType="VARCHAR" />
    25. <result column="next_contact_time" property="nextContactTime" jdbcType="CHAR" />
    26. <result column="address" property="address" jdbcType="VARCHAR" />
    27. </resultMap>
    28. <sql id="Base_Column_List" >
    29. <!--
    30. WARNING - @mbggenerated
    31. This element is automatically generated by MyBatis Generator, do not modify.
    32. This element was generated on Thu Mar 24 21:35:58 CST 2022.
    33. -->
    34. id, owner, source, customer_id, fullname, appellation, email, mphone, job, create_by,
    35. create_time, edit_by, edit_time, description, contact_summary, next_contact_time,
    36. address
    37. </sql>
    38. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    39. <!--
    40. WARNING - @mbggenerated
    41. This element is automatically generated by MyBatis Generator, do not modify.
    42. This element was generated on Thu Mar 24 21:35:58 CST 2022.
    43. -->
    44. select
    45. <include refid="Base_Column_List" />
    46. from tbl_contacts
    47. where id = #{id,jdbcType=CHAR}
    48. </select>
    49. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    50. <!--
    51. WARNING - @mbggenerated
    52. This element is automatically generated by MyBatis Generator, do not modify.
    53. This element was generated on Thu Mar 24 21:35:58 CST 2022.
    54. -->
    55. delete from tbl_contacts
    56. where id = #{id,jdbcType=CHAR}
    57. </delete>
    58. <insert id="insert" parameterType="com.bjpowernode.crm.workbench.domain.Contacts" >
    59. <!--
    60. WARNING - @mbggenerated
    61. This element is automatically generated by MyBatis Generator, do not modify.
    62. This element was generated on Thu Mar 24 21:35:58 CST 2022.
    63. -->
    64. insert into tbl_contacts (id, owner, source,
    65. customer_id, fullname, appellation,
    66. email, mphone, job,
    67. create_by, create_time, edit_by,
    68. edit_time, description, contact_summary,
    69. next_contact_time, address)
    70. values (#{id,jdbcType=CHAR}, #{owner,jdbcType=CHAR}, #{source,jdbcType=VARCHAR},
    71. #{customerId,jdbcType=CHAR}, #{fullname,jdbcType=VARCHAR}, #{appellation,jdbcType=VARCHAR},
    72. #{email,jdbcType=VARCHAR}, #{mphone,jdbcType=VARCHAR}, #{job,jdbcType=VARCHAR},
    73. #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=CHAR}, #{editBy,jdbcType=VARCHAR},
    74. #{editTime,jdbcType=CHAR}, #{description,jdbcType=VARCHAR}, #{contactSummary,jdbcType=VARCHAR},
    75. #{nextContactTime,jdbcType=CHAR}, #{address,jdbcType=VARCHAR})
    76. </insert>
    77. <insert id="insertSelective" parameterType="com.bjpowernode.crm.workbench.domain.Contacts" >
    78. <!--
    79. WARNING - @mbggenerated
    80. This element is automatically generated by MyBatis Generator, do not modify.
    81. This element was generated on Thu Mar 24 21:35:58 CST 2022.
    82. -->
    83. insert into tbl_contacts
    84. <trim prefix="(" suffix=")" suffixOverrides="," >
    85. <if test="id != null" >
    86. id,
    87. </if>
    88. <if test="owner != null" >
    89. owner,
    90. </if>
    91. <if test="source != null" >
    92. source,
    93. </if>
    94. <if test="customerId != null" >
    95. customer_id,
    96. </if>
    97. <if test="fullname != null" >
    98. fullname,
    99. </if>
    100. <if test="appellation != null" >
    101. appellation,
    102. </if>
    103. <if test="email != null" >
    104. email,
    105. </if>
    106. <if test="mphone != null" >
    107. mphone,
    108. </if>
    109. <if test="job != null" >
    110. job,
    111. </if>
    112. <if test="createBy != null" >
    113. create_by,
    114. </if>
    115. <if test="createTime != null" >
    116. create_time,
    117. </if>
    118. <if test="editBy != null" >
    119. edit_by,
    120. </if>
    121. <if test="editTime != null" >
    122. edit_time,
    123. </if>
    124. <if test="description != null" >
    125. description,
    126. </if>
    127. <if test="contactSummary != null" >
    128. contact_summary,
    129. </if>
    130. <if test="nextContactTime != null" >
    131. next_contact_time,
    132. </if>
    133. <if test="address != null" >
    134. address,
    135. </if>
    136. </trim>
    137. <trim prefix="values (" suffix=")" suffixOverrides="," >
    138. <if test="id != null" >
    139. #{id,jdbcType=CHAR},
    140. </if>
    141. <if test="owner != null" >
    142. #{owner,jdbcType=CHAR},
    143. </if>
    144. <if test="source != null" >
    145. #{source,jdbcType=VARCHAR},
    146. </if>
    147. <if test="customerId != null" >
    148. #{customerId,jdbcType=CHAR},
    149. </if>
    150. <if test="fullname != null" >
    151. #{fullname,jdbcType=VARCHAR},
    152. </if>
    153. <if test="appellation != null" >
    154. #{appellation,jdbcType=VARCHAR},
    155. </if>
    156. <if test="email != null" >
    157. #{email,jdbcType=VARCHAR},
    158. </if>
    159. <if test="mphone != null" >
    160. #{mphone,jdbcType=VARCHAR},
    161. </if>
    162. <if test="job != null" >
    163. #{job,jdbcType=VARCHAR},
    164. </if>
    165. <if test="createBy != null" >
    166. #{createBy,jdbcType=VARCHAR},
    167. </if>
    168. <if test="createTime != null" >
    169. #{createTime,jdbcType=CHAR},
    170. </if>
    171. <if test="editBy != null" >
    172. #{editBy,jdbcType=VARCHAR},
    173. </if>
    174. <if test="editTime != null" >
    175. #{editTime,jdbcType=CHAR},
    176. </if>
    177. <if test="description != null" >
    178. #{description,jdbcType=VARCHAR},
    179. </if>
    180. <if test="contactSummary != null" >
    181. #{contactSummary,jdbcType=VARCHAR},
    182. </if>
    183. <if test="nextContactTime != null" >
    184. #{nextContactTime,jdbcType=CHAR},
    185. </if>
    186. <if test="address != null" >
    187. #{address,jdbcType=VARCHAR},
    188. </if>
    189. </trim>
    190. </insert>
    191. <update id="updateByPrimaryKeySelective" parameterType="com.bjpowernode.crm.workbench.domain.Contacts" >
    192. <!--
    193. WARNING - @mbggenerated
    194. This element is automatically generated by MyBatis Generator, do not modify.
    195. This element was generated on Thu Mar 24 21:35:58 CST 2022.
    196. -->
    197. update tbl_contacts
    198. <set >
    199. <if test="owner != null" >
    200. owner = #{owner,jdbcType=CHAR},
    201. </if>
    202. <if test="source != null" >
    203. source = #{source,jdbcType=VARCHAR},
    204. </if>
    205. <if test="customerId != null" >
    206. customer_id = #{customerId,jdbcType=CHAR},
    207. </if>
    208. <if test="fullname != null" >
    209. fullname = #{fullname,jdbcType=VARCHAR},
    210. </if>
    211. <if test="appellation != null" >
    212. appellation = #{appellation,jdbcType=VARCHAR},
    213. </if>
    214. <if test="email != null" >
    215. email = #{email,jdbcType=VARCHAR},
    216. </if>
    217. <if test="mphone != null" >
    218. mphone = #{mphone,jdbcType=VARCHAR},
    219. </if>
    220. <if test="job != null" >
    221. job = #{job,jdbcType=VARCHAR},
    222. </if>
    223. <if test="createBy != null" >
    224. create_by = #{createBy,jdbcType=VARCHAR},
    225. </if>
    226. <if test="createTime != null" >
    227. create_time = #{createTime,jdbcType=CHAR},
    228. </if>
    229. <if test="editBy != null" >
    230. edit_by = #{editBy,jdbcType=VARCHAR},
    231. </if>
    232. <if test="editTime != null" >
    233. edit_time = #{editTime,jdbcType=CHAR},
    234. </if>
    235. <if test="description != null" >
    236. description = #{description,jdbcType=VARCHAR},
    237. </if>
    238. <if test="contactSummary != null" >
    239. contact_summary = #{contactSummary,jdbcType=VARCHAR},
    240. </if>
    241. <if test="nextContactTime != null" >
    242. next_contact_time = #{nextContactTime,jdbcType=CHAR},
    243. </if>
    244. <if test="address != null" >
    245. address = #{address,jdbcType=VARCHAR},
    246. </if>
    247. </set>
    248. where id = #{id,jdbcType=CHAR}
    249. </update>
    250. <update id="updateByPrimaryKey" parameterType="com.bjpowernode.crm.workbench.domain.Contacts" >
    251. <!--
    252. WARNING - @mbggenerated
    253. This element is automatically generated by MyBatis Generator, do not modify.
    254. This element was generated on Thu Mar 24 21:35:58 CST 2022.
    255. -->
    256. update tbl_contacts
    257. set owner = #{owner,jdbcType=CHAR},
    258. source = #{source,jdbcType=VARCHAR},
    259. customer_id = #{customerId,jdbcType=CHAR},
    260. fullname = #{fullname,jdbcType=VARCHAR},
    261. appellation = #{appellation,jdbcType=VARCHAR},
    262. email = #{email,jdbcType=VARCHAR},
    263. mphone = #{mphone,jdbcType=VARCHAR},
    264. job = #{job,jdbcType=VARCHAR},
    265. create_by = #{createBy,jdbcType=VARCHAR},
    266. create_time = #{createTime,jdbcType=CHAR},
    267. edit_by = #{editBy,jdbcType=VARCHAR},
    268. edit_time = #{editTime,jdbcType=CHAR},
    269. description = #{description,jdbcType=VARCHAR},
    270. contact_summary = #{contactSummary,jdbcType=VARCHAR},
    271. next_contact_time = #{nextContactTime,jdbcType=CHAR},
    272. address = #{address,jdbcType=VARCHAR}
    273. where id = #{id,jdbcType=CHAR}
    274. </update>
    275. <!--保存新增联系-->
    276. <insert id="insertContacts" parameterType="com.bjpowernode.crm.workbench.domain.Contacts">
    277. insert into tbl_contacts(id, owner, source, customer_id, fullname, appellation, email, mphone, job, create_by,
    278. create_time, description, contact_summary, next_contact_time, address)
    279. values (#{id}, #{owner}, #{source}, #{customerId}, #{fullname}, #{appellation}, #{email}, #{mphone}, #{job}, #{createBy},
    280. #{createTime}, #{description}, #{contactSummary}, #{nextContactTime}, #{address})
    281. </insert>
    282. <select id="selectContactsByConditionForPage" parameterType="map" resultMap="BaseResultMap">
    283. select co.id,co.fullname,dicv1.value as appellation,u1.name as owner,ifnull(co.job, ' ') as job,co.email,co.mphone,ifnull(dicv2.value, ' ') as source,
    284. ifnull(cu.name, ' ') as customer_id,u2.name as create_by,co.create_time,u3.name as edit_by,co.edit_time,co.description,
    285. co.contact_summary,co.next_contact_time,co.address
    286. from tbl_contacts co
    287. left join tbl_dic_value dicv1 on co.appellation=dicv1.id
    288. left join tbl_dic_value dicv2 on co.source=dicv2.id
    289. left join tbl_customer cu on co.customer_id=cu.id
    290. join tbl_user u1 on co.owner=u1.id
    291. join tbl_user u2 on co.create_by=u2.id
    292. left join tbl_user u3 on co.edit_by=u3.id
    293. <where>
    294. <if test="owner!=null and owner!=''">
    295. and u1.name like '%' #{owner} '%'
    296. </if>
    297. <if test="fullname!=null and fullname!=''">
    298. and co.fullname like '%' #{fullname} '%'
    299. </if>
    300. <if test="customerId!=null and customerId!=''">
    301. and cu.name like '%' #{customerId} '%'
    302. </if>
    303. <if test="source!=null and source!=''">
    304. and dicv2.value like '%' #{source} '%'
    305. </if>
    306. <if test="job!=null and job!=''">
    307. and co.job like '%' #{job} '%'
    308. </if>
    309. </where>
    310. order by co.create_time desc
    311. limit #{beginNo},#{pageSize}
    312. </select>
    313. <select id="selectCountOfContactsByCondition" parameterType="map" resultType="int">
    314. select count(*)
    315. from tbl_contacts co
    316. left join tbl_dic_value dicv1 on co.appellation=dicv1.id
    317. left join tbl_dic_value dicv2 on co.source=dicv2.id
    318. left join tbl_customer cu on co.customer_id=cu.id
    319. join tbl_user u1 on co.owner=u1.id
    320. join tbl_user u2 on co.create_by=u2.id
    321. left join tbl_user u3 on co.edit_by=u3.id
    322. <where>
    323. <if test="owner!=null and owner!=''">
    324. and u1.name like '%' #{owner} '%'
    325. </if>
    326. <if test="fullname!=null and fullname!=''">
    327. and co.fullname like '%' #{fullname} '%'
    328. </if>
    329. <if test="customerId!=null and customerId!=''">
    330. and cu.name like '%' #{customerId} '%'
    331. </if>
    332. <if test="source!=null and source!=''">
    333. and dicv2.value like '%' #{source} '%'
    334. </if>
    335. <if test="job!=null and job!=''">
    336. and co.job like '%' #{job} '%'
    337. </if>
    338. </where>
    339. </select>
    340. <select id="selectContactsById" resultMap="BaseResultMap" parameterType="string">
    341. select
    342. <include refid="Base_Column_List" />
    343. from tbl_contacts
    344. where id=#{id}
    345. </select>
    346. <update id="updateContacts" parameterType="com.bjpowernode.crm.workbench.domain.Contacts">
    347. update tbl_contacts
    348. set owner=#{owner}, source=#{source}, customer_id=#{customerId}, fullname=#{fullname}, appellation=#{appellation},
    349. email=#{email}, mphone=#{mphone}, job=#{job}, edit_by=#{editBy}, edit_time=#{editTime}, description=#{description},
    350. contact_summary=#{contactSummary}, next_contact_time=#{nextContactTime},address=#{address}
    351. where id=#{id}
    352. </update>
    353. <delete id="deleteContactsByIds" parameterType="string">
    354. delete from tbl_contacts
    355. where id in
    356. <foreach collection="array" item="id" separator="," open="(" close=")">
    357. #{id, jdbcType=VARCHAR}
    358. </foreach>
    359. </delete>
    360. <select id="selectContactsForDetailById" parameterType="string" resultMap="BaseResultMap">
    361. select co.id,co.fullname,dicv1.value as appellation,u1.name as owner,co.job,co.email,co.mphone,dicv2.value as source,
    362. cu.name as customer_id,u2.name as create_by,co.create_time,u3.name as edit_by,co.edit_time,co.description,
    363. co.contact_summary,co.next_contact_time,co.address
    364. from tbl_contacts co
    365. left join tbl_dic_value dicv1 on co.appellation=dicv1.id
    366. left join tbl_dic_value dicv2 on co.source=dicv2.id
    367. left join tbl_customer cu on co.customer_id=cu.id
    368. join tbl_user u1 on co.owner=u1.id
    369. join tbl_user u2 on co.create_by=u2.id
    370. left join tbl_user u3 on co.edit_by=u3.id
    371. where co.id=#{id}
    372. </select>
    373. <select id="selectContactsByFuzzyName" parameterType="string" resultMap="BaseResultMap">
    374. select co.id,co.fullname,dicv1.value as appellation,u1.name as owner,co.job,co.email,co.mphone,dicv2.value as source,
    375. cu.name as customer_id,u2.name as create_by,co.create_time,u3.name as edit_by,co.edit_time,co.description,
    376. co.contact_summary,co.next_contact_time,co.address
    377. from tbl_contacts co
    378. left join tbl_dic_value dicv1 on co.appellation=dicv1.id
    379. left join tbl_dic_value dicv2 on co.source=dicv2.id
    380. left join tbl_customer cu on co.customer_id=cu.id
    381. join tbl_user u1 on co.owner=u1.id
    382. join tbl_user u2 on co.create_by=u2.id
    383. left join tbl_user u3 on co.edit_by=u3.id
    384. where co.fullname like '%' #{contactsName} '%'
    385. </select>
    386. <select id="selectCountOfCustomerAndContactsGroupByCustomer" resultType="com.bjpowernode.crm.workbench.domain.FunnelVO">
    387. select count(*) as value,cu.name as name
    388. from tbl_contacts co
    389. join tbl_customer cu on co.customer_id=cu.id
    390. group by cu.name
    391. </select>
    392. </mapper>

    ContactsRemarkMapper 

    1. package com.bjpowernode.crm.workbench.mapper;
    2. import com.bjpowernode.crm.workbench.domain.ContactsRemark;
    3. import java.util.List;
    4. public interface ContactsRemarkMapper {
    5. /**
    6. * This method was generated by MyBatis Generator.
    7. * This method corresponds to the database table tbl_contacts_remark
    8. *
    9. * @mbggenerated Thu Mar 24 22:56:19 CST 2022
    10. */
    11. int deleteByPrimaryKey(String id);
    12. /**
    13. * This method was generated by MyBatis Generator.
    14. * This method corresponds to the database table tbl_contacts_remark
    15. *
    16. * @mbggenerated Thu Mar 24 22:56:19 CST 2022
    17. */
    18. int insert(ContactsRemark record);
    19. /**
    20. * This method was generated by MyBatis Generator.
    21. * This method corresponds to the database table tbl_contacts_remark
    22. *
    23. * @mbggenerated Thu Mar 24 22:56:19 CST 2022
    24. */
    25. int insertSelective(ContactsRemark record);
    26. /**
    27. * This method was generated by MyBatis Generator.
    28. * This method corresponds to the database table tbl_contacts_remark
    29. *
    30. * @mbggenerated Thu Mar 24 22:56:19 CST 2022
    31. */
    32. ContactsRemark selectByPrimaryKey(String id);
    33. /**
    34. * This method was generated by MyBatis Generator.
    35. * This method corresponds to the database table tbl_contacts_remark
    36. *
    37. * @mbggenerated Thu Mar 24 22:56:19 CST 2022
    38. */
    39. int updateByPrimaryKeySelective(ContactsRemark record);
    40. /**
    41. * This method was generated by MyBatis Generator.
    42. * This method corresponds to the database table tbl_contacts_remark
    43. *
    44. * @mbggenerated Thu Mar 24 22:56:19 CST 2022
    45. */
    46. int updateByPrimaryKey(ContactsRemark record);
    47. /**
    48. * 批量插入联系人备注
    49. * @param contactsRemarkList 联系人备注集合
    50. * @return 插入条数
    51. */
    52. int insertContactsRemarkByList(List<ContactsRemark> contactsRemarkList);
    53. /**
    54. * 通过联系人id查询对应联系人的所有备注
    55. * @param contactsId 联系人id
    56. * @return 对应联系人备注集合
    57. */
    58. List<ContactsRemark> selectContactsRemarkForDetailByContactsId(String contactsId);
    59. /**
    60. * 新增一条联系人备注
    61. * @param contactsRemark 联系人备注
    62. * @return 新增条数
    63. */
    64. int insertContactsRemark(ContactsRemark contactsRemark);
    65. /**
    66. * 通过联系人id删除备注(用于删除联系人时同时删除该联系人备注;因为可能一次性会删除多个联系人,所以传入的id是联系人id数组)
    67. * @param contactsIds 联系人id
    68. * @return 删除的条数
    69. */
    70. int deleteContactsRemarkByContactsId(String[] contactsIds);
    71. /**
    72. * 通过联系人备注的id删除联系人备注
    73. * @param id 联系人备注的id
    74. * @return 删除的条数
    75. */
    76. int deleteContactsRemarkById(String id);
    77. /**
    78. * 更新联系人备注
    79. * @param contactsRemark 更新的联系人备注
    80. * @return 更新的条数
    81. */
    82. int updateContactsRemark(ContactsRemark contactsRemark);
    83. }

    ContactsRemarkMapper .xml:

    1. <?xml version="1.0" encoding="UTF-8" ?>
    2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
    3. <mapper namespace="com.bjpowernode.crm.workbench.mapper.ContactsRemarkMapper" >
    4. <resultMap id="BaseResultMap" type="com.bjpowernode.crm.workbench.domain.ContactsRemark" >
    5. <!--
    6. WARNING - @mbggenerated
    7. This element is automatically generated by MyBatis Generator, do not modify.
    8. This element was generated on Thu Mar 24 22:56:19 CST 2022.
    9. -->
    10. <id column="id" property="id" jdbcType="CHAR" />
    11. <result column="note_content" property="noteContent" jdbcType="VARCHAR" />
    12. <result column="create_by" property="createBy" jdbcType="VARCHAR" />
    13. <result column="create_time" property="createTime" jdbcType="CHAR" />
    14. <result column="edit_by" property="editBy" jdbcType="VARCHAR" />
    15. <result column="edit_time" property="editTime" jdbcType="CHAR" />
    16. <result column="edit_flag" property="editFlag" jdbcType="CHAR" />
    17. <result column="contacts_id" property="contactsId" jdbcType="CHAR" />
    18. </resultMap>
    19. <sql id="Base_Column_List" >
    20. <!--
    21. WARNING - @mbggenerated
    22. This element is automatically generated by MyBatis Generator, do not modify.
    23. This element was generated on Thu Mar 24 22:56:19 CST 2022.
    24. -->
    25. id, note_content, create_by, create_time, edit_by, edit_time, edit_flag, contacts_id
    26. </sql>
    27. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    28. <!--
    29. WARNING - @mbggenerated
    30. This element is automatically generated by MyBatis Generator, do not modify.
    31. This element was generated on Thu Mar 24 22:56:19 CST 2022.
    32. -->
    33. select
    34. <include refid="Base_Column_List" />
    35. from tbl_contacts_remark
    36. where id = #{id,jdbcType=CHAR}
    37. </select>
    38. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    39. <!--
    40. WARNING - @mbggenerated
    41. This element is automatically generated by MyBatis Generator, do not modify.
    42. This element was generated on Thu Mar 24 22:56:19 CST 2022.
    43. -->
    44. delete from tbl_contacts_remark
    45. where id = #{id,jdbcType=CHAR}
    46. </delete>
    47. <insert id="insert" parameterType="com.bjpowernode.crm.workbench.domain.ContactsRemark" >
    48. <!--
    49. WARNING - @mbggenerated
    50. This element is automatically generated by MyBatis Generator, do not modify.
    51. This element was generated on Thu Mar 24 22:56:19 CST 2022.
    52. -->
    53. insert into tbl_contacts_remark (id, note_content, create_by,
    54. create_time, edit_by, edit_time,
    55. edit_flag, contacts_id)
    56. values (#{id,jdbcType=CHAR}, #{noteContent,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
    57. #{createTime,jdbcType=CHAR}, #{editBy,jdbcType=VARCHAR}, #{editTime,jdbcType=CHAR},
    58. #{editFlag,jdbcType=CHAR}, #{contactsId,jdbcType=CHAR})
    59. </insert>
    60. <insert id="insertSelective" parameterType="com.bjpowernode.crm.workbench.domain.ContactsRemark" >
    61. <!--
    62. WARNING - @mbggenerated
    63. This element is automatically generated by MyBatis Generator, do not modify.
    64. This element was generated on Thu Mar 24 22:56:19 CST 2022.
    65. -->
    66. insert into tbl_contacts_remark
    67. <trim prefix="(" suffix=")" suffixOverrides="," >
    68. <if test="id != null" >
    69. id,
    70. </if>
    71. <if test="noteContent != null" >
    72. note_content,
    73. </if>
    74. <if test="createBy != null" >
    75. create_by,
    76. </if>
    77. <if test="createTime != null" >
    78. create_time,
    79. </if>
    80. <if test="editBy != null" >
    81. edit_by,
    82. </if>
    83. <if test="editTime != null" >
    84. edit_time,
    85. </if>
    86. <if test="editFlag != null" >
    87. edit_flag,
    88. </if>
    89. <if test="contactsId != null" >
    90. contacts_id,
    91. </if>
    92. </trim>
    93. <trim prefix="values (" suffix=")" suffixOverrides="," >
    94. <if test="id != null" >
    95. #{id,jdbcType=CHAR},
    96. </if>
    97. <if test="noteContent != null" >
    98. #{noteContent,jdbcType=VARCHAR},
    99. </if>
    100. <if test="createBy != null" >
    101. #{createBy,jdbcType=VARCHAR},
    102. </if>
    103. <if test="createTime != null" >
    104. #{createTime,jdbcType=CHAR},
    105. </if>
    106. <if test="editBy != null" >
    107. #{editBy,jdbcType=VARCHAR},
    108. </if>
    109. <if test="editTime != null" >
    110. #{editTime,jdbcType=CHAR},
    111. </if>
    112. <if test="editFlag != null" >
    113. #{editFlag,jdbcType=CHAR},
    114. </if>
    115. <if test="contactsId != null" >
    116. #{contactsId,jdbcType=CHAR},
    117. </if>
    118. </trim>
    119. </insert>
    120. <update id="updateByPrimaryKeySelective" parameterType="com.bjpowernode.crm.workbench.domain.ContactsRemark" >
    121. <!--
    122. WARNING - @mbggenerated
    123. This element is automatically generated by MyBatis Generator, do not modify.
    124. This element was generated on Thu Mar 24 22:56:19 CST 2022.
    125. -->
    126. update tbl_contacts_remark
    127. <set >
    128. <if test="noteContent != null" >
    129. note_content = #{noteContent,jdbcType=VARCHAR},
    130. </if>
    131. <if test="createBy != null" >
    132. create_by = #{createBy,jdbcType=VARCHAR},
    133. </if>
    134. <if test="createTime != null" >
    135. create_time = #{createTime,jdbcType=CHAR},
    136. </if>
    137. <if test="editBy != null" >
    138. edit_by = #{editBy,jdbcType=VARCHAR},
    139. </if>
    140. <if test="editTime != null" >
    141. edit_time = #{editTime,jdbcType=CHAR},
    142. </if>
    143. <if test="editFlag != null" >
    144. edit_flag = #{editFlag,jdbcType=CHAR},
    145. </if>
    146. <if test="contactsId != null" >
    147. contacts_id = #{contactsId,jdbcType=CHAR},
    148. </if>
    149. </set>
    150. where id = #{id,jdbcType=CHAR}
    151. </update>
    152. <update id="updateByPrimaryKey" parameterType="com.bjpowernode.crm.workbench.domain.ContactsRemark" >
    153. <!--
    154. WARNING - @mbggenerated
    155. This element is automatically generated by MyBatis Generator, do not modify.
    156. This element was generated on Thu Mar 24 22:56:19 CST 2022.
    157. -->
    158. update tbl_contacts_remark
    159. set note_content = #{noteContent,jdbcType=VARCHAR},
    160. create_by = #{createBy,jdbcType=VARCHAR},
    161. create_time = #{createTime,jdbcType=CHAR},
    162. edit_by = #{editBy,jdbcType=VARCHAR},
    163. edit_time = #{editTime,jdbcType=CHAR},
    164. edit_flag = #{editFlag,jdbcType=CHAR},
    165. contacts_id = #{contactsId,jdbcType=CHAR}
    166. where id = #{id,jdbcType=CHAR}
    167. </update>
    168. <!--批量插入联系人备注-->
    169. <insert id="insertContactsRemarkByList" parameterType="com.bjpowernode.crm.workbench.domain.ContactsRemark">
    170. insert into tbl_contacts_remark(id, note_content, create_by, create_time, edit_by, edit_time, edit_flag, contacts_id)
    171. values
    172. <foreach collection="list" item="obj" separator=",">
    173. (#{obj.id},#{obj.noteContent},#{obj.createBy},#{obj.createTime},#{obj.editBy},#{obj.editTime},#{obj.editFlag},#{obj.contactsId})
    174. </foreach>
    175. </insert>
    176. <select id="selectContactsRemarkForDetailByContactsId" resultMap="BaseResultMap" parameterType="string">
    177. select co.id,co.note_content,u1.name as create_by,co.create_time,u2.name as edit_by,co.edit_time,co.edit_flag
    178. from tbl_contacts_remark co
    179. join tbl_user u1 on co.create_by=u1.id
    180. left join tbl_user u2 on co.edit_by=u2.id
    181. where co.contacts_id=#{contactsId}
    182. </select>
    183. <insert id="insertContactsRemark" parameterType="com.bjpowernode.crm.workbench.domain.ContactsRemark">
    184. insert into
    185. tbl_contacts_remark(id, note_content, create_time, create_by, edit_flag, contacts_id)
    186. values(#{id},#{noteContent},#{createTime},#{createBy},#{editFlag},#{contactsId})
    187. </insert>
    188. <delete id="deleteContactsRemarkByContactsId" parameterType="string">
    189. delete from tbl_contacts_remark
    190. where contacts_id in
    191. <foreach collection="array" item="id" separator="," open="(" close=")">
    192. #{id, jdbcType=VARCHAR}
    193. </foreach>
    194. </delete>
    195. <delete id="deleteContactsRemarkById" parameterType="string">
    196. delete from tbl_contacts_remark
    197. where id=#{id}
    198. </delete>
    199. <update id="updateContactsRemark" parameterType="com.bjpowernode.crm.workbench.domain.ContactsRemark">
    200. update tbl_contacts_remark
    201. set note_content=#{noteContent},edit_time=#{editTime},edit_by=#{editBy},edit_flag=#{editFlag}
    202. where id=#{id}
    203. </update>
    204. </mapper>

    CustomerMapper

    1. package com.bjpowernode.crm.workbench.mapper;
    2. import com.bjpowernode.crm.workbench.domain.Customer;
    3. import java.util.List;
    4. import java.util.Map;
    5. public interface CustomerMapper {
    6. /**
    7. * This method was generated by MyBatis Generator.
    8. * This method corresponds to the database table tbl_customer
    9. *
    10. * @mbggenerated Wed Mar 23 20:58:10 CST 2022
    11. */
    12. int deleteByPrimaryKey(String id);
    13. /**
    14. * This method was generated by MyBatis Generator.
    15. * This method corresponds to the database table tbl_customer
    16. *
    17. * @mbggenerated Wed Mar 23 20:58:10 CST 2022
    18. */
    19. int insert(Customer record);
    20. /**
    21. * This method was generated by MyBatis Generator.
    22. * This method corresponds to the database table tbl_customer
    23. *
    24. * @mbggenerated Wed Mar 23 20:58:10 CST 2022
    25. */
    26. int insertSelective(Customer record);
    27. /**
    28. * This method was generated by MyBatis Generator.
    29. * This method corresponds to the database table tbl_customer
    30. *
    31. * @mbggenerated Wed Mar 23 20:58:10 CST 2022
    32. */
    33. Customer selectByPrimaryKey(String id);
    34. /**
    35. * This method was generated by MyBatis Generator.
    36. * This method corresponds to the database table tbl_customer
    37. *
    38. * @mbggenerated Wed Mar 23 20:58:10 CST 2022
    39. */
    40. int updateByPrimaryKeySelective(Customer record);
    41. /**
    42. * This method was generated by MyBatis Generator.
    43. * This method corresponds to the database table tbl_customer
    44. *
    45. * @mbggenerated Wed Mar 23 20:58:10 CST 2022
    46. */
    47. int updateByPrimaryKey(Customer record);
    48. /**
    49. * 插入新用户
    50. * @param customer 用户信息
    51. * @return 插入条数
    52. */
    53. int insertCustomer(Customer customer);
    54. /**
    55. * 根据条件分页查询客户列表
    56. * @param map 查询条件
    57. * @return 查询到的客户
    58. */
    59. List<Customer> selectCustomerByConditionForPage(Map<String, Object> map);
    60. /**
    61. * 根据条件查询客户总条数
    62. * @param map 查询条件
    63. * @return 客户总条数
    64. */
    65. int selectCountOfCustomerByCondition(Map<String, Object> map);
    66. /**
    67. * 通过id查询客户信息
    68. * @param id 客户id
    69. * @return 查询到的客户
    70. */
    71. Customer selectCustomerById(String id);
    72. /**
    73. * 修改客户
    74. * @param customer 客户信息
    75. * @return 修改条数
    76. */
    77. int updateCustomer(Customer customer);
    78. /**
    79. * 通过客户id数组删除对应的客户
    80. * @param ids 客户id数组
    81. * @return 删除的条数
    82. */
    83. int deleteCustomerByIds(String[] ids);
    84. /**
    85. * 通过客户id查询客户的详细信息
    86. * @param id 客户id
    87. * @return 查询到的客户
    88. */
    89. Customer selectCustomerForDetailById(String id);
    90. /**
    91. * 通过客户姓名模糊查询客户全名
    92. * @param customerName 模糊查询客户姓名
    93. * @return 匹配的客户全名
    94. */
    95. List<String> selectCustomerNameByFuzzyName(String customerName);
    96. /**
    97. * 通过客户姓名查询客户详细信息
    98. * @param customerName 客户姓名
    99. * @return 客户
    100. */
    101. Customer selectCustomerByName(String customerName);
    102. /**
    103. * 通过客户姓名查询客户id
    104. * @param customerName 客户姓名
    105. * @return 客户姓名
    106. */
    107. String selectCustomerIdByName(String customerName);
    108. }

    CustomerMapper.xml: 

    1. <?xml version="1.0" encoding="UTF-8" ?>
    2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
    3. <mapper namespace="com.bjpowernode.crm.workbench.mapper.CustomerMapper" >
    4. <resultMap id="BaseResultMap" type="com.bjpowernode.crm.workbench.domain.Customer" >
    5. <!--
    6. WARNING - @mbggenerated
    7. This element is automatically generated by MyBatis Generator, do not modify.
    8. This element was generated on Wed Mar 23 20:58:10 CST 2022.
    9. -->
    10. <id column="id" property="id" jdbcType="CHAR" />
    11. <result column="owner" property="owner" jdbcType="CHAR" />
    12. <result column="name" property="name" jdbcType="VARCHAR" />
    13. <result column="website" property="website" jdbcType="VARCHAR" />
    14. <result column="phone" property="phone" jdbcType="VARCHAR" />
    15. <result column="create_by" property="createBy" jdbcType="VARCHAR" />
    16. <result column="create_time" property="createTime" jdbcType="CHAR" />
    17. <result column="edit_by" property="editBy" jdbcType="VARCHAR" />
    18. <result column="edit_time" property="editTime" jdbcType="CHAR" />
    19. <result column="contact_summary" property="contactSummary" jdbcType="VARCHAR" />
    20. <result column="next_contact_time" property="nextContactTime" jdbcType="CHAR" />
    21. <result column="description" property="description" jdbcType="VARCHAR" />
    22. <result column="address" property="address" jdbcType="VARCHAR" />
    23. </resultMap>
    24. <sql id="Base_Column_List" >
    25. <!--
    26. WARNING - @mbggenerated
    27. This element is automatically generated by MyBatis Generator, do not modify.
    28. This element was generated on Wed Mar 23 20:58:10 CST 2022.
    29. -->
    30. id, owner, name, website, phone, create_by, create_time, edit_by, edit_time, contact_summary,
    31. next_contact_time, description, address
    32. </sql>
    33. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    34. <!--
    35. WARNING - @mbggenerated
    36. This element is automatically generated by MyBatis Generator, do not modify.
    37. This element was generated on Wed Mar 23 20:58:10 CST 2022.
    38. -->
    39. select
    40. <include refid="Base_Column_List" />
    41. from tbl_customer
    42. where id = #{id,jdbcType=CHAR}
    43. </select>
    44. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    45. <!--
    46. WARNING - @mbggenerated
    47. This element is automatically generated by MyBatis Generator, do not modify.
    48. This element was generated on Wed Mar 23 20:58:10 CST 2022.
    49. -->
    50. delete from tbl_customer
    51. where id = #{id,jdbcType=CHAR}
    52. </delete>
    53. <insert id="insert" parameterType="com.bjpowernode.crm.workbench.domain.Customer" >
    54. <!--
    55. WARNING - @mbggenerated
    56. This element is automatically generated by MyBatis Generator, do not modify.
    57. This element was generated on Wed Mar 23 20:58:10 CST 2022.
    58. -->
    59. insert into tbl_customer (id, owner, name, website,
    60. phone, create_by, create_time,
    61. edit_by, edit_time, contact_summary,
    62. next_contact_time, description, address
    63. )
    64. values (#{id,jdbcType=CHAR}, #{owner,jdbcType=CHAR}, #{name,jdbcType=VARCHAR}, #{website,jdbcType=VARCHAR},
    65. #{phone,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=CHAR},
    66. #{editBy,jdbcType=VARCHAR}, #{editTime,jdbcType=CHAR}, #{contactSummary,jdbcType=VARCHAR},
    67. #{nextContactTime,jdbcType=CHAR}, #{description,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}
    68. )
    69. </insert>
    70. <insert id="insertSelective" parameterType="com.bjpowernode.crm.workbench.domain.Customer" >
    71. <!--
    72. WARNING - @mbggenerated
    73. This element is automatically generated by MyBatis Generator, do not modify.
    74. This element was generated on Wed Mar 23 20:58:10 CST 2022.
    75. -->
    76. insert into tbl_customer
    77. <trim prefix="(" suffix=")" suffixOverrides="," >
    78. <if test="id != null" >
    79. id,
    80. </if>
    81. <if test="owner != null" >
    82. owner,
    83. </if>
    84. <if test="name != null" >
    85. name,
    86. </if>
    87. <if test="website != null" >
    88. website,
    89. </if>
    90. <if test="phone != null" >
    91. phone,
    92. </if>
    93. <if test="createBy != null" >
    94. create_by,
    95. </if>
    96. <if test="createTime != null" >
    97. create_time,
    98. </if>
    99. <if test="editBy != null" >
    100. edit_by,
    101. </if>
    102. <if test="editTime != null" >
    103. edit_time,
    104. </if>
    105. <if test="contactSummary != null" >
    106. contact_summary,
    107. </if>
    108. <if test="nextContactTime != null" >
    109. next_contact_time,
    110. </if>
    111. <if test="description != null" >
    112. description,
    113. </if>
    114. <if test="address != null" >
    115. address,
    116. </if>
    117. </trim>
    118. <trim prefix="values (" suffix=")" suffixOverrides="," >
    119. <if test="id != null" >
    120. #{id,jdbcType=CHAR},
    121. </if>
    122. <if test="owner != null" >
    123. #{owner,jdbcType=CHAR},
    124. </if>
    125. <if test="name != null" >
    126. #{name,jdbcType=VARCHAR},
    127. </if>
    128. <if test="website != null" >
    129. #{website,jdbcType=VARCHAR},
    130. </if>
    131. <if test="phone != null" >
    132. #{phone,jdbcType=VARCHAR},
    133. </if>
    134. <if test="createBy != null" >
    135. #{createBy,jdbcType=VARCHAR},
    136. </if>
    137. <if test="createTime != null" >
    138. #{createTime,jdbcType=CHAR},
    139. </if>
    140. <if test="editBy != null" >
    141. #{editBy,jdbcType=VARCHAR},
    142. </if>
    143. <if test="editTime != null" >
    144. #{editTime,jdbcType=CHAR},
    145. </if>
    146. <if test="contactSummary != null" >
    147. #{contactSummary,jdbcType=VARCHAR},
    148. </if>
    149. <if test="nextContactTime != null" >
    150. #{nextContactTime,jdbcType=CHAR},
    151. </if>
    152. <if test="description != null" >
    153. #{description,jdbcType=VARCHAR},
    154. </if>
    155. <if test="address != null" >
    156. #{address,jdbcType=VARCHAR},
    157. </if>
    158. </trim>
    159. </insert>
    160. <update id="updateByPrimaryKeySelective" parameterType="com.bjpowernode.crm.workbench.domain.Customer" >
    161. <!--
    162. WARNING - @mbggenerated
    163. This element is automatically generated by MyBatis Generator, do not modify.
    164. This element was generated on Wed Mar 23 20:58:10 CST 2022.
    165. -->
    166. update tbl_customer
    167. <set >
    168. <if test="owner != null" >
    169. owner = #{owner,jdbcType=CHAR},
    170. </if>
    171. <if test="name != null" >
    172. name = #{name,jdbcType=VARCHAR},
    173. </if>
    174. <if test="website != null" >
    175. website = #{website,jdbcType=VARCHAR},
    176. </if>
    177. <if test="phone != null" >
    178. phone = #{phone,jdbcType=VARCHAR},
    179. </if>
    180. <if test="createBy != null" >
    181. create_by = #{createBy,jdbcType=VARCHAR},
    182. </if>
    183. <if test="createTime != null" >
    184. create_time = #{createTime,jdbcType=CHAR},
    185. </if>
    186. <if test="editBy != null" >
    187. edit_by = #{editBy,jdbcType=VARCHAR},
    188. </if>
    189. <if test="editTime != null" >
    190. edit_time = #{editTime,jdbcType=CHAR},
    191. </if>
    192. <if test="contactSummary != null" >
    193. contact_summary = #{contactSummary,jdbcType=VARCHAR},
    194. </if>
    195. <if test="nextContactTime != null" >
    196. next_contact_time = #{nextContactTime,jdbcType=CHAR},
    197. </if>
    198. <if test="description != null" >
    199. description = #{description,jdbcType=VARCHAR},
    200. </if>
    201. <if test="address != null" >
    202. address = #{address,jdbcType=VARCHAR},
    203. </if>
    204. </set>
    205. where id = #{id,jdbcType=CHAR}
    206. </update>
    207. <update id="updateByPrimaryKey" parameterType="com.bjpowernode.crm.workbench.domain.Customer" >
    208. <!--
    209. WARNING - @mbggenerated
    210. This element is automatically generated by MyBatis Generator, do not modify.
    211. This element was generated on Wed Mar 23 20:58:10 CST 2022.
    212. -->
    213. update tbl_customer
    214. set owner = #{owner,jdbcType=CHAR},
    215. name = #{name,jdbcType=VARCHAR},
    216. website = #{website,jdbcType=VARCHAR},
    217. phone = #{phone,jdbcType=VARCHAR},
    218. create_by = #{createBy,jdbcType=VARCHAR},
    219. create_time = #{createTime,jdbcType=CHAR},
    220. edit_by = #{editBy,jdbcType=VARCHAR},
    221. edit_time = #{editTime,jdbcType=CHAR},
    222. contact_summary = #{contactSummary,jdbcType=VARCHAR},
    223. next_contact_time = #{nextContactTime,jdbcType=CHAR},
    224. description = #{description,jdbcType=VARCHAR},
    225. address = #{address,jdbcType=VARCHAR}
    226. where id = #{id,jdbcType=CHAR}
    227. </update>
    228. <!--插入新用户-->
    229. <insert id="insertCustomer" parameterType="com.bjpowernode.crm.workbench.domain.Customer">
    230. insert into tbl_customer(id, owner, name, website, phone, create_by, create_time, contact_summary,next_contact_time, description, address)
    231. values (#{id}, #{owner}, #{name}, #{website}, #{phone}, #{createBy},#{createTime},
    232. #{contactSummary},#{nextContactTime},#{description}, #{address})
    233. </insert>
    234. <select id="selectCustomerByConditionForPage" parameterType="map" resultMap="BaseResultMap">
    235. select c.id, u1.name as owner, c.name, ifnull(c.website, ' ') as website, ifnull(c.phone, ' ') as phone, u2.name as create_by,
    236. c.create_time,u3.name as edit_by, c.edit_time, c.contact_summary, c.next_contact_time, c.description, c.address
    237. from tbl_customer c
    238. join tbl_user u1 on c.owner=u1.id
    239. join tbl_user u2 on c.create_by=u2.id
    240. left join tbl_user u3 on c.edit_by=u3.id
    241. <where>
    242. <if test="name!=null and name!=''">
    243. and c.name like '%' #{name} '%'
    244. </if>
    245. <if test="owner!=null and owner!=''">
    246. and u1.name like '%' #{owner} '%'
    247. </if>
    248. <if test="phone!=null and phone!=''">
    249. and c.phone like '%' #{phone} '%'
    250. </if>
    251. <if test="website!=null and website!=''">
    252. and c.website like '%' #{website} '%'
    253. </if>
    254. </where>
    255. order by c.create_time desc
    256. limit #{beginNo},#{pageSize}
    257. </select>
    258. <select id="selectCountOfCustomerByCondition" parameterType="map" resultType="int">
    259. select count(*)
    260. from tbl_customer c
    261. join tbl_user u1 on c.owner=u1.id
    262. join tbl_user u2 on c.create_by=u2.id
    263. left join tbl_user u3 on c.edit_by=u3.id
    264. <where>
    265. <if test="name!=null and name!=''">
    266. and c.name like '%' #{name} '%'
    267. </if>
    268. <if test="owner!=null and owner!=''">
    269. and u1.name like '%' #{owner} '%'
    270. </if>
    271. <if test="phone!=null and phone!=''">
    272. and c.phone like '%' #{phone} '%'
    273. </if>
    274. <if test="website!=null and website!=''">
    275. and c.website like '%' #{website} '%'
    276. </if>
    277. </where>
    278. </select>
    279. <select id="selectCustomerById" parameterType="string" resultMap="BaseResultMap">
    280. select
    281. <include refid="Base_Column_List" />
    282. from tbl_customer
    283. where id = #{id,jdbcType=CHAR}
    284. </select>
    285. <update id="updateCustomer" parameterType="com.bjpowernode.crm.workbench.domain.Customer">
    286. update tbl_customer
    287. set owner=#{owner}, name=#{name}, website=#{website}, phone=#{phone},edit_by=#{editBy},edit_time=#{editTime},
    288. contact_summary=#{contactSummary},next_contact_time=#{nextContactTime}, description=#{description}, address=#{address}
    289. where id=#{id}
    290. </update>
    291. <delete id="deleteCustomerByIds" parameterType="string">
    292. delete from tbl_customer
    293. where id in
    294. <foreach collection="array" item="id" separator="," open="(" close=")">
    295. #{id}
    296. </foreach>
    297. </delete>
    298. <select id="selectCustomerForDetailById" parameterType="string" resultMap="BaseResultMap">
    299. select c.id, u1.name as owner, c.name, c.website, c.phone, u2.name as create_by, c.create_time,
    300. u3.name as edit_by, c.edit_time, c.contact_summary, c.next_contact_time, c.description, c.address
    301. from tbl_customer c
    302. join tbl_user u1 on c.owner=u1.id
    303. join tbl_user u2 on c.create_by=u2.id
    304. left join tbl_user u3 on c.edit_by=u3.id
    305. where c.id=#{id}
    306. </select>
    307. <!--通过客户姓名模糊查询客户全名-->
    308. <select id="selectCustomerNameByFuzzyName" parameterType="string" resultType="string">
    309. select name
    310. from tbl_customer
    311. where name like '%' #{customerName} '%'
    312. </select>
    313. <!--过客户姓名查询客户详细信息-->
    314. <select id="selectCustomerByName" resultMap="BaseResultMap" parameterType="string">
    315. select
    316. <include refid="Base_Column_List"/>
    317. from tbl_customer
    318. where name=#{customerName}
    319. </select>
    320. <!--通过客户姓名查询客户id-->
    321. <select id="selectCustomerIdByName" resultType="string" parameterType="string">
    322. select id
    323. from tbl_customer
    324. where name=#{customerName}
    325. </select>
    326. </mapper>

    CustomerRemarkMapper 

    1. package com.bjpowernode.crm.workbench.mapper;
    2. import com.bjpowernode.crm.workbench.domain.CustomerRemark;
    3. import java.util.List;
    4. public interface CustomerRemarkMapper {
    5. /**
    6. * This method was generated by MyBatis Generator.
    7. * This method corresponds to the database table tbl_customer_remark
    8. *
    9. * @mbggenerated Thu Mar 24 22:29:16 CST 2022
    10. */
    11. int deleteByPrimaryKey(String id);
    12. /**
    13. * This method was generated by MyBatis Generator.
    14. * This method corresponds to the database table tbl_customer_remark
    15. *
    16. * @mbggenerated Thu Mar 24 22:29:16 CST 2022
    17. */
    18. int insert(CustomerRemark record);
    19. /**
    20. * This method was generated by MyBatis Generator.
    21. * This method corresponds to the database table tbl_customer_remark
    22. *
    23. * @mbggenerated Thu Mar 24 22:29:16 CST 2022
    24. */
    25. int insertSelective(CustomerRemark record);
    26. /**
    27. * This method was generated by MyBatis Generator.
    28. * This method corresponds to the database table tbl_customer_remark
    29. *
    30. * @mbggenerated Thu Mar 24 22:29:16 CST 2022
    31. */
    32. CustomerRemark selectByPrimaryKey(String id);
    33. /**
    34. * This method was generated by MyBatis Generator.
    35. * This method corresponds to the database table tbl_customer_remark
    36. *
    37. * @mbggenerated Thu Mar 24 22:29:16 CST 2022
    38. */
    39. int updateByPrimaryKeySelective(CustomerRemark record);
    40. /**
    41. * This method was generated by MyBatis Generator.
    42. * This method corresponds to the database table tbl_customer_remark
    43. *
    44. * @mbggenerated Thu Mar 24 22:29:16 CST 2022
    45. */
    46. int updateByPrimaryKey(CustomerRemark record);
    47. /**
    48. * 通过客户备注集合插入客户备注
    49. * @param customerRemarkList 客户备注集合
    50. * @return 插入条数
    51. */
    52. int insertCustomerRemarkByList(List<CustomerRemark> customerRemarkList);
    53. /**
    54. * 通过客户id查询该客户备注详细信息
    55. * @param customerId
    56. * @return
    57. */
    58. List<CustomerRemark> selectCustomerRemarkForDetailByCustomerId(String customerId);
    59. /**
    60. * 通过客户id数组删除备注(用于删除客户时同时删除该客户备注;因为可能一次性会删除多个客户,所以传入的id是客户id数组)
    61. * @param customerIds 客户id数组
    62. * @return 删除的条数
    63. */
    64. int deleteCustomerRemarkByCustomerIds(String[] customerIds);
    65. /**
    66. * 新增客户备注
    67. * @param customerRemark 客户备注
    68. * @return 新增条数
    69. */
    70. int insertCustomerRemark(CustomerRemark customerRemark);
    71. /**
    72. * 通过客户备注id删除备注
    73. * @param id 客户id
    74. * @return 删除的条数
    75. */
    76. int deleteCustomerRemarkById(String id);
    77. /**
    78. * 更新客户备注
    79. * @param customerRemark 客户备注信息
    80. * @return 更新条数
    81. */
    82. int updateCustomerRemark(CustomerRemark customerRemark);
    83. }

    CustomerRemarkMapper.xml:

    1. <?xml version="1.0" encoding="UTF-8" ?>
    2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
    3. <mapper namespace="com.bjpowernode.crm.workbench.mapper.CustomerRemarkMapper" >
    4. <resultMap id="BaseResultMap" type="com.bjpowernode.crm.workbench.domain.CustomerRemark" >
    5. <!--
    6. WARNING - @mbggenerated
    7. This element is automatically generated by MyBatis Generator, do not modify.
    8. This element was generated on Thu Mar 24 22:29:16 CST 2022.
    9. -->
    10. <id column="id" property="id" jdbcType="CHAR" />
    11. <result column="note_content" property="noteContent" jdbcType="VARCHAR" />
    12. <result column="create_by" property="createBy" jdbcType="VARCHAR" />
    13. <result column="create_time" property="createTime" jdbcType="CHAR" />
    14. <result column="edit_by" property="editBy" jdbcType="VARCHAR" />
    15. <result column="edit_time" property="editTime" jdbcType="CHAR" />
    16. <result column="edit_flag" property="editFlag" jdbcType="CHAR" />
    17. <result column="customer_id" property="customerId" jdbcType="CHAR" />
    18. </resultMap>
    19. <sql id="Base_Column_List" >
    20. <!--
    21. WARNING - @mbggenerated
    22. This element is automatically generated by MyBatis Generator, do not modify.
    23. This element was generated on Thu Mar 24 22:29:16 CST 2022.
    24. -->
    25. id, note_content, create_by, create_time, edit_by, edit_time, edit_flag, customer_id
    26. </sql>
    27. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    28. <!--
    29. WARNING - @mbggenerated
    30. This element is automatically generated by MyBatis Generator, do not modify.
    31. This element was generated on Thu Mar 24 22:29:16 CST 2022.
    32. -->
    33. select
    34. <include refid="Base_Column_List" />
    35. from tbl_customer_remark
    36. where id = #{id,jdbcType=CHAR}
    37. </select>
    38. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    39. <!--
    40. WARNING - @mbggenerated
    41. This element is automatically generated by MyBatis Generator, do not modify.
    42. This element was generated on Thu Mar 24 22:29:16 CST 2022.
    43. -->
    44. delete from tbl_customer_remark
    45. where id = #{id,jdbcType=CHAR}
    46. </delete>
    47. <insert id="insert" parameterType="com.bjpowernode.crm.workbench.domain.CustomerRemark" >
    48. <!--
    49. WARNING - @mbggenerated
    50. This element is automatically generated by MyBatis Generator, do not modify.
    51. This element was generated on Thu Mar 24 22:29:16 CST 2022.
    52. -->
    53. insert into tbl_customer_remark (id, note_content, create_by,
    54. create_time, edit_by, edit_time,
    55. edit_flag, customer_id)
    56. values (#{id,jdbcType=CHAR}, #{noteContent,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
    57. #{createTime,jdbcType=CHAR}, #{editBy,jdbcType=VARCHAR}, #{editTime,jdbcType=CHAR},
    58. #{editFlag,jdbcType=CHAR}, #{customerId,jdbcType=CHAR})
    59. </insert>
    60. <insert id="insertSelective" parameterType="com.bjpowernode.crm.workbench.domain.CustomerRemark" >
    61. <!--
    62. WARNING - @mbggenerated
    63. This element is automatically generated by MyBatis Generator, do not modify.
    64. This element was generated on Thu Mar 24 22:29:16 CST 2022.
    65. -->
    66. insert into tbl_customer_remark
    67. <trim prefix="(" suffix=")" suffixOverrides="," >
    68. <if test="id != null" >
    69. id,
    70. </if>
    71. <if test="noteContent != null" >
    72. note_content,
    73. </if>
    74. <if test="createBy != null" >
    75. create_by,
    76. </if>
    77. <if test="createTime != null" >
    78. create_time,
    79. </if>
    80. <if test="editBy != null" >
    81. edit_by,
    82. </if>
    83. <if test="editTime != null" >
    84. edit_time,
    85. </if>
    86. <if test="editFlag != null" >
    87. edit_flag,
    88. </if>
    89. <if test="customerId != null" >
    90. customer_id,
    91. </if>
    92. </trim>
    93. <trim prefix="values (" suffix=")" suffixOverrides="," >
    94. <if test="id != null" >
    95. #{id,jdbcType=CHAR},
    96. </if>
    97. <if test="noteContent != null" >
    98. #{noteContent,jdbcType=VARCHAR},
    99. </if>
    100. <if test="createBy != null" >
    101. #{createBy,jdbcType=VARCHAR},
    102. </if>
    103. <if test="createTime != null" >
    104. #{createTime,jdbcType=CHAR},
    105. </if>
    106. <if test="editBy != null" >
    107. #{editBy,jdbcType=VARCHAR},
    108. </if>
    109. <if test="editTime != null" >
    110. #{editTime,jdbcType=CHAR},
    111. </if>
    112. <if test="editFlag != null" >
    113. #{editFlag,jdbcType=CHAR},
    114. </if>
    115. <if test="customerId != null" >
    116. #{customerId,jdbcType=CHAR},
    117. </if>
    118. </trim>
    119. </insert>
    120. <update id="updateByPrimaryKeySelective" parameterType="com.bjpowernode.crm.workbench.domain.CustomerRemark" >
    121. <!--
    122. WARNING - @mbggenerated
    123. This element is automatically generated by MyBatis Generator, do not modify.
    124. This element was generated on Thu Mar 24 22:29:16 CST 2022.
    125. -->
    126. update tbl_customer_remark
    127. <set >
    128. <if test="noteContent != null" >
    129. note_content = #{noteContent,jdbcType=VARCHAR},
    130. </if>
    131. <if test="createBy != null" >
    132. create_by = #{createBy,jdbcType=VARCHAR},
    133. </if>
    134. <if test="createTime != null" >
    135. create_time = #{createTime,jdbcType=CHAR},
    136. </if>
    137. <if test="editBy != null" >
    138. edit_by = #{editBy,jdbcType=VARCHAR},
    139. </if>
    140. <if test="editTime != null" >
    141. edit_time = #{editTime,jdbcType=CHAR},
    142. </if>
    143. <if test="editFlag != null" >
    144. edit_flag = #{editFlag,jdbcType=CHAR},
    145. </if>
    146. <if test="customerId != null" >
    147. customer_id = #{customerId,jdbcType=CHAR},
    148. </if>
    149. </set>
    150. where id = #{id,jdbcType=CHAR}
    151. </update>
    152. <update id="updateByPrimaryKey" parameterType="com.bjpowernode.crm.workbench.domain.CustomerRemark" >
    153. <!--
    154. WARNING - @mbggenerated
    155. This element is automatically generated by MyBatis Generator, do not modify.
    156. This element was generated on Thu Mar 24 22:29:16 CST 2022.
    157. -->
    158. update tbl_customer_remark
    159. set note_content = #{noteContent,jdbcType=VARCHAR},
    160. create_by = #{createBy,jdbcType=VARCHAR},
    161. create_time = #{createTime,jdbcType=CHAR},
    162. edit_by = #{editBy,jdbcType=VARCHAR},
    163. edit_time = #{editTime,jdbcType=CHAR},
    164. edit_flag = #{editFlag,jdbcType=CHAR},
    165. customer_id = #{customerId,jdbcType=CHAR}
    166. where id = #{id,jdbcType=CHAR}
    167. </update>
    168. <!--通过客户备注集合插入客户备注-->
    169. <insert id="insertCustomerRemarkByList" parameterType="com.bjpowernode.crm.workbench.domain.CustomerRemark">
    170. insert into tbl_customer_remark(id, note_content, create_by, create_time, edit_by, edit_time, edit_flag, customer_id)
    171. values
    172. <foreach collection="list" item="obj" separator=",">
    173. (#{obj.id},#{obj.noteContent},#{obj.createBy},#{obj.createTime},#{obj.editBy},#{obj.editTime},#{obj.editFlag},#{obj.customerId})
    174. </foreach>
    175. </insert>
    176. <select id="selectCustomerRemarkForDetailByCustomerId" resultMap="BaseResultMap" parameterType="string">
    177. select cr.id,cr.note_content,cr.create_time,u1.name as create_by,cr.edit_time,u2.name as edit_by,cr.edit_flag
    178. from tbl_customer_remark cr
    179. join tbl_user u1 on cr.create_by=u1.id
    180. left join tbl_user u2 on cr.edit_by=u2.id
    181. where cr.customer_id=#{customerId}
    182. </select>
    183. <delete id="deleteCustomerRemarkByCustomerIds" parameterType="string">
    184. delete from tbl_customer_remark
    185. where customer_id in
    186. <foreach collection="array" item="id" separator="," open="(" close=")">
    187. #{id}
    188. </foreach>
    189. </delete>
    190. <insert id="insertCustomerRemark" parameterType="com.bjpowernode.crm.workbench.domain.CustomerRemark">
    191. insert into tbl_customer_remark(id, note_content, create_by, create_time, edit_by, edit_time, edit_flag, customer_id)
    192. values
    193. (#{id},#{noteContent},#{createBy},#{createTime},#{editBy},#{editTime},#{editFlag},#{customerId})
    194. </insert>
    195. <delete id="deleteCustomerRemarkById" parameterType="string">
    196. delete from tbl_customer_remark
    197. where id=#{id}
    198. </delete>
    199. <update id="updateCustomerRemark" parameterType="com.bjpowernode.crm.workbench.domain.CustomerRemark">
    200. update tbl_customer_remark
    201. set note_content=#{noteContent},edit_time=#{editTime},edit_by=#{editBy},edit_flag=#{editFlag}
    202. where id=#{id}
    203. </update>
    204. </mapper>

    TranHistoryMapper

    1. package com.bjpowernode.crm.workbench.mapper;
    2. import com.bjpowernode.crm.workbench.domain.TranHistory;
    3. import java.util.List;
    4. public interface TranHistoryMapper {
    5. /**
    6. * This method was generated by MyBatis Generator.
    7. * This method corresponds to the database table tbl_tran_history
    8. *
    9. * @mbggenerated Sat Apr 16 16:10:10 CST 2022
    10. */
    11. int deleteByPrimaryKey(String id);
    12. /**
    13. * This method was generated by MyBatis Generator.
    14. * This method corresponds to the database table tbl_tran_history
    15. *
    16. * @mbggenerated Sat Apr 16 16:10:10 CST 2022
    17. */
    18. int insert(TranHistory record);
    19. /**
    20. * This method was generated by MyBatis Generator.
    21. * This method corresponds to the database table tbl_tran_history
    22. *
    23. * @mbggenerated Sat Apr 16 16:10:10 CST 2022
    24. */
    25. int insertSelective(TranHistory record);
    26. /**
    27. * This method was generated by MyBatis Generator.
    28. * This method corresponds to the database table tbl_tran_history
    29. *
    30. * @mbggenerated Sat Apr 16 16:10:10 CST 2022
    31. */
    32. TranHistory selectByPrimaryKey(String id);
    33. /**
    34. * This method was generated by MyBatis Generator.
    35. * This method corresponds to the database table tbl_tran_history
    36. *
    37. * @mbggenerated Sat Apr 16 16:10:10 CST 2022
    38. */
    39. int updateByPrimaryKeySelective(TranHistory record);
    40. /**
    41. * This method was generated by MyBatis Generator.
    42. * This method corresponds to the database table tbl_tran_history
    43. *
    44. * @mbggenerated Sat Apr 16 16:10:10 CST 2022
    45. */
    46. int updateByPrimaryKey(TranHistory record);
    47. /**
    48. * 新增交易历史记录
    49. * @param tranHistory 交易历史记录
    50. * @return 新增条数
    51. */
    52. int insertTransactionHistory(TranHistory tranHistory);
    53. //根据交易的id查询交易历史的详细信息
    54. List<TranHistory> selectTranHistoryForDetailByTranId(String id);
    55. int deleteTranHistoryByTranIds(String[] tranId);
    56. }

    TranHistoryMapper.xml: 

    1. <?xml version="1.0" encoding="UTF-8" ?>
    2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
    3. <mapper namespace="com.bjpowernode.crm.workbench.mapper.TranHistoryMapper" >
    4. <resultMap id="BaseResultMap" type="com.bjpowernode.crm.workbench.domain.TranHistory" >
    5. <!--
    6. WARNING - @mbggenerated
    7. This element is automatically generated by MyBatis Generator, do not modify.
    8. This element was generated on Sat Apr 16 16:10:10 CST 2022.
    9. -->
    10. <id column="id" property="id" jdbcType="CHAR" />
    11. <result column="stage" property="stage" jdbcType="VARCHAR" />
    12. <result column="money" property="money" jdbcType="VARCHAR" />
    13. <result column="expected_date" property="expectedDate" jdbcType="CHAR" />
    14. <result column="create_time" property="createTime" jdbcType="CHAR" />
    15. <result column="create_by" property="createBy" jdbcType="VARCHAR" />
    16. <result column="tran_id" property="tranId" jdbcType="CHAR" />
    17. </resultMap>
    18. <sql id="Base_Column_List" >
    19. <!--
    20. WARNING - @mbggenerated
    21. This element is automatically generated by MyBatis Generator, do not modify.
    22. This element was generated on Sat Apr 16 16:10:10 CST 2022.
    23. -->
    24. id, stage, money, expected_date, create_time, create_by, tran_id
    25. </sql>
    26. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    27. <!--
    28. WARNING - @mbggenerated
    29. This element is automatically generated by MyBatis Generator, do not modify.
    30. This element was generated on Sat Apr 16 16:10:10 CST 2022.
    31. -->
    32. select
    33. <include refid="Base_Column_List" />
    34. from tbl_tran_history
    35. where id = #{id,jdbcType=CHAR}
    36. </select>
    37. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    38. <!--
    39. WARNING - @mbggenerated
    40. This element is automatically generated by MyBatis Generator, do not modify.
    41. This element was generated on Sat Apr 16 16:10:10 CST 2022.
    42. -->
    43. delete from tbl_tran_history
    44. where id = #{id,jdbcType=CHAR}
    45. </delete>
    46. <insert id="insert" parameterType="com.bjpowernode.crm.workbench.domain.TranHistory" >
    47. <!--
    48. WARNING - @mbggenerated
    49. This element is automatically generated by MyBatis Generator, do not modify.
    50. This element was generated on Sat Apr 16 16:10:10 CST 2022.
    51. -->
    52. insert into tbl_tran_history (id, stage, money,
    53. expected_date, create_time, create_by,
    54. tran_id)
    55. values (#{id,jdbcType=CHAR}, #{stage,jdbcType=VARCHAR}, #{money,jdbcType=VARCHAR},
    56. #{expectedDate,jdbcType=CHAR}, #{createTime,jdbcType=CHAR}, #{createBy,jdbcType=VARCHAR},
    57. #{tranId,jdbcType=CHAR})
    58. </insert>
    59. <insert id="insertSelective" parameterType="com.bjpowernode.crm.workbench.domain.TranHistory" >
    60. <!--
    61. WARNING - @mbggenerated
    62. This element is automatically generated by MyBatis Generator, do not modify.
    63. This element was generated on Sat Apr 16 16:10:10 CST 2022.
    64. -->
    65. insert into tbl_tran_history
    66. <trim prefix="(" suffix=")" suffixOverrides="," >
    67. <if test="id != null" >
    68. id,
    69. </if>
    70. <if test="stage != null" >
    71. stage,
    72. </if>
    73. <if test="money != null" >
    74. money,
    75. </if>
    76. <if test="expectedDate != null" >
    77. expected_date,
    78. </if>
    79. <if test="createTime != null" >
    80. create_time,
    81. </if>
    82. <if test="createBy != null" >
    83. create_by,
    84. </if>
    85. <if test="tranId != null" >
    86. tran_id,
    87. </if>
    88. </trim>
    89. <trim prefix="values (" suffix=")" suffixOverrides="," >
    90. <if test="id != null" >
    91. #{id,jdbcType=CHAR},
    92. </if>
    93. <if test="stage != null" >
    94. #{stage,jdbcType=VARCHAR},
    95. </if>
    96. <if test="money != null" >
    97. #{money,jdbcType=VARCHAR},
    98. </if>
    99. <if test="expectedDate != null" >
    100. #{expectedDate,jdbcType=CHAR},
    101. </if>
    102. <if test="createTime != null" >
    103. #{createTime,jdbcType=CHAR},
    104. </if>
    105. <if test="createBy != null" >
    106. #{createBy,jdbcType=VARCHAR},
    107. </if>
    108. <if test="tranId != null" >
    109. #{tranId,jdbcType=CHAR},
    110. </if>
    111. </trim>
    112. </insert>
    113. <update id="updateByPrimaryKeySelective" parameterType="com.bjpowernode.crm.workbench.domain.TranHistory" >
    114. <!--
    115. WARNING - @mbggenerated
    116. This element is automatically generated by MyBatis Generator, do not modify.
    117. This element was generated on Sat Apr 16 16:10:10 CST 2022.
    118. -->
    119. update tbl_tran_history
    120. <set >
    121. <if test="stage != null" >
    122. stage = #{stage,jdbcType=VARCHAR},
    123. </if>
    124. <if test="money != null" >
    125. money = #{money,jdbcType=VARCHAR},
    126. </if>
    127. <if test="expectedDate != null" >
    128. expected_date = #{expectedDate,jdbcType=CHAR},
    129. </if>
    130. <if test="createTime != null" >
    131. create_time = #{createTime,jdbcType=CHAR},
    132. </if>
    133. <if test="createBy != null" >
    134. create_by = #{createBy,jdbcType=VARCHAR},
    135. </if>
    136. <if test="tranId != null" >
    137. tran_id = #{tranId,jdbcType=CHAR},
    138. </if>
    139. </set>
    140. where id = #{id,jdbcType=CHAR}
    141. </update>
    142. <update id="updateByPrimaryKey" parameterType="com.bjpowernode.crm.workbench.domain.TranHistory" >
    143. <!--
    144. WARNING - @mbggenerated
    145. This element is automatically generated by MyBatis Generator, do not modify.
    146. This element was generated on Sat Apr 16 16:10:10 CST 2022.
    147. -->
    148. update tbl_tran_history
    149. set stage = #{stage,jdbcType=VARCHAR},
    150. money = #{money,jdbcType=VARCHAR},
    151. expected_date = #{expectedDate,jdbcType=CHAR},
    152. create_time = #{createTime,jdbcType=CHAR},
    153. create_by = #{createBy,jdbcType=VARCHAR},
    154. tran_id = #{tranId,jdbcType=CHAR}
    155. where id = #{id,jdbcType=CHAR}
    156. </update>
    157. <!--新增交易历史记录-->
    158. <insert id="insertTransactionHistory" parameterType="com.bjpowernode.crm.workbench.domain.TranHistory">
    159. insert into tbl_tran_history (id, stage, money, expected_date, create_time, create_by, tran_id)
    160. values (#{id,jdbcType=CHAR}, #{stage,jdbcType=VARCHAR}, #{money,jdbcType=VARCHAR},
    161. #{expectedDate,jdbcType=CHAR}, #{createTime,jdbcType=CHAR}, #{createBy,jdbcType=VARCHAR},
    162. #{tranId,jdbcType=CHAR})
    163. </insert>
    164. <!--//根据交易的id查询交易历史的详细信息-->
    165. <select id="selectTranHistoryForDetailByTranId" parameterType="string" resultMap="BaseResultMap">
    166. select dv.value as stage,th.money,th.expected_date,th.create_time,u.name as create_by
    167. from tbl_tran_history th
    168. join tbl_dic_value dv on th.stage=dv.id
    169. join tbl_user u on th.create_by=u.id
    170. where th.tran_id=#{id}
    171. order by th.create_time asc
    172. </select>
    173. <delete id="deleteTranHistoryByTranIds" parameterType="string">
    174. delete from tbl_tran_history
    175. where tran_id in
    176. <foreach collection="array" separator="," item="id" open="(" close=")">
    177. #{id}
    178. </foreach>
    179. </delete>
    180. </mapper>

    TranMapper 

    1. package com.bjpowernode.crm.workbench.mapper;
    2. import com.bjpowernode.crm.workbench.domain.FunnelVO;
    3. import com.bjpowernode.crm.workbench.domain.Tran;
    4. import java.util.List;
    5. import java.util.Map;
    6. public interface TranMapper {
    7. /**
    8. * This method was generated by MyBatis Generator.
    9. * This method corresponds to the database table tbl_tran
    10. *
    11. * @mbggenerated Sun Mar 27 10:41:50 CST 2022
    12. */
    13. int deleteByPrimaryKey(String id);
    14. /**
    15. * This method was generated by MyBatis Generator.
    16. * This method corresponds to the database table tbl_tran
    17. *
    18. * @mbggenerated Sun Mar 27 10:41:50 CST 2022
    19. */
    20. int insert(Tran record);
    21. /**
    22. * This method was generated by MyBatis Generator.
    23. * This method corresponds to the database table tbl_tran
    24. *
    25. * @mbggenerated Sun Mar 27 10:41:50 CST 2022
    26. */
    27. int insertSelective(Tran record);
    28. /**
    29. * This method was generated by MyBatis Generator.
    30. * This method corresponds to the database table tbl_tran
    31. *
    32. * @mbggenerated Sun Mar 27 10:41:50 CST 2022
    33. */
    34. Tran selectByPrimaryKey(String id);
    35. /**
    36. * This method was generated by MyBatis Generator.
    37. * This method corresponds to the database table tbl_tran
    38. *
    39. * @mbggenerated Sun Mar 27 10:41:50 CST 2022
    40. */
    41. int updateByPrimaryKeySelective(Tran record);
    42. /**
    43. * This method was generated by MyBatis Generator.
    44. * This method corresponds to the database table tbl_tran
    45. *
    46. * @mbggenerated Sun Mar 27 10:41:50 CST 2022
    47. */
    48. int updateByPrimaryKey(Tran record);
    49. /**
    50. * 新增一条交易记录
    51. * @param tran 交易信息
    52. * @return 新增条数
    53. */
    54. int insertTran(Tran tran);
    55. List<Tran> selectTransactionByConditionForPage(Map<String, Object> map);
    56. int selectCountOfTransactionByCondition(Map<String, Object> map);
    57. Tran selectTransactionById(String id);
    58. int updateTran(Tran tran);
    59. int deleteTranByIds(String[] ids);
    60. //查看交易的详细信息
    61. Tran selectTranForDetailById(String id);
    62. /**
    63. * 查询交易表中各个阶段的数据量
    64. * @return 数据集合
    65. */
    66. List<FunnelVO> selectCountOfTranGroupByStage();
    67. }

    TranMapper.xml:

    1. <?xml version="1.0" encoding="UTF-8" ?>
    2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
    3. <mapper namespace="com.bjpowernode.crm.workbench.mapper.TranMapper" >
    4. <resultMap id="BaseResultMap" type="com.bjpowernode.crm.workbench.domain.Tran" >
    5. <!--
    6. WARNING - @mbggenerated
    7. This element is automatically generated by MyBatis Generator, do not modify.
    8. This element was generated on Sun Mar 27 10:41:50 CST 2022.
    9. -->
    10. <id column="id" property="id" jdbcType="CHAR" />
    11. <result column="owner" property="owner" jdbcType="CHAR" />
    12. <result column="money" property="money" jdbcType="VARCHAR" />
    13. <result column="name" property="name" jdbcType="VARCHAR" />
    14. <result column="expected_date" property="expectedDate" jdbcType="CHAR" />
    15. <result column="customer_id" property="customerId" jdbcType="CHAR" />
    16. <result column="stage" property="stage" jdbcType="VARCHAR" />
    17. <result column="type" property="type" jdbcType="VARCHAR" />
    18. <result column="source" property="source" jdbcType="VARCHAR" />
    19. <result column="activity_id" property="activityId" jdbcType="CHAR" />
    20. <result column="contacts_id" property="contactsId" jdbcType="CHAR" />
    21. <result column="create_by" property="createBy" jdbcType="VARCHAR" />
    22. <result column="create_time" property="createTime" jdbcType="CHAR" />
    23. <result column="edit_by" property="editBy" jdbcType="VARCHAR" />
    24. <result column="edit_time" property="editTime" jdbcType="CHAR" />
    25. <result column="description" property="description" jdbcType="VARCHAR" />
    26. <result column="contact_summary" property="contactSummary" jdbcType="VARCHAR" />
    27. <result column="next_contact_time" property="nextContactTime" jdbcType="CHAR" />
    28. </resultMap>
    29. <sql id="Base_Column_List" >
    30. <!--
    31. WARNING - @mbggenerated
    32. This element is automatically generated by MyBatis Generator, do not modify.
    33. This element was generated on Sun Mar 27 10:41:50 CST 2022.
    34. -->
    35. id, owner, money, name, expected_date, customer_id, stage, type, source, activity_id,
    36. contacts_id, create_by, create_time, edit_by, edit_time, description, contact_summary,
    37. next_contact_time
    38. </sql>
    39. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    40. <!--
    41. WARNING - @mbggenerated
    42. This element is automatically generated by MyBatis Generator, do not modify.
    43. This element was generated on Sun Mar 27 10:41:50 CST 2022.
    44. -->
    45. select
    46. <include refid="Base_Column_List" />
    47. from tbl_tran
    48. where id = #{id,jdbcType=CHAR}
    49. </select>
    50. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    51. <!--
    52. WARNING - @mbggenerated
    53. This element is automatically generated by MyBatis Generator, do not modify.
    54. This element was generated on Sun Mar 27 10:41:50 CST 2022.
    55. -->
    56. delete from tbl_tran
    57. where id = #{id,jdbcType=CHAR}
    58. </delete>
    59. <insert id="insert" parameterType="com.bjpowernode.crm.workbench.domain.Tran" >
    60. <!--
    61. WARNING - @mbggenerated
    62. This element is automatically generated by MyBatis Generator, do not modify.
    63. This element was generated on Sun Mar 27 10:41:50 CST 2022.
    64. -->
    65. insert into tbl_tran (id, owner, money, name,
    66. expected_date, customer_id, stage,
    67. type, source, activity_id,
    68. contacts_id, create_by, create_time,
    69. edit_by, edit_time, description,
    70. contact_summary, next_contact_time)
    71. values (#{id,jdbcType=CHAR}, #{owner,jdbcType=CHAR}, #{money,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
    72. #{expectedDate,jdbcType=CHAR}, #{customerId,jdbcType=CHAR}, #{stage,jdbcType=VARCHAR},
    73. #{type,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR}, #{activityId,jdbcType=CHAR},
    74. #{contactsId,jdbcType=CHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=CHAR},
    75. #{editBy,jdbcType=VARCHAR}, #{editTime,jdbcType=CHAR}, #{description,jdbcType=VARCHAR},
    76. #{contactSummary,jdbcType=VARCHAR}, #{nextContactTime,jdbcType=CHAR})
    77. </insert>
    78. <insert id="insertSelective" parameterType="com.bjpowernode.crm.workbench.domain.Tran" >
    79. <!--
    80. WARNING - @mbggenerated
    81. This element is automatically generated by MyBatis Generator, do not modify.
    82. This element was generated on Sun Mar 27 10:41:50 CST 2022.
    83. -->
    84. insert into tbl_tran
    85. <trim prefix="(" suffix=")" suffixOverrides="," >
    86. <if test="id != null" >
    87. id,
    88. </if>
    89. <if test="owner != null" >
    90. owner,
    91. </if>
    92. <if test="money != null" >
    93. money,
    94. </if>
    95. <if test="name != null" >
    96. name,
    97. </if>
    98. <if test="expectedDate != null" >
    99. expected_date,
    100. </if>
    101. <if test="customerId != null" >
    102. customer_id,
    103. </if>
    104. <if test="stage != null" >
    105. stage,
    106. </if>
    107. <if test="type != null" >
    108. type,
    109. </if>
    110. <if test="source != null" >
    111. source,
    112. </if>
    113. <if test="activityId != null" >
    114. activity_id,
    115. </if>
    116. <if test="contactsId != null" >
    117. contacts_id,
    118. </if>
    119. <if test="createBy != null" >
    120. create_by,
    121. </if>
    122. <if test="createTime != null" >
    123. create_time,
    124. </if>
    125. <if test="editBy != null" >
    126. edit_by,
    127. </if>
    128. <if test="editTime != null" >
    129. edit_time,
    130. </if>
    131. <if test="description != null" >
    132. description,
    133. </if>
    134. <if test="contactSummary != null" >
    135. contact_summary,
    136. </if>
    137. <if test="nextContactTime != null" >
    138. next_contact_time,
    139. </if>
    140. </trim>
    141. <trim prefix="values (" suffix=")" suffixOverrides="," >
    142. <if test="id != null" >
    143. #{id,jdbcType=CHAR},
    144. </if>
    145. <if test="owner != null" >
    146. #{owner,jdbcType=CHAR},
    147. </if>
    148. <if test="money != null" >
    149. #{money,jdbcType=VARCHAR},
    150. </if>
    151. <if test="name != null" >
    152. #{name,jdbcType=VARCHAR},
    153. </if>
    154. <if test="expectedDate != null" >
    155. #{expectedDate,jdbcType=CHAR},
    156. </if>
    157. <if test="customerId != null" >
    158. #{customerId,jdbcType=CHAR},
    159. </if>
    160. <if test="stage != null" >
    161. #{stage,jdbcType=VARCHAR},
    162. </if>
    163. <if test="type != null" >
    164. #{type,jdbcType=VARCHAR},
    165. </if>
    166. <if test="source != null" >
    167. #{source,jdbcType=VARCHAR},
    168. </if>
    169. <if test="activityId != null" >
    170. #{activityId,jdbcType=CHAR},
    171. </if>
    172. <if test="contactsId != null" >
    173. #{contactsId,jdbcType=CHAR},
    174. </if>
    175. <if test="createBy != null" >
    176. #{createBy,jdbcType=VARCHAR},
    177. </if>
    178. <if test="createTime != null" >
    179. #{createTime,jdbcType=CHAR},
    180. </if>
    181. <if test="editBy != null" >
    182. #{editBy,jdbcType=VARCHAR},
    183. </if>
    184. <if test="editTime != null" >
    185. #{editTime,jdbcType=CHAR},
    186. </if>
    187. <if test="description != null" >
    188. #{description,jdbcType=VARCHAR},
    189. </if>
    190. <if test="contactSummary != null" >
    191. #{contactSummary,jdbcType=VARCHAR},
    192. </if>
    193. <if test="nextContactTime != null" >
    194. #{nextContactTime,jdbcType=CHAR},
    195. </if>
    196. </trim>
    197. </insert>
    198. <update id="updateByPrimaryKeySelective" parameterType="com.bjpowernode.crm.workbench.domain.Tran" >
    199. <!--
    200. WARNING - @mbggenerated
    201. This element is automatically generated by MyBatis Generator, do not modify.
    202. This element was generated on Sun Mar 27 10:41:50 CST 2022.
    203. -->
    204. update tbl_tran
    205. <set >
    206. <if test="owner != null" >
    207. owner = #{owner,jdbcType=CHAR},
    208. </if>
    209. <if test="money != null" >
    210. money = #{money,jdbcType=VARCHAR},
    211. </if>
    212. <if test="name != null" >
    213. name = #{name,jdbcType=VARCHAR},
    214. </if>
    215. <if test="expectedDate != null" >
    216. expected_date = #{expectedDate,jdbcType=CHAR},
    217. </if>
    218. <if test="customerId != null" >
    219. customer_id = #{customerId,jdbcType=CHAR},
    220. </if>
    221. <if test="stage != null" >
    222. stage = #{stage,jdbcType=VARCHAR},
    223. </if>
    224. <if test="type != null" >
    225. type = #{type,jdbcType=VARCHAR},
    226. </if>
    227. <if test="source != null" >
    228. source = #{source,jdbcType=VARCHAR},
    229. </if>
    230. <if test="activityId != null" >
    231. activity_id = #{activityId,jdbcType=CHAR},
    232. </if>
    233. <if test="contactsId != null" >
    234. contacts_id = #{contactsId,jdbcType=CHAR},
    235. </if>
    236. <if test="createBy != null" >
    237. create_by = #{createBy,jdbcType=VARCHAR},
    238. </if>
    239. <if test="createTime != null" >
    240. create_time = #{createTime,jdbcType=CHAR},
    241. </if>
    242. <if test="editBy != null" >
    243. edit_by = #{editBy,jdbcType=VARCHAR},
    244. </if>
    245. <if test="editTime != null" >
    246. edit_time = #{editTime,jdbcType=CHAR},
    247. </if>
    248. <if test="description != null" >
    249. description = #{description,jdbcType=VARCHAR},
    250. </if>
    251. <if test="contactSummary != null" >
    252. contact_summary = #{contactSummary,jdbcType=VARCHAR},
    253. </if>
    254. <if test="nextContactTime != null" >
    255. next_contact_time = #{nextContactTime,jdbcType=CHAR},
    256. </if>
    257. </set>
    258. where id = #{id,jdbcType=CHAR}
    259. </update>
    260. <update id="updateByPrimaryKey" parameterType="com.bjpowernode.crm.workbench.domain.Tran" >
    261. <!--
    262. WARNING - @mbggenerated
    263. This element is automatically generated by MyBatis Generator, do not modify.
    264. This element was generated on Sun Mar 27 10:41:50 CST 2022.
    265. -->
    266. update tbl_tran
    267. set owner = #{owner,jdbcType=CHAR},
    268. money = #{money,jdbcType=VARCHAR},
    269. name = #{name,jdbcType=VARCHAR},
    270. expected_date = #{expectedDate,jdbcType=CHAR},
    271. customer_id = #{customerId,jdbcType=CHAR},
    272. stage = #{stage,jdbcType=VARCHAR},
    273. type = #{type,jdbcType=VARCHAR},
    274. source = #{source,jdbcType=VARCHAR},
    275. activity_id = #{activityId,jdbcType=CHAR},
    276. contacts_id = #{contactsId,jdbcType=CHAR},
    277. create_by = #{createBy,jdbcType=VARCHAR},
    278. create_time = #{createTime,jdbcType=CHAR},
    279. edit_by = #{editBy,jdbcType=VARCHAR},
    280. edit_time = #{editTime,jdbcType=CHAR},
    281. description = #{description,jdbcType=VARCHAR},
    282. contact_summary = #{contactSummary,jdbcType=VARCHAR},
    283. next_contact_time = #{nextContactTime,jdbcType=CHAR}
    284. where id = #{id,jdbcType=CHAR}
    285. </update>
    286. <!--新增一条交易记录-->
    287. <insert id="insertTran" parameterType="com.bjpowernode.crm.workbench.domain.Tran">
    288. insert into tbl_tran(id, owner, money, name, expected_date, customer_id, stage, type, source, activity_id,
    289. contacts_id, create_by, create_time, description, contact_summary,next_contact_time)
    290. values (#{id}, #{owner}, #{money}, #{name}, #{expectedDate}, #{customerId}, #{stage}, #{type}, #{source}, #{activityId},
    291. #{contactsId}, #{createBy}, #{createTime}, #{description}, #{contactSummary}, #{nextContactTime})
    292. </insert>
    293. <select id="selectTransactionByConditionForPage" parameterType="map" resultMap="BaseResultMap">
    294. select tr.id, u1.name as owner, tr.money, tr.name, tr.expected_date, cu.name as customer_id,
    295. dicv1.value as stage, ifnull(dicv2.value, '') as type, ifnull(dicv3.value, '') as source, ac.name as activity_id,
    296. ifnull(co.fullname, ' ') as contacts_id, u2.name as create_by, tr.create_time, u3.name as edit_by, tr.edit_time,
    297. tr.description, tr.contact_summary, tr.next_contact_time
    298. from tbl_tran tr
    299. join tbl_user u1 on tr.owner = u1.id
    300. join tbl_user u2 on tr.create_by = u2.id
    301. left join tbl_user u3 on tr.edit_by = u3.id
    302. left join tbl_activity ac on tr.activity_id = ac.id
    303. left join tbl_contacts co on tr.contacts_id = co.id
    304. join tbl_customer cu on tr.customer_id = cu.id
    305. join tbl_dic_value dicv1 on tr.stage = dicv1.id
    306. left join tbl_dic_value dicv2 on tr.type = dicv2.id
    307. left join tbl_dic_value dicv3 on tr.source = dicv3.id
    308. <where>
    309. <if test="owner!=null and owner!=''">
    310. and u1.name like '%' #{owner} '%'
    311. </if>
    312. <if test="name!=null and name!=''">
    313. and tr.name like '%' #{name} '%'
    314. </if>
    315. <if test="customerId!=null and customerId!=''">
    316. and cu.name like '%' #{customerId} '%'
    317. </if>
    318. <if test="stage!=null and stage!=''">
    319. and dicv1.value like '%' #{stage} '%'
    320. </if>
    321. <if test="type!=null and type!=''">
    322. and dicv2.value like '%' #{type} '%'
    323. </if>
    324. <if test="source!=null and source!=''">
    325. and dicv3.value like '%' #{source} '%'
    326. </if>
    327. <if test="contactsId!=null and contactsId!=''">
    328. and co.fullname like '%' #{contactsId} '%'
    329. </if>
    330. </where>
    331. order by tr.create_time desc
    332. limit #{beginNo},#{pageSize};
    333. </select>
    334. <select id="selectCountOfTransactionByCondition" parameterType="map" resultType="int">
    335. select count(*)
    336. from tbl_tran tr
    337. join tbl_user u1 on tr.owner = u1.id
    338. join tbl_user u2 on tr.create_by = u2.id
    339. left join tbl_user u3 on tr.edit_by = u3.id
    340. left join tbl_activity ac on tr.activity_id = ac.id
    341. left join tbl_contacts co on tr.contacts_id = co.id
    342. left join tbl_customer cu on tr.customer_id = cu.id
    343. left join tbl_dic_value dicv1 on tr.stage = dicv1.id
    344. left join tbl_dic_value dicv2 on tr.type = dicv2.id
    345. left join tbl_dic_value dicv3 on tr.source = dicv3.id
    346. <where>
    347. <if test="owner!=null and owner!=''">
    348. and u1.name like '%' #{owner} '%'
    349. </if>
    350. <if test="name!=null and name!=''">
    351. and tr.name like '%' #{name} '%'
    352. </if>
    353. <if test="customerId!=null and customerId!=''">
    354. and cu.name like '%' #{customerId} '%'
    355. </if>
    356. <if test="stage!=null and stage!=''">
    357. and dicv1.value like '%' #{stage} '%'
    358. </if>
    359. <if test="type!=null and type!=''">
    360. and dicv2.value like '%' #{type} '%'
    361. </if>
    362. <if test="source!=null and source!=''">
    363. and dicv3.value like '%' #{source} '%'
    364. </if>
    365. <if test="contactsId!=null and contactsId!=''">
    366. and co.fullname like '%' #{contactsId} '%'
    367. </if>
    368. </where>
    369. </select>
    370. <select id="selectTransactionById" resultMap="BaseResultMap" parameterType="string">
    371. select
    372. tr.id, tr.owner, tr.money, tr.name, tr.expected_date, cu.name as customer_id,
    373. tr.stage, tr.type, tr.source, ac.name as activity_id, co.fullname as contacts_id,
    374. tr.create_by, tr.create_time, tr.edit_by, tr.edit_time,tr.description, tr.contact_summary, tr.next_contact_time
    375. from tbl_tran tr
    376. left join tbl_activity ac on tr.activity_id = ac.id
    377. left join tbl_contacts co on tr.contacts_id = co.id
    378. join tbl_customer cu on tr.customer_id = cu.id
    379. where tr.id = #{id}
    380. </select>
    381. <update id="updateTran" parameterType="com.bjpowernode.crm.workbench.domain.Tran">
    382. update tbl_tran
    383. set owner=#{owner}, money=#{money}, name=#{name}, expected_date=#{expectedDate}, customer_id=#{customerId}, stage=#{stage},
    384. type=#{type}, source=#{source},
    385. <if test="activityId!=null and activityId!=''">
    386. activity_id=#{activityId},
    387. </if>
    388. <if test="contactsId!=null and contactsId!=''">
    389. contacts_id=#{contactsId},
    390. </if>
    391. edit_by=#{editBy}, edit_time=#{editTime},
    392. description=#{description}, contact_summary=#{contactSummary},next_contact_time=#{nextContactTime}
    393. where id = #{id}
    394. </update>
    395. <delete id="deleteTranByIds" parameterType="string">
    396. delete from tbl_tran
    397. where id in
    398. <foreach collection="array" item="id" separator="," open="(" close=")">
    399. #{id, jdbcType=VARCHAR}
    400. </foreach>
    401. </delete>
    402. <!--查看交易的详细信息-->
    403. <select id="selectTranForDetailById" parameterType="string" resultMap="BaseResultMap">
    404. select t.id,u1.name as owner,t.money,t.name,t.expected_date,c.name as customer_id,dv1.value as stage,dv1.order_no,dv2.value as type,
    405. dv3.value as source,a.name as activity_id,co.fullname as contacts_id,u2.name as create_by,t.create_time,
    406. u3.name as edit_by,t.edit_time,t.description,t.contact_summary,t.next_contact_time
    407. from tbl_tran t
    408. join tbl_user u1 on t.owner=u1.id
    409. join tbl_customer c on t.customer_id=c.id
    410. join tbl_dic_value dv1 on t.stage=dv1.id
    411. left join tbl_dic_value dv2 on t.type=dv2.id
    412. left join tbl_dic_value dv3 on t.source=dv3.id
    413. left join tbl_activity a on t.activity_id=a.id
    414. left join tbl_contacts co on t.contacts_id=co.id
    415. join tbl_user u2 on t.create_by=u2.id
    416. left join tbl_user u3 on t.edit_by=u3.id
    417. where t.id=#{id}
    418. </select>
    419. <!--查询交易表中各个阶段的数据量-->
    420. <select id="selectCountOfTranGroupByStage" resultType="com.bjpowernode.crm.workbench.domain.FunnelVO">
    421. select count(*) as value,dv.value as name
    422. from tbl_tran t
    423. join tbl_dic_value dv on t.stage=dv.id
    424. group by t.stage
    425. </select>
    426. </mapper>

    TranRemarkMapper

    1. package com.bjpowernode.crm.workbench.mapper;
    2. import com.bjpowernode.crm.workbench.domain.TranRemark;
    3. import java.util.List;
    4. public interface TranRemarkMapper {
    5. /**
    6. * This method was generated by MyBatis Generator.
    7. * This method corresponds to the database table tbl_tran_remark
    8. *
    9. * @mbggenerated Sun Mar 27 10:57:44 CST 2022
    10. */
    11. int deleteByPrimaryKey(String id);
    12. /**
    13. * This method was generated by MyBatis Generator.
    14. * This method corresponds to the database table tbl_tran_remark
    15. *
    16. * @mbggenerated Sun Mar 27 10:57:44 CST 2022
    17. */
    18. int insert(TranRemark record);
    19. /**
    20. * This method was generated by MyBatis Generator.
    21. * This method corresponds to the database table tbl_tran_remark
    22. *
    23. * @mbggenerated Sun Mar 27 10:57:44 CST 2022
    24. */
    25. int insertSelective(TranRemark record);
    26. /**
    27. * This method was generated by MyBatis Generator.
    28. * This method corresponds to the database table tbl_tran_remark
    29. *
    30. * @mbggenerated Sun Mar 27 10:57:44 CST 2022
    31. */
    32. TranRemark selectByPrimaryKey(String id);
    33. /**
    34. * This method was generated by MyBatis Generator.
    35. * This method corresponds to the database table tbl_tran_remark
    36. *
    37. * @mbggenerated Sun Mar 27 10:57:44 CST 2022
    38. */
    39. int updateByPrimaryKeySelective(TranRemark record);
    40. /**
    41. * This method was generated by MyBatis Generator.
    42. * This method corresponds to the database table tbl_tran_remark
    43. *
    44. * @mbggenerated Sun Mar 27 10:57:44 CST 2022
    45. */
    46. int updateByPrimaryKey(TranRemark record);
    47. /**
    48. * 通过交易备注集合插入交易备注
    49. * @param tranRemarkList 交易备注集合
    50. * @return 插入条数
    51. */
    52. int insertTranRemarkByList(List<TranRemark> tranRemarkList);
    53. //查看交易备注详细信息
    54. List<TranRemark> selectTranRemarkForDetailByTranId(String id);
    55. int insertTranRemark(TranRemark tranRemark);
    56. int deleteTranRemarkById(String id);
    57. int updateTranRemark(TranRemark tranRemark);
    58. int deleteTranRemarkByTranIds(String[] tranId);
    59. }

    TranRemarkMapper.xml: 

    1. <?xml version="1.0" encoding="UTF-8" ?>
    2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
    3. <mapper namespace="com.bjpowernode.crm.workbench.mapper.TranRemarkMapper" >
    4. <resultMap id="BaseResultMap" type="com.bjpowernode.crm.workbench.domain.TranRemark" >
    5. <!--
    6. WARNING - @mbggenerated
    7. This element is automatically generated by MyBatis Generator, do not modify.
    8. This element was generated on Sun Mar 27 10:57:44 CST 2022.
    9. -->
    10. <id column="id" property="id" jdbcType="CHAR" />
    11. <result column="note_content" property="noteContent" jdbcType="VARCHAR" />
    12. <result column="create_by" property="createBy" jdbcType="VARCHAR" />
    13. <result column="create_time" property="createTime" jdbcType="CHAR" />
    14. <result column="edit_by" property="editBy" jdbcType="VARCHAR" />
    15. <result column="edit_time" property="editTime" jdbcType="CHAR" />
    16. <result column="edit_flag" property="editFlag" jdbcType="CHAR" />
    17. <result column="tran_id" property="tranId" jdbcType="CHAR" />
    18. </resultMap>
    19. <sql id="Base_Column_List" >
    20. <!--
    21. WARNING - @mbggenerated
    22. This element is automatically generated by MyBatis Generator, do not modify.
    23. This element was generated on Sun Mar 27 10:57:44 CST 2022.
    24. -->
    25. id, note_content, create_by, create_time, edit_by, edit_time, edit_flag, tran_id
    26. </sql>
    27. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    28. <!--
    29. WARNING - @mbggenerated
    30. This element is automatically generated by MyBatis Generator, do not modify.
    31. This element was generated on Sun Mar 27 10:57:44 CST 2022.
    32. -->
    33. select
    34. <include refid="Base_Column_List" />
    35. from tbl_tran_remark
    36. where id = #{id,jdbcType=CHAR}
    37. </select>
    38. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    39. <!--
    40. WARNING - @mbggenerated
    41. This element is automatically generated by MyBatis Generator, do not modify.
    42. This element was generated on Sun Mar 27 10:57:44 CST 2022.
    43. -->
    44. delete from tbl_tran_remark
    45. where id = #{id,jdbcType=CHAR}
    46. </delete>
    47. <insert id="insert" parameterType="com.bjpowernode.crm.workbench.domain.TranRemark" >
    48. <!--
    49. WARNING - @mbggenerated
    50. This element is automatically generated by MyBatis Generator, do not modify.
    51. This element was generated on Sun Mar 27 10:57:44 CST 2022.
    52. -->
    53. insert into tbl_tran_remark (id, note_content, create_by,
    54. create_time, edit_by, edit_time,
    55. edit_flag, tran_id)
    56. values (#{id,jdbcType=CHAR}, #{noteContent,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
    57. #{createTime,jdbcType=CHAR}, #{editBy,jdbcType=VARCHAR}, #{editTime,jdbcType=CHAR},
    58. #{editFlag,jdbcType=CHAR}, #{tranId,jdbcType=CHAR})
    59. </insert>
    60. <insert id="insertSelective" parameterType="com.bjpowernode.crm.workbench.domain.TranRemark" >
    61. <!--
    62. WARNING - @mbggenerated
    63. This element is automatically generated by MyBatis Generator, do not modify.
    64. This element was generated on Sun Mar 27 10:57:44 CST 2022.
    65. -->
    66. insert into tbl_tran_remark
    67. <trim prefix="(" suffix=")" suffixOverrides="," >
    68. <if test="id != null" >
    69. id,
    70. </if>
    71. <if test="noteContent != null" >
    72. note_content,
    73. </if>
    74. <if test="createBy != null" >
    75. create_by,
    76. </if>
    77. <if test="createTime != null" >
    78. create_time,
    79. </if>
    80. <if test="editBy != null" >
    81. edit_by,
    82. </if>
    83. <if test="editTime != null" >
    84. edit_time,
    85. </if>
    86. <if test="editFlag != null" >
    87. edit_flag,
    88. </if>
    89. <if test="tranId != null" >
    90. tran_id,
    91. </if>
    92. </trim>
    93. <trim prefix="values (" suffix=")" suffixOverrides="," >
    94. <if test="id != null" >
    95. #{id,jdbcType=CHAR},
    96. </if>
    97. <if test="noteContent != null" >
    98. #{noteContent,jdbcType=VARCHAR},
    99. </if>
    100. <if test="createBy != null" >
    101. #{createBy,jdbcType=VARCHAR},
    102. </if>
    103. <if test="createTime != null" >
    104. #{createTime,jdbcType=CHAR},
    105. </if>
    106. <if test="editBy != null" >
    107. #{editBy,jdbcType=VARCHAR},
    108. </if>
    109. <if test="editTime != null" >
    110. #{editTime,jdbcType=CHAR},
    111. </if>
    112. <if test="editFlag != null" >
    113. #{editFlag,jdbcType=CHAR},
    114. </if>
    115. <if test="tranId != null" >
    116. #{tranId,jdbcType=CHAR},
    117. </if>
    118. </trim>
    119. </insert>
    120. <update id="updateByPrimaryKeySelective" parameterType="com.bjpowernode.crm.workbench.domain.TranRemark" >
    121. <!--
    122. WARNING - @mbggenerated
    123. This element is automatically generated by MyBatis Generator, do not modify.
    124. This element was generated on Sun Mar 27 10:57:44 CST 2022.
    125. -->
    126. update tbl_tran_remark
    127. <set >
    128. <if test="noteContent != null" >
    129. note_content = #{noteContent,jdbcType=VARCHAR},
    130. </if>
    131. <if test="createBy != null" >
    132. create_by = #{createBy,jdbcType=VARCHAR},
    133. </if>
    134. <if test="createTime != null" >
    135. create_time = #{createTime,jdbcType=CHAR},
    136. </if>
    137. <if test="editBy != null" >
    138. edit_by = #{editBy,jdbcType=VARCHAR},
    139. </if>
    140. <if test="editTime != null" >
    141. edit_time = #{editTime,jdbcType=CHAR},
    142. </if>
    143. <if test="editFlag != null" >
    144. edit_flag = #{editFlag,jdbcType=CHAR},
    145. </if>
    146. <if test="tranId != null" >
    147. tran_id = #{tranId,jdbcType=CHAR},
    148. </if>
    149. </set>
    150. where id = #{id,jdbcType=CHAR}
    151. </update>
    152. <update id="updateByPrimaryKey" parameterType="com.bjpowernode.crm.workbench.domain.TranRemark" >
    153. <!--
    154. WARNING - @mbggenerated
    155. This element is automatically generated by MyBatis Generator, do not modify.
    156. This element was generated on Sun Mar 27 10:57:44 CST 2022.
    157. -->
    158. update tbl_tran_remark
    159. set note_content = #{noteContent,jdbcType=VARCHAR},
    160. create_by = #{createBy,jdbcType=VARCHAR},
    161. create_time = #{createTime,jdbcType=CHAR},
    162. edit_by = #{editBy,jdbcType=VARCHAR},
    163. edit_time = #{editTime,jdbcType=CHAR},
    164. edit_flag = #{editFlag,jdbcType=CHAR},
    165. tran_id = #{tranId,jdbcType=CHAR}
    166. where id = #{id,jdbcType=CHAR}
    167. </update>
    168. <!--通过交易备注集合插入交易备注-->
    169. <insert id="insertTranRemarkByList" parameterType="com.bjpowernode.crm.workbench.domain.TranRemark">
    170. insert into tbl_tran_remark(id, note_content, create_by, create_time, edit_by, edit_time, edit_flag, tran_id)
    171. values
    172. <foreach collection="list" item="obj" separator=",">
    173. (#{obj.id}, #{obj.noteContent}, #{obj.createBy}, #{obj.createTime}, #{obj.editBy}, #{obj.editTime}, #{obj.editFlag}, #{obj.tranId})
    174. </foreach>
    175. </insert>
    176. <!--查看交易备注详细信息-->
    177. <select id="selectTranRemarkForDetailByTranId" parameterType="string" resultMap="BaseResultMap">
    178. select tr.id,tr.note_content,u1.name as create_by,tr.create_time,u2.name as edit_by,tr.edit_time,tr.edit_flag
    179. from tbl_tran_remark tr
    180. join tbl_user u1 on tr.create_by=u1.id
    181. left join tbl_user u2 on tr.edit_by=u2.id
    182. where tr.tran_id=#{id}
    183. </select>
    184. <insert id="insertTranRemark" parameterType="com.bjpowernode.crm.workbench.domain.TranRemark">
    185. insert into tbl_tran_remark(id, note_content, create_by, create_time, edit_by, edit_time, edit_flag, tran_id)
    186. values
    187. (#{id},#{noteContent},#{createBy},#{createTime},#{editBy},#{editTime},#{editFlag},#{tranId})
    188. </insert>
    189. <delete id="deleteTranRemarkById" parameterType="string">
    190. delete from tbl_tran_remark
    191. where id=#{id}
    192. </delete>
    193. <update id="updateTranRemark" parameterType="com.bjpowernode.crm.workbench.domain.TranRemark">
    194. update tbl_tran_remark
    195. set note_content=#{noteContent},edit_time=#{editTime},edit_by=#{editBy},edit_flag=#{editFlag}
    196. where id=#{id}
    197. </update>
    198. <delete id="deleteTranRemarkByTranIds" parameterType="string">
    199. delete from tbl_tran_remark
    200. where tran_id in
    201. <foreach collection="array" separator="," item="id" open="(" close=")">
    202. #{id}
    203. </foreach>
    204. </delete>
    205. </mapper>

  • 相关阅读:
    私人服务器可以干嘛
    代码随想录算法训练营Day56|动态规划14
    前端、后端面试集锦
    LeetCode #100. 相同的树
    企业微信怎么变更企业名称?
    谷歌评价:从服务器检索信息时出错。DF-DFERH-01
    二分类问题的解决利器:逻辑回归算法详解(一)
    数字示波器verilog设计实现
    【LeetCode】94. 二叉树的中序遍历
    万字长文 - Python 日志记录器logging 百科全书 之 基础配置
  • 原文地址:https://blog.csdn.net/dengfengling999/article/details/128073391