AiSipCallUserMapper.xml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.fs.aiSipCall.mapper.AiSipCallUserMapper">
  6. <resultMap type="AiSipCallUser" id="AiSipCallUserResult">
  7. <result property="userId" column="user_id" />
  8. <result property="deptId" column="dept_id" />
  9. <result property="loginName" column="login_name" />
  10. <result property="userName" column="user_name" />
  11. <result property="userType" column="user_type" />
  12. <result property="email" column="email" />
  13. <result property="phonenumber" column="phonenumber" />
  14. <result property="sex" column="sex" />
  15. <result property="avatar" column="avatar" />
  16. <result property="password" column="password" />
  17. <result property="salt" column="salt" />
  18. <result property="status" column="status" />
  19. <result property="delFlag" column="del_flag" />
  20. <result property="loginIp" column="login_ip" />
  21. <result property="loginDate" column="login_date" />
  22. <result property="pwdUpdateDate" column="pwd_update_date" />
  23. <result property="remark" column="remark" />
  24. <result property="logo" column="logo" />
  25. <result property="extNum" column="ext_num" />
  26. <result property="createBy" column="create_by" />
  27. <result property="createTime" column="create_time" />
  28. <result property="updateBy" column="update_by" />
  29. <result property="updateTime" column="update_time" />
  30. <result property="companyId" column="company_id" />
  31. <result property="companyUserId" column="company_user_id" />
  32. <result property="gatewayIds" column="gateway_ids" />
  33. </resultMap>
  34. <sql id="selectAiSipCallUserVo">
  35. select user_id, dept_id, login_name, user_name, user_type, email, phonenumber, sex, avatar, password, salt, status, del_flag, login_ip, login_date, pwd_update_date, remark, logo, ext_num, create_by, create_time, update_by, update_time, company_id,company_user_id,gateway_ids from ai_sip_call_user
  36. </sql>
  37. <select id="selectAiSipCallUserList" parameterType="AiSipCallUser" resultMap="AiSipCallUserResult">
  38. <include refid="selectAiSipCallUserVo"/>
  39. <where>
  40. <if test="deptId != null "> and dept_id = #{deptId}</if>
  41. <if test="loginName != null and loginName != ''"> and login_name like concat('%', #{loginName}, '%')</if>
  42. <if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
  43. <if test="userType != null and userType != ''"> and user_type = #{userType}</if>
  44. <if test="email != null and email != ''"> and email = #{email}</if>
  45. <if test="phonenumber != null and phonenumber != ''"> and phonenumber = #{phonenumber}</if>
  46. <if test="sex != null and sex != ''"> and sex = #{sex}</if>
  47. <if test="avatar != null and avatar != ''"> and avatar = #{avatar}</if>
  48. <if test="password != null and password != ''"> and password = #{password}</if>
  49. <if test="salt != null and salt != ''"> and salt = #{salt}</if>
  50. <if test="status != null and status != ''"> and status = #{status}</if>
  51. <if test="loginIp != null and loginIp != ''"> and login_ip = #{loginIp}</if>
  52. <if test="loginDate != null "> and login_date = #{loginDate}</if>
  53. <if test="pwdUpdateDate != null "> and pwd_update_date = #{pwdUpdateDate}</if>
  54. <if test="logo != null and logo != ''"> and logo = #{logo}</if>
  55. <if test="extNum != null and extNum != ''"> and ext_num = #{extNum}</if>
  56. <if test="companyId != null "> and company_id = #{companyId}</if>
  57. <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
  58. </where>
  59. </select>
  60. <select id="selectAiSipCallUserByUserId" parameterType="Long" resultMap="AiSipCallUserResult">
  61. <include refid="selectAiSipCallUserVo"/>
  62. where user_id = #{userId}
  63. </select>
  64. <insert id="insertAiSipCallUser" parameterType="AiSipCallUser">
  65. insert into ai_sip_call_user
  66. <trim prefix="(" suffix=")" suffixOverrides=",">
  67. <if test="userId != null">user_id,</if>
  68. <if test="deptId != null">dept_id,</if>
  69. <if test="loginName != null and loginName != ''">login_name,</if>
  70. <if test="userName != null">user_name,</if>
  71. <if test="userType != null">user_type,</if>
  72. <if test="email != null">email,</if>
  73. <if test="phonenumber != null">phonenumber,</if>
  74. <if test="sex != null">sex,</if>
  75. <if test="avatar != null">avatar,</if>
  76. <if test="password != null">password,</if>
  77. <if test="salt != null">salt,</if>
  78. <if test="status != null">status,</if>
  79. <if test="delFlag != null">del_flag,</if>
  80. <if test="loginIp != null">login_ip,</if>
  81. <if test="loginDate != null">login_date,</if>
  82. <if test="pwdUpdateDate != null">pwd_update_date,</if>
  83. <if test="createBy != null">create_by,</if>
  84. <if test="createTime != null">create_time,</if>
  85. <if test="updateBy != null">update_by,</if>
  86. <if test="updateTime != null">update_time,</if>
  87. <if test="remark != null">remark,</if>
  88. <if test="logo != null">logo,</if>
  89. <if test="companyUserId != null">company_user_id,</if>
  90. <if test="extNum != null and extNum != ''">ext_num,</if>
  91. <if test="companyId != null ">company_id,</if>
  92. <if test="gatewayIds != null and gatewayIds != ''">gateway_ids,</if>
  93. </trim>
  94. <trim prefix="values (" suffix=")" suffixOverrides=",">
  95. <if test="userId != null">#{userId},</if>
  96. <if test="deptId != null">#{deptId},</if>
  97. <if test="loginName != null and loginName != ''">#{loginName},</if>
  98. <if test="userName != null">#{userName},</if>
  99. <if test="userType != null">#{userType},</if>
  100. <if test="email != null">#{email},</if>
  101. <if test="phonenumber != null">#{phonenumber},</if>
  102. <if test="sex != null">#{sex},</if>
  103. <if test="avatar != null">#{avatar},</if>
  104. <if test="password != null">#{password},</if>
  105. <if test="salt != null">#{salt},</if>
  106. <if test="status != null">#{status},</if>
  107. <if test="delFlag != null">#{delFlag},</if>
  108. <if test="loginIp != null">#{loginIp},</if>
  109. <if test="loginDate != null">#{loginDate},</if>
  110. <if test="pwdUpdateDate != null">#{pwdUpdateDate},</if>
  111. <if test="createBy != null">#{createBy},</if>
  112. <if test="createTime != null">#{createTime},</if>
  113. <if test="updateBy != null">#{updateBy},</if>
  114. <if test="updateTime != null">#{updateTime},</if>
  115. <if test="remark != null">#{remark},</if>
  116. <if test="logo != null">#{logo},</if>
  117. <if test="companyUserId != null">#{companyUserId},</if>
  118. <if test="extNum != null and extNum != ''">#{extNum},</if>
  119. <if test="companyId != null">#{companyId},</if>
  120. <if test="gatewayIds != null and gatewayIds != ''">#{gatewayIds},</if>
  121. </trim>
  122. </insert>
  123. <update id="updateAiSipCallUser" parameterType="AiSipCallUser">
  124. update ai_sip_call_user
  125. <trim prefix="SET" suffixOverrides=",">
  126. <if test="deptId != null">dept_id = #{deptId},</if>
  127. <if test="loginName != null and loginName != ''">login_name = #{loginName},</if>
  128. <if test="userName != null">user_name = #{userName},</if>
  129. <if test="userType != null">user_type = #{userType},</if>
  130. <if test="email != null">email = #{email},</if>
  131. <if test="phonenumber != null">phonenumber = #{phonenumber},</if>
  132. <if test="sex != null">sex = #{sex},</if>
  133. <if test="avatar != null">avatar = #{avatar},</if>
  134. <if test="password != null">password = #{password},</if>
  135. <if test="salt != null">salt = #{salt},</if>
  136. <if test="status != null">status = #{status},</if>
  137. <if test="delFlag != null">del_flag = #{delFlag},</if>
  138. <if test="loginIp != null">login_ip = #{loginIp},</if>
  139. <if test="loginDate != null">login_date = #{loginDate},</if>
  140. <if test="pwdUpdateDate != null">pwd_update_date = #{pwdUpdateDate},</if>
  141. <if test="createBy != null">create_by = #{createBy},</if>
  142. <if test="createTime != null">create_time = #{createTime},</if>
  143. <if test="updateBy != null">update_by = #{updateBy},</if>
  144. <if test="updateTime != null">update_time = #{updateTime},</if>
  145. <if test="remark != null">remark = #{remark},</if>
  146. <if test="logo != null">logo = #{logo},</if>
  147. <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
  148. <if test="extNum != null and extNum != ''">ext_num = #{extNum},</if>
  149. <if test="companyId != null">company_id = #{companyId},</if>
  150. <if test="gatewayIds != null and gatewayIds != ''">gateway_ids = #{gatewayIds},</if>
  151. </trim>
  152. where user_id = #{userId}
  153. </update>
  154. <delete id="deleteAiSipCallUserByUserId" parameterType="Long">
  155. delete from ai_sip_call_user where user_id = #{userId}
  156. </delete>
  157. <delete id="deleteAiSipCallUserByUserIds" parameterType="String">
  158. delete from ai_sip_call_user where user_id in
  159. <foreach item="userId" collection="array" open="(" separator="," close=")">
  160. #{userId}
  161. </foreach>
  162. </delete>
  163. </mapper>