SysDeptMapper.xml 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  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.yijia.system.mapper.SysDeptMapper">
  6. <resultMap type="SysDept" id="SysDeptResult">
  7. <id property="deptId" column="dept_id" />
  8. <result property="parentId" column="parent_id" />
  9. <result property="ancestors" column="ancestors" />
  10. <result property="deptName" column="dept_name" />
  11. <result property="orderNum" column="order_num" />
  12. <result property="leader" column="leader" />
  13. <result property="phone" column="phone" />
  14. <result property="email" column="email" />
  15. <result property="status" column="status" />
  16. <result property="delFlag" column="del_flag" />
  17. <result property="parentName" column="parent_name" />
  18. <result property="createBy" column="create_by" />
  19. <result property="createTime" column="create_time" />
  20. <result property="updateBy" column="update_by" />
  21. <result property="updateTime" column="update_time" />
  22. <result property="jiBie" column="ji_bie" />
  23. <result property="deptAddress" column="dept_address" />
  24. <result property="oilGunNum" column="oil_gun_num" />
  25. <result property="stationPic" column="station_pic" />
  26. <result property="stationLongitude" column="station_longitude" />
  27. <result property="stationLatitude" column="station_latitude" />
  28. <result property="mno" column="mno" />
  29. <result property="discountSetting" column="discount_setting" />
  30. <result property="cardEnabledFlag" column="card_enabled_flag" />
  31. <result property="appId" column="app_id" />
  32. <result property="appSecret" column="app_secret" />
  33. <result property="gzhAppId" column="gzh_app_id" />
  34. <result property="gzhAppSecret" column="gzh_app_secret" />
  35. <result property="aliAppId" column="ali_app_id" />
  36. <result property="aliPublicKey" column="ali_public_key" />
  37. <result property="aliPrivateKey" column="ali_private_key" />
  38. <result property="aliEncryptKey" column="ali_encrypt_key" />
  39. <result property="image1" column="image1" />
  40. <result property="image2" column="image2" />
  41. <result property="image3" column="image3" />
  42. <result property="image4" column="image4" />
  43. <result property="image5" column="image5" />
  44. <result property="wsPrintFlag" column="ws_print_flag" />
  45. <result property="printSetting" column="print_setting" />
  46. <result property="notice" column="notice" />
  47. <result property="integralPrintFlag" column="integral_print_flag" />
  48. <result property="integralFlag" column="integral_flag" />
  49. <result property="integralRuleFlag" column="integral_rule_flag" />
  50. <result property="cardRuleFlag" column="card_rule_flag" />
  51. <result property="couponFlag" column="coupon_flag" />
  52. <result property="labelFlag" column="label_flag" />
  53. <result property="printDeviceType" column="print_device_type" />
  54. <result property="balance" column="balance" />
  55. <result property="isLngFlag" column="is_lng_flag" />
  56. <result property="city" column="city" />
  57. <result property="couponEnabledFlag" column="coupon_enabled_flag" />
  58. <result property="merchantNo" column="merchant_no" />
  59. <result property="terminalId" column="terminal_id" />
  60. <result property="yunKey" column="yun_key" />
  61. <result property="mnoArray" column="mno_array" />
  62. <result property="mnoProportion" column="mno_proportion" />
  63. <result property="mnoStatus" column="mno_status" />
  64. <result property="refundExaminStatus" column="refund_examin_status" />
  65. <result property="isAlipayFlag" column="is_alipay_flag" />
  66. <result property="thirdPayment" column="third_payment" />
  67. <result column="tl_app_id" property="tlAppId" />
  68. <result column="tl_oil_station_no" property="tlOilStationNo" />
  69. <result column="tl_sys_id" property="tlSysId" />
  70. <result column="tl_app_key" property="tlAppKey" />
  71. </resultMap>
  72. <sql id="selectDeptVo">
  73. select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status,
  74. d.del_flag, d.create_by, d.create_time ,d.ji_bie, d.dept_address, d.oil_gun_num, d.station_pic, d.station_longitude,
  75. d.station_latitude, d.mno, discount_setting,card_enabled_flag,d.app_id, d.app_secret,gzh_app_id,gzh_app_secret,ali_app_id,gzh_app_secret,
  76. ali_app_id,ali_public_key,ali_private_key,ali_encrypt_key,image1,image2,image3,image4,image5,ws_print_flag,print_setting,notice,integral_print_flag,
  77. d.integral_flag,d.integral_rule_flag,d.card_rule_flag,d.coupon_flag,d.label_flag,d.print_device_type,d.balance,d.is_lng_flag,d.city,coupon_enabled_flag,
  78. d.merchant_no,d.terminal_id,d.yun_key,d.mno_array,mno_proportion,mno_status,refund_examin_status,is_alipay_flag,third_payment,tl_app_id,tl_oil_station_no,
  79. tl_sys_id,tl_app_key
  80. from sys_dept d
  81. </sql>
  82. <select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
  83. <include refid="selectDeptVo"/>
  84. where d.del_flag = '0'
  85. <if test="deptId != null">
  86. AND dept_id = #{deptId}
  87. </if>
  88. <if test="isLngFlag != null">
  89. AND is_lng_flag = #{isLngFlag}
  90. </if>
  91. <if test="jiBie != null">
  92. AND ji_bie = #{jiBie}
  93. </if>
  94. <if test="parentId != null and parentId != 0">
  95. AND parent_id = #{parentId}
  96. </if>
  97. <if test="orDeptId != null">
  98. AND ( dept_id = #{orDeptId} or parent_id = #{orDeptId} )
  99. </if>
  100. <if test="deptName != null and deptName != ''">
  101. AND dept_name like concat('%', #{deptName}, '%')
  102. </if>
  103. <if test="status != null and status != ''">
  104. AND status = #{status}
  105. </if>
  106. <if test="merchantNo != null and merchantNo != ''">
  107. AND merchant_no = #{merchantNo}
  108. </if>
  109. <if test="terminalId != null and terminalId != ''">
  110. AND terminal_id = #{terminalId}
  111. </if>
  112. <if test="yunKey != null and yunKey != ''">
  113. AND yun_key = #{yunKey}
  114. </if>
  115. <if test="mnoArray != null and mnoArray != ''">
  116. AND mno_array = #{mnoArray}
  117. </if>
  118. <if test="deptIdList != null ">
  119. and dept_id in
  120. <foreach item="item" index="index" collection="deptIdList"
  121. open="(" separator="," close=")">
  122. #{item}
  123. </foreach>
  124. </if>
  125. <!-- 数据范围过滤 -->
  126. ${params.dataScope}
  127. order by d.parent_id, d.order_num
  128. </select>
  129. <select id="queryDeptList" parameterType="SysDept" resultMap="SysDeptResult">
  130. <include refid="selectDeptVo"/>
  131. where d.del_flag = '0'
  132. <if test="deptId != null or parentId!=null">
  133. <trim prefixOverrides="or" prefix=" and (" suffix=")">
  134. <if test="parentId != null and parentId != null">
  135. or parent_id = #{parentId}
  136. </if>
  137. <if test="deptId != null and deptId != null">
  138. or dept_id = #{deptId}
  139. </if>
  140. </trim>
  141. </if>
  142. <!-- 数据范围过滤 -->
  143. ${params.dataScope}
  144. order by d.parent_id, d.order_num
  145. </select>
  146. <select id="selectDeptListByRoleId" resultType="Integer">
  147. select d.dept_id
  148. from sys_dept d
  149. left join sys_role_dept rd on d.dept_id = rd.dept_id
  150. where rd.role_id = #{roleId}
  151. <if test="deptCheckStrictly">
  152. and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId})
  153. </if>
  154. order by d.parent_id, d.order_num
  155. </select>
  156. <select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
  157. <include refid="selectDeptVo"/>
  158. where dept_id = #{deptId}
  159. </select>
  160. <select id="checkDeptExistUser" parameterType="Long" resultType="int">
  161. select count(1) from sys_user where dept_id = #{deptId} and del_flag = '0'
  162. </select>
  163. <select id="hasChildByDeptId" parameterType="Long" resultType="int">
  164. select count(1) from sys_dept
  165. where del_flag = '0' and parent_id = #{deptId} limit 1
  166. </select>
  167. <select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
  168. select * from sys_dept where find_in_set(#{deptId}, ancestors)
  169. </select>
  170. <select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
  171. select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
  172. </select>
  173. <select id="checkDeptNameUnique" resultMap="SysDeptResult">
  174. <include refid="selectDeptVo"/>
  175. where dept_name=#{deptName} and parent_id = #{parentId} limit 1
  176. </select>
  177. <!--调用存储过程-->
  178. <select id="getGroupInfo" resultMap="SysDeptResult">
  179. <include refid="selectDeptVo"/>
  180. <where>
  181. <if test="deptId != null ">
  182. AND dept_id = #{deptId}
  183. </if>
  184. <if test="parentId != null ">
  185. AND parent_id = #{parentId}
  186. </if>
  187. </where>
  188. </select>
  189. <!--添加代理人集团信息查询-->
  190. <select id="selectSysAgentList" parameterType="SysDept" resultMap="SysDeptResult">
  191. SELECT dept_id,dept_name from sys_dept where ji_bie = 1
  192. and dept_id not in (
  193. SELECT group_id from sys_agent
  194. <where>
  195. <if test="userId != null "> and user_id != #{userId}</if>
  196. </where>
  197. )
  198. </select>
  199. <!--查询代理人对应的集团下的站点信息-->
  200. <select id="selectDeptAgentList" parameterType="SysDept" resultMap="SysDeptResult">
  201. SELECT dept_id from sys_dept t
  202. where t.parent_id in (
  203. SELECT dept_id from sys_dept d join sys_agent a on d.dept_id =a.group_id
  204. where d.del_flag = '0'
  205. <if test="userId != null "> and a.user_id = #{userId}</if>
  206. <if test="isLngFlag != null">
  207. AND a.is_lng_flag = #{isLngFlag}
  208. </if>
  209. )
  210. and t.del_flag = '0'
  211. </select>
  212. <!--查询代理人对应的集团信息-->
  213. <select id="selectGroupAgentList" parameterType="SysDept" resultMap="SysDeptResult">
  214. SELECT dept_id,dept_name,integral_rule_flag,card_rule_flag,coupon_flag,label_flag
  215. from sys_dept d join sys_agent a on d.dept_id =a.group_id
  216. where d.del_flag = '0'
  217. <if test="userId != null "> and a.user_id = #{userId}</if>
  218. </select>
  219. <!--根据集团查询油站id-->
  220. <select id="searchDeptList" parameterType="SysDept" resultMap="SysDeptResult">
  221. SELECT dept_id,dept_name from sys_dept
  222. where del_flag = '0'
  223. <if test="parentId != null and parentId != 0">
  224. AND parent_id = #{parentId}
  225. </if>
  226. </select>
  227. <select id="selectGroupAndDeptList" parameterType="SysDept" resultMap="SysDeptResult">
  228. SELECT dept_id,dept_name
  229. from sys_dept
  230. where del_flag = '0'
  231. <if test="orDeptId != null">
  232. AND ( dept_id = #{orDeptId} or parent_id = #{orDeptId} )
  233. </if>
  234. </select>
  235. <!--查询集团及共享信息-->
  236. <select id="selectShareGroup" parameterType="SysDept" resultMap="SysDeptResult">
  237. select d.dept_id, d.parent_id, d.ancestors, d.dept_name,card_enabled_flag,d.app_id,d.integral_flag,d.integral_rule_flag,d.card_rule_flag,
  238. d.coupon_flag,d.label_flag,d.print_device_type,d.coupon_enabled_flag,d.refund_examin_status
  239. from sys_dept d
  240. where d.del_flag = '0'
  241. <if test="integralRuleFlag != null">
  242. AND integral_rule_flag = #{integralRuleFlag}
  243. </if>
  244. <if test="couponFlag != null">
  245. AND coupon_flag = #{couponFlag}
  246. </if>
  247. <if test="cardRuleFlag != null">
  248. AND card_rule_flag = #{cardRuleFlag}
  249. </if>
  250. <if test="cardRuleFlag != null">
  251. AND card_rule_flag = #{cardRuleFlag}
  252. </if>
  253. <if test="deptId != null">
  254. AND dept_id = #{deptId}
  255. </if>
  256. <if test="deptId != null">
  257. AND dept_id = #{deptId}
  258. </if>
  259. <if test="jiBie != null">
  260. AND ji_bie = #{jiBie}
  261. </if>
  262. <if test="orDeptId != null">
  263. AND ( dept_id = #{orDeptId} or parent_id = #{orDeptId} )
  264. </if>
  265. <if test="deptName != null and deptName != ''">
  266. AND dept_name like concat('%', #{deptName}, '%')
  267. </if>
  268. <if test="status != null and status != ''">
  269. AND status = #{status}
  270. </if>
  271. <if test="deptIdList != null ">
  272. and dept_id in
  273. <foreach item="item" index="index" collection="deptIdList"
  274. open="(" separator="," close=")">
  275. #{item}
  276. </foreach>
  277. </if>
  278. </select>
  279. <!--查询所有不共享的站点-->
  280. <select id="selectNotShareDept" parameterType="SysDept" resultMap="SysDeptResult">
  281. select d.dept_id, d.parent_id, d.ancestors, d.dept_name,card_enabled_flag,d.app_id,d.integral_flag,d.integral_rule_flag,d.card_rule_flag,
  282. d.coupon_flag,d.label_flag,d.print_device_type,d.coupon_enabled_flag,d.refund_examin_status
  283. from sys_dept d
  284. where d.del_flag = "0"
  285. and d.parent_id in (
  286. SELECT dept_id from sys_dept t
  287. where t.ji_bie ='1' and del_flag = "0"
  288. <if test="integralRuleFlag != null">
  289. AND integral_rule_flag = #{integralRuleFlag}
  290. </if>
  291. <if test="couponFlag != null">
  292. AND coupon_flag = #{couponFlag}
  293. </if>
  294. <if test="cardRuleFlag != null">
  295. AND card_rule_flag = #{cardRuleFlag}
  296. </if>
  297. )
  298. </select>
  299. <insert id="insertDept" parameterType="SysDept">
  300. insert into sys_dept(
  301. <if test="deptId != null and deptId != 0">dept_id,</if>
  302. <if test="parentId != null and parentId != 0">parent_id,</if>
  303. <if test="deptName != null and deptName != ''">dept_name,</if>
  304. <if test="ancestors != null and ancestors != ''">ancestors,</if>
  305. <if test="orderNum != null and orderNum != ''">order_num,</if>
  306. <if test="leader != null and leader != ''">leader,</if>
  307. <if test="phone != null and phone != ''">phone,</if>
  308. <if test="email != null and email != ''">email,</if>
  309. <if test="status != null">status,</if>
  310. <if test="createBy != null and createBy != ''">create_by,</if>
  311. <if test="jiBie != null">ji_bie,</if>
  312. <if test="deptAddress != null">dept_address,</if>
  313. <if test="oilGunNum != null">oil_gun_num,</if>
  314. <if test="stationPic != null">station_pic,</if>
  315. <if test="stationLongitude!= null">station_longitude,</if>
  316. <if test="stationLatitude != null">station_latitude,</if>
  317. <if test="mno != null">mno,</if>
  318. <if test="appId != null">app_id,</if>
  319. <if test="appSecret != null">app_secret,</if>
  320. <if test="discountSetting != null">discount_setting,</if>
  321. <if test="cardEnabledFlag != null">card_enabled_flag,</if>
  322. <if test="gzhAppId != null">gzh_app_id,</if>
  323. <if test="gzhAppSecret != null">gzh_app_secret,</if>
  324. <if test="aliAppId != null">ali_app_id,</if>
  325. <if test="aliPublicKey != null">ali_public_key,</if>
  326. <if test="aliPrivateKey != null">ali_private_key,</if>
  327. <if test="aliEncryptKey != null">ali_encrypt_key,</if>
  328. <if test="image1 != null">image1,</if>
  329. <if test="image2 != null">image2,</if>
  330. <if test="image3 != null">image3,</if>
  331. <if test="image4 != null">image4,</if>
  332. <if test="image5 != null">image5,</if>
  333. <if test="wsPrintFlag != null">ws_print_flag,</if>
  334. <if test="printSetting != null">print_setting,</if>
  335. <if test="notice != null">notice,</if>
  336. <if test="integralPrintFlag != null">integral_print_flag,</if>
  337. <if test="integralFlag != null">integral_flag,</if>
  338. <if test="integralRuleFlag != null">integral_rule_flag,</if>
  339. <if test="cardRuleFlag != null">card_rule_flag,</if>
  340. <if test="couponFlag != null">coupon_flag,</if>
  341. <if test="labelFlag != null">label_flag,</if>
  342. <if test="printDeviceType != null">print_device_type,</if>
  343. <if test="balance != null">balance,</if>
  344. <if test="city != null">city,</if>
  345. <if test="isLngFlag != null">is_lng_flag,</if>
  346. <if test="merchantNo != null">merchant_no,</if>
  347. <if test="terminalId != null">terminal_id,</if>
  348. <if test="yunKey != null">yun_key,</if>
  349. <if test="couponEnabledFlag != null">coupon_enabled_flag,</if>
  350. <if test="mnoArray != null">mno_array,</if>
  351. <if test="mnoProportion != null">mno_proportion,</if>
  352. <if test="mnoStatus != null">mno_status,</if>
  353. <if test="isAlipayFlag != null">is_alipay_flag,</if>
  354. <if test="refundExaminStatus != null">refund_examin_status,</if>
  355. <if test="thirdPayment != null">third_payment,</if>
  356. <if test="tlAppId != null">tl_app_id,</if>
  357. <if test="tlOilStationNo != null">tl_oil_station_no,</if>
  358. <if test="tlSysId != null">tl_sys_id,</if>
  359. <if test="tlAppKey != null">tl_app_key,</if>
  360. create_time
  361. )values(
  362. <if test="deptId != null and deptId != 0">#{deptId},</if>
  363. <if test="parentId != null and parentId != 0">#{parentId},</if>
  364. <if test="deptName != null and deptName != ''">#{deptName},</if>
  365. <if test="ancestors != null and ancestors != ''">#{ancestors},</if>
  366. <if test="orderNum != null and orderNum != ''">#{orderNum},</if>
  367. <if test="leader != null and leader != ''">#{leader},</if>
  368. <if test="phone != null and phone != ''">#{phone},</if>
  369. <if test="email != null and email != ''">#{email},</if>
  370. <if test="status != null">#{status},</if>
  371. <if test="createBy != null and createBy != ''">#{createBy},</if>
  372. <if test="jiBie != null">#{jiBie},</if>
  373. <if test="deptAddress != null">#{deptAddress},</if>
  374. <if test="oilGunNum != null">#{oilGunNum},</if>
  375. <if test="stationPic != null">#{stationPic},</if>
  376. <if test="stationLongitude!= null">#{stationLongitude},</if>
  377. <if test="stationLatitude != null">#{stationLatitude},</if>
  378. <if test="mno != null">#{mno},</if>
  379. <if test="appId != null">#{appId},</if>
  380. <if test="appSecret != null">#{appSecret},</if>
  381. <if test="discountSetting != null">#{discountSetting},</if>
  382. <if test="cardEnabledFlag != null">#{cardEnabledFlag},</if>
  383. <if test="gzhAppId != null">#{gzhAppId},</if>
  384. <if test="gzhAppSecret != null">#{gzhAppSecret},</if>
  385. <if test="aliAppId != null">#{aliAppId},</if>
  386. <if test="aliPublicKey != null">#{aliPublicKey},</if>
  387. <if test="aliPrivateKey != null">#{aliPrivateKey},</if>
  388. <if test="aliEncryptKey != null">#{aliEncryptKey},</if>
  389. <if test="image1 != null">#{image1},</if>
  390. <if test="image2 != null">#{image2},</if>
  391. <if test="image3 != null">#{image3},</if>
  392. <if test="image4 != null">#{image4},</if>
  393. <if test="image5 != null">#{image5},</if>
  394. <if test="wsPrintFlag != null">#{wsPrintFlag},</if>
  395. <if test="printSetting != null">#{printSetting},</if>
  396. <if test="notice != null">#{notice},</if>
  397. <if test="integralPrintFlag != null">#{integralPrintFlag},</if>
  398. <if test="integralFlag != null">#{integralFlag},</if>
  399. <if test="integralRuleFlag != null">#{integralRuleFlag},</if>
  400. <if test="cardRuleFlag != null">#{cardRuleFlag},</if>
  401. <if test="couponFlag != null">#{couponFlag},</if>
  402. <if test="labelFlag != null">#{labelFlag},</if>
  403. <if test="printDeviceType != null">#{printDeviceType},</if>
  404. <if test="balance != null">#{balance},</if>
  405. <if test="city != null">#{city},</if>
  406. <if test="isLngFlag != null">#{isLngFlag},</if>
  407. <if test="merchantNo != null">#{merchantNo},</if>
  408. <if test="terminalId != null">#{terminalId},</if>
  409. <if test="yunKey != null">#{yunKey},</if>
  410. <if test="couponEnabledFlag != null">#{couponEnabledFlag},</if>
  411. <if test="mnoArray != null">#{mnoArray},</if>
  412. <if test="mnoProportion != null">#{mnoProportion},</if>
  413. <if test="mnoStatus != null">#{mnoStatus},</if>
  414. <if test="isAlipayFlag != null">#{isAlipayFlag},</if>
  415. <if test="refundExaminStatus != null">#{refundExaminStatus},</if>
  416. <if test="thirdPayment != null">#{thirdPayment},</if>
  417. <if test="tlAppId != null">#{tlAppId},</if>
  418. <if test="tlOilStationNo != null">#{tlOilStationNo},</if>
  419. <if test="tlSysId != null">#{tlSysId},</if>
  420. <if test="tlAppKey != null">#{tlAppKey},</if>
  421. sysdate()
  422. )
  423. </insert>
  424. <update id="updateDept" parameterType="SysDept">
  425. update sys_dept
  426. <set>
  427. <if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
  428. <if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
  429. <if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
  430. <if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
  431. <if test="leader != null">leader = #{leader},</if>
  432. <if test="phone != null">phone = #{phone},</if>
  433. <if test="email != null">email = #{email},</if>
  434. <if test="status != null and status != ''">status = #{status},</if>
  435. <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  436. <if test="jiBie != null">ji_bie = #{jiBie},</if>
  437. <if test="deptAddress!= null">dept_address = #{deptAddress},</if>
  438. <if test="oilGunNum != null">oil_gun_num = #{oilGunNum},</if>
  439. <if test="stationPic != null">station_pic = #{stationPic},</if>
  440. <if test="stationLongitude!= null">station_longitude = #{stationLongitude},</if>
  441. <if test="stationLatitude != null">station_latitude = #{stationLatitude},</if>
  442. <if test="mno != null">mno = #{mno},</if>
  443. <if test="appId != null">app_id = #{appId},</if>
  444. <if test="appSecret != null">app_secret = #{appSecret},</if>
  445. <if test="discountSetting != null">discount_setting= #{discountSetting},</if>
  446. <if test="cardEnabledFlag != null">card_enabled_flag= #{cardEnabledFlag},</if>
  447. <if test="gzhAppId != null">gzh_app_id= #{gzhAppId},</if>
  448. <if test="gzhAppSecret != null">gzh_app_secret= #{gzhAppSecret},</if>
  449. <if test="aliAppId != null">ali_app_id= #{aliAppId},</if>
  450. <if test="aliPublicKey != null">ali_public_key= #{aliPublicKey},</if>
  451. <if test="aliPrivateKey != null">ali_private_key= #{aliPrivateKey},</if>
  452. <if test="aliEncryptKey != null">ali_encrypt_key= #{aliEncryptKey},</if>
  453. <if test="image1 != null">image1= #{image1},</if>
  454. <if test="image2 != null">image2= #{image2},</if>
  455. <if test="image3 != null">image3= #{image3},</if>
  456. <if test="image4 != null">image4= #{image4},</if>
  457. <if test="image5 != null">image5= #{image5},</if>
  458. <if test="wsPrintFlag != null">ws_print_flag= #{wsPrintFlag},</if>
  459. <if test="printSetting != null">print_setting= #{printSetting},</if>
  460. <if test="notice != null">notice= #{notice},</if>
  461. <if test="integralPrintFlag != null">integral_print_flag= #{integralPrintFlag},</if>
  462. <if test="integralFlag != null">integral_flag= #{integralFlag},</if>
  463. <if test="integralRuleFlag != null">integral_rule_flag= #{integralRuleFlag},</if>
  464. <if test="cardRuleFlag != null">card_rule_flag= #{cardRuleFlag},</if>
  465. <if test="couponFlag != null">coupon_flag= #{couponFlag},</if>
  466. <if test="labelFlag != null">label_flag= #{labelFlag},</if>
  467. <if test="printDeviceType != null">print_device_type= #{printDeviceType},</if>
  468. <if test="balance != null">balance= #{balance},</if>
  469. <if test="city != null">city= #{city},</if>
  470. <if test="isLngFlag != null">is_lng_flag= #{isLngFlag},</if>
  471. <if test="merchantNo != null">merchant_no= #{merchantNo},</if>
  472. <if test="terminalId != null">terminal_id= #{terminalId},</if>
  473. <if test="yunKey != null">yun_key= #{yunKey},</if>
  474. <if test="couponEnabledFlag != null">coupon_enabled_flag= #{couponEnabledFlag},</if>
  475. <if test="mnoArray != null">mno_array= #{mnoArray},</if>
  476. <if test="mnoProportion != null">mno_proportion= #{mnoProportion},</if>
  477. <if test="mnoStatus != null">mno_status= #{mnoStatus},</if>
  478. <if test="isAlipayFlag != null">is_alipay_flag= #{isAlipayFlag},</if>
  479. <if test="thirdPayment != null">third_payment= #{thirdPayment},</if>
  480. <if test="refundExaminStatus != null">refund_examin_status= #{refundExaminStatus},</if>
  481. <if test="tlAppId != null">tl_app_id= #{tlAppId},</if>
  482. <if test="tlOilStationNo != null">tl_oil_station_no= #{tlOilStationNo},</if>
  483. <if test="tlSysId != null">tl_sys_id= #{tlSysId},</if>
  484. <if test="tlAppKey != null">tl_app_key= #{tlAppKey},</if>
  485. update_time = sysdate()
  486. </set>
  487. where dept_id = #{deptId}
  488. </update>
  489. <update id="updateDeptChildren" parameterType="java.util.List">
  490. update sys_dept set ancestors =
  491. <foreach collection="depts" item="item" index="index"
  492. separator=" " open="case dept_id" close="end">
  493. when #{item.deptId} then #{item.ancestors}
  494. </foreach>
  495. where dept_id in
  496. <foreach collection="depts" item="item" index="index"
  497. separator="," open="(" close=")">
  498. #{item.deptId}
  499. </foreach>
  500. </update>
  501. <update id="updateDeptStatus" parameterType="SysDept">
  502. update sys_dept
  503. <set>
  504. <if test="status != null and status != ''">status = #{status},</if>
  505. <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  506. update_time = sysdate()
  507. </set>
  508. where dept_id in (${ancestors})
  509. </update>
  510. <delete id="deleteDeptById" parameterType="Long">
  511. update sys_dept set del_flag = '2' where dept_id = #{deptId}
  512. </delete>
  513. </mapper>