QwCompanyMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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.qw.mapper.QwCompanyMapper">
  6. <resultMap type="QwCompany" id="QwCompanyResult">
  7. <result property="id" column="id" />
  8. <result property="corpId" column="corp_id" />
  9. <result property="corpName" column="corp_name" />
  10. <result property="openSecret" column="open_secret" />
  11. <result property="openCorpId" column="open_corp_id" />
  12. <result property="serverAgentId" column="server_agent_id" />
  13. <result property="serverBookCorpId" column="server_book_corp_id" />
  14. <result property="serverBookSecret" column="server_book_secret" />
  15. <result property="token" column="token" />
  16. <result property="encodingAesKey" column="encoding_aes_key" />
  17. <result property="providerSecret" column="provider_secret" />
  18. <result property="realmNameUrl" column="realm_name_url" />
  19. <result property="notifyUrl" column="notify_url" />
  20. <result property="chatToolbar" column="chat_toolbar" />
  21. <result property="chatToolbarOauth" column="chat_toolbar_oauth" />
  22. <result property="companyIds" column="company_ids" />
  23. <result property="status" column="status" />
  24. <result property="createTime" column="create_time" />
  25. <result property="updateTime" column="update_time" />
  26. <result property="createBy" column="create_by" />
  27. <result property="isBuy" column="is_buy" />
  28. <result property="msgSecret" column="msg_secret" />
  29. <result property="msgPrivateKey" column="msg_private_key" />
  30. <result property="miniAppId" column="mini_app_id" />
  31. <result property="companyServerNum" column="company_server_num" />
  32. <result property="yjfyyAppId" column="yjfyy_app_id" />
  33. <result property="yjfyyAgentId" column="yjfyy_agent_id" />
  34. <result property="yjfyySchema" column="yjfyy_schema" />
  35. </resultMap>
  36. <sql id="selectQwCompanyVo">
  37. select id, corp_id, corp_name, open_secret, open_corp_id, server_agent_id, server_book_corp_id, server_book_secret, token, encoding_aes_key, provider_secret, realm_name_url, notify_url, chat_toolbar, chat_toolbar_oauth, company_ids, status, create_time, update_time, create_by,is_buy,mini_app_id,company_server_num,yjfyy_app_id,yjfyy_agent_id,yjfyy_schema from qw_company
  38. </sql>
  39. <select id="selectQwCompanyList" parameterType="QwCompany" resultMap="QwCompanyResult">
  40. <include refid="selectQwCompanyVo"/>
  41. <where>
  42. <if test="corpId != null and corpId != ''"> and corp_id = #{corpId}</if>
  43. <if test="corpName != null and corpName != ''"> and corp_name like concat('%', #{corpName}, '%')</if>
  44. <if test="openSecret != null and openSecret != ''"> and open_secret = #{openSecret}</if>
  45. <if test="openCorpId != null and openCorpId != ''"> and open_corp_id = #{openCorpId}</if>
  46. <if test="serverAgentId != null and serverAgentId != ''"> and server_agent_id = #{serverAgentId}</if>
  47. <if test="serverBookCorpId != null and serverBookCorpId != ''"> and server_book_corp_id = #{serverBookCorpId}</if>
  48. <if test="serverBookSecret != null and serverBookSecret != ''"> and server_book_secret = #{serverBookSecret}</if>
  49. <if test="token != null and token != ''"> and token = #{token}</if>
  50. <if test="encodingAesKey != null and encodingAesKey != ''"> and encoding_aes_key = #{encodingAesKey}</if>
  51. <if test="providerSecret != null and providerSecret != ''"> and provider_secret = #{providerSecret}</if>
  52. <if test="realmNameUrl != null and realmNameUrl != ''"> and realm_name_url = #{realmNameUrl}</if>
  53. <if test="notifyUrl != null and notifyUrl != ''"> and notify_url = #{notifyUrl}</if>
  54. <if test="chatToolbar != null and chatToolbar != ''"> and chat_toolbar = #{chatToolbar}</if>
  55. <if test="chatToolbarOauth != null and chatToolbarOauth != ''"> and chat_toolbar_oauth = #{chatToolbarOauth}</if>
  56. <if test="companyIds != null and companyIds != ''"> and company_ids = #{companyIds}</if>
  57. <if test="status != null "> and status = #{status}</if>
  58. <if test="isBuy != null "> and isBuy = #{isBuy}</if>
  59. <if test="createDeptId != null "> and create_dept_id = #{createDeptId}</if>
  60. <if test="createUserId != null "> and create_user_id = #{createUserId}</if>
  61. <if test="yjfyyAppId != null and yjfyyAppId != ''"> and yjfyy_app_id = #{yjfyyAppId}</if>
  62. <if test="yjfyyAgentId != null and yjfyyAgentId != ''"> and yjfyy_agent_id = #{yjfyyAgentId}</if>
  63. <if test="yjfyySchema != null and yjfyySchema != ''"> and yjfyy_schema = #{yjfyySchema}</if>
  64. </where>
  65. </select>
  66. <select id="selectQwCompanyById" parameterType="Long" resultMap="QwCompanyResult">
  67. <include refid="selectQwCompanyVo"/>
  68. where id = #{id}
  69. </select>
  70. <select id="selectQwCompanyByCropID" parameterType="String" resultMap="QwCompanyResult">
  71. <include refid="selectQwCompanyVo"/>
  72. where corp_id = #{corpId}
  73. </select>
  74. <insert id="insertQwCompany" parameterType="QwCompany" useGeneratedKeys="true" keyProperty="id">
  75. insert into qw_company
  76. <trim prefix="(" suffix=")" suffixOverrides=",">
  77. <if test="corpId != null">corp_id,</if>
  78. <if test="corpName != null">corp_name,</if>
  79. <if test="openSecret != null">open_secret,</if>
  80. <if test="openCorpId != null">open_corp_id,</if>
  81. <if test="serverAgentId != null">server_agent_id,</if>
  82. <if test="serverBookCorpId != null">server_book_corp_id,</if>
  83. <if test="serverBookSecret != null">server_book_secret,</if>
  84. <if test="token != null">token,</if>
  85. <if test="encodingAesKey != null">encoding_aes_key,</if>
  86. <if test="providerSecret != null">provider_secret,</if>
  87. <if test="realmNameUrl != null">realm_name_url,</if>
  88. <if test="notifyUrl != null">notify_url,</if>
  89. <if test="chatToolbar != null">chat_toolbar,</if>
  90. <if test="chatToolbarOauth != null">chat_toolbar_oauth,</if>
  91. <if test="companyIds != null">company_ids,</if>
  92. <if test="status != null">status,</if>
  93. <if test="createTime != null">create_time,</if>
  94. <if test="updateTime != null">update_time,</if>
  95. <if test="createBy != null">create_by,</if>
  96. <if test="isBuy != null">is_buy,</if>
  97. <if test="miniAppId != null">mini_app_id,</if>
  98. <if test="companyServerNum != null">company_server_num,</if>
  99. <if test="createUserId != null != null">create_user_id,</if>
  100. <if test="createDeptId != null">create_dept_id,</if>
  101. <if test="yjfyyAppId != null">yjfyy_app_id,</if>
  102. <if test="yjfyyAgentId != null">yjfyy_agent_id,</if>
  103. <if test="yjfyySchema != null">yjfyy_schema,</if>
  104. </trim>
  105. <trim prefix="values (" suffix=")" suffixOverrides=",">
  106. <if test="corpId != null">#{corpId},</if>
  107. <if test="corpName != null">#{corpName},</if>
  108. <if test="openSecret != null">#{openSecret},</if>
  109. <if test="openCorpId != null">#{openCorpId},</if>
  110. <if test="serverAgentId != null">#{serverAgentId},</if>
  111. <if test="serverBookCorpId != null">#{serverBookCorpId},</if>
  112. <if test="serverBookSecret != null">#{serverBookSecret},</if>
  113. <if test="token != null">#{token},</if>
  114. <if test="encodingAesKey != null">#{encodingAesKey},</if>
  115. <if test="providerSecret != null">#{providerSecret},</if>
  116. <if test="realmNameUrl != null">#{realmNameUrl},</if>
  117. <if test="notifyUrl != null">#{notifyUrl},</if>
  118. <if test="chatToolbar != null">#{chatToolbar},</if>
  119. <if test="chatToolbarOauth != null">#{chatToolbarOauth},</if>
  120. <if test="companyIds != null">#{companyIds},</if>
  121. <if test="status != null">#{status},</if>
  122. <if test="createTime != null">#{createTime},</if>
  123. <if test="updateTime != null">#{updateTime},</if>
  124. <if test="createBy != null">#{createBy},</if>
  125. <if test="isBuy != null">#{isBuy},</if>
  126. <if test="miniAppId != null">#{miniAppId},</if>
  127. <if test="companyServerNum != null">#{companyServerNum},</if>
  128. <if test="createUserId != null">#{createUserId},</if>
  129. <if test="createDeptId != null">#{createDeptId},</if>
  130. <if test="yjfyyAppId != null">#{yjfyyAppId},</if>
  131. <if test="yjfyyAgentId != null">#{yjfyyAgentId},</if>
  132. <if test="yjfyySchema != null">#{yjfyySchema},</if>
  133. </trim>
  134. </insert>
  135. <update id="updateQwCompany" parameterType="QwCompany">
  136. update qw_company
  137. <trim prefix="SET" suffixOverrides=",">
  138. <if test="corpId != null">corp_id = #{corpId},</if>
  139. <if test="corpName != null">corp_name = #{corpName},</if>
  140. <if test="openSecret != null">open_secret = #{openSecret},</if>
  141. <if test="openCorpId != null">open_corp_id = #{openCorpId},</if>
  142. <if test="serverAgentId != null">server_agent_id = #{serverAgentId},</if>
  143. <if test="serverBookCorpId != null">server_book_corp_id = #{serverBookCorpId},</if>
  144. <if test="serverBookSecret != null">server_book_secret = #{serverBookSecret},</if>
  145. <if test="token != null">token = #{token},</if>
  146. <if test="encodingAesKey != null">encoding_aes_key = #{encodingAesKey},</if>
  147. <if test="providerSecret != null">provider_secret = #{providerSecret},</if>
  148. <if test="realmNameUrl != null">realm_name_url = #{realmNameUrl},</if>
  149. <if test="notifyUrl != null">notify_url = #{notifyUrl},</if>
  150. <if test="chatToolbar != null">chat_toolbar = #{chatToolbar},</if>
  151. <if test="chatToolbarOauth != null">chat_toolbar_oauth = #{chatToolbarOauth},</if>
  152. <if test="companyIds != null">company_ids = #{companyIds},</if>
  153. <if test="status != null">status = #{status},</if>
  154. <if test="createTime != null">create_time = #{createTime},</if>
  155. <if test="updateTime != null">update_time = #{updateTime},</if>
  156. <if test="createBy != null">create_by = #{createBy},</if>
  157. <if test="isBuy != null">is_buy = #{isBuy},</if>
  158. <if test="miniAppId != null">mini_app_id = #{miniAppId},</if>
  159. <if test="companyServerNum != null">company_server_num = #{companyServerNum},</if>
  160. <if test="yjfyyAppId != null">yjfyy_app_id = #{yjfyyAppId},</if>
  161. <if test="yjfyyAgentId != null">yjfyy_agent_id = #{yjfyyAgentId},</if>
  162. <if test="yjfyySchema != null">yjfyy_schema = #{yjfyySchema},</if>
  163. </trim>
  164. where id = #{id}
  165. </update>
  166. <delete id="deleteQwCompanyById" parameterType="Long">
  167. delete from qw_company where id = #{id}
  168. </delete>
  169. <delete id="deleteQwCompanyByIds" parameterType="String">
  170. delete from qw_company where id in
  171. <foreach item="id" collection="array" open="(" separator="," close=")">
  172. #{id}
  173. </foreach>
  174. </delete>
  175. <select id="selectQwCompanyListOptionsVO" resultType="com.fs.qw.vo.QwOptionsVO">
  176. SELECT * from qw_company
  177. <where>
  178. <if test="userId != null">
  179. and create_user_id = #{userId}
  180. </if>
  181. <if test="deptId != null">
  182. and create_dept_id = #{deptId}
  183. </if>
  184. </where>
  185. </select>
  186. <select id="selectByCorpIds" resultType="com.fs.qw.domain.QwCompany">
  187. select * from qw_company where corp_id in <foreach collection="corpIds" item="item" open="(" close=")" separator=",">#{item}</foreach>
  188. </select>
  189. </mapper>