123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.yijia.system.mapper.SysDeptMapper">
- <resultMap type="SysDept" id="SysDeptResult">
- <id property="deptId" column="dept_id" />
- <result property="parentId" column="parent_id" />
- <result property="ancestors" column="ancestors" />
- <result property="deptName" column="dept_name" />
- <result property="orderNum" column="order_num" />
- <result property="leader" column="leader" />
- <result property="phone" column="phone" />
- <result property="email" column="email" />
- <result property="status" column="status" />
- <result property="delFlag" column="del_flag" />
- <result property="parentName" column="parent_name" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- <result property="jiBie" column="ji_bie" />
- <result property="deptAddress" column="dept_address" />
- <result property="oilGunNum" column="oil_gun_num" />
- <result property="stationPic" column="station_pic" />
- <result property="stationLongitude" column="station_longitude" />
- <result property="stationLatitude" column="station_latitude" />
- <result property="mno" column="mno" />
- <result property="discountSetting" column="discount_setting" />
- <result property="cardEnabledFlag" column="card_enabled_flag" />
- <result property="appId" column="app_id" />
- <result property="appSecret" column="app_secret" />
- <result property="gzhAppId" column="gzh_app_id" />
- <result property="gzhAppSecret" column="gzh_app_secret" />
- <result property="aliAppId" column="ali_app_id" />
- <result property="aliPublicKey" column="ali_public_key" />
- <result property="aliPrivateKey" column="ali_private_key" />
- <result property="aliEncryptKey" column="ali_encrypt_key" />
- <result property="image1" column="image1" />
- <result property="image2" column="image2" />
- <result property="image3" column="image3" />
- <result property="image4" column="image4" />
- <result property="image5" column="image5" />
- <result property="wsPrintFlag" column="ws_print_flag" />
- <result property="printSetting" column="print_setting" />
- <result property="notice" column="notice" />
- <result property="integralPrintFlag" column="integral_print_flag" />
- <result property="integralFlag" column="integral_flag" />
- <result property="integralRuleFlag" column="integral_rule_flag" />
- <result property="cardRuleFlag" column="card_rule_flag" />
- <result property="couponFlag" column="coupon_flag" />
- <result property="labelFlag" column="label_flag" />
- <result property="printDeviceType" column="print_device_type" />
- <result property="balance" column="balance" />
- <result property="isLngFlag" column="is_lng_flag" />
- <result property="city" column="city" />
- <result property="couponEnabledFlag" column="coupon_enabled_flag" />
- <result property="merchantNo" column="merchant_no" />
- <result property="terminalId" column="terminal_id" />
- <result property="yunKey" column="yun_key" />
- <result property="mnoArray" column="mno_array" />
- <result property="mnoProportion" column="mno_proportion" />
- <result property="mnoStatus" column="mno_status" />
- <result property="refundExaminStatus" column="refund_examin_status" />
- <result property="isAlipayFlag" column="is_alipay_flag" />
- <result property="thirdPayment" column="third_payment" />
- <result column="tl_app_id" property="tlAppId" />
- <result column="tl_oil_station_no" property="tlOilStationNo" />
- <result column="tl_sys_id" property="tlSysId" />
- <result column="tl_app_key" property="tlAppKey" />
- </resultMap>
- <sql id="selectDeptVo">
- select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status,
- 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,
- 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,
- 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,
- 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,
- 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,
- tl_sys_id,tl_app_key
- from sys_dept d
- </sql>
- <select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
- <include refid="selectDeptVo"/>
- where d.del_flag = '0'
- <if test="deptId != null">
- AND dept_id = #{deptId}
- </if>
- <if test="isLngFlag != null">
- AND is_lng_flag = #{isLngFlag}
- </if>
- <if test="jiBie != null">
- AND ji_bie = #{jiBie}
- </if>
- <if test="parentId != null and parentId != 0">
- AND parent_id = #{parentId}
- </if>
- <if test="orDeptId != null">
- AND ( dept_id = #{orDeptId} or parent_id = #{orDeptId} )
- </if>
- <if test="deptName != null and deptName != ''">
- AND dept_name like concat('%', #{deptName}, '%')
- </if>
- <if test="status != null and status != ''">
- AND status = #{status}
- </if>
- <if test="merchantNo != null and merchantNo != ''">
- AND merchant_no = #{merchantNo}
- </if>
- <if test="terminalId != null and terminalId != ''">
- AND terminal_id = #{terminalId}
- </if>
- <if test="yunKey != null and yunKey != ''">
- AND yun_key = #{yunKey}
- </if>
- <if test="mnoArray != null and mnoArray != ''">
- AND mno_array = #{mnoArray}
- </if>
- <if test="deptIdList != null ">
- and dept_id in
- <foreach item="item" index="index" collection="deptIdList"
- open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- <!-- 数据范围过滤 -->
- ${params.dataScope}
- order by d.parent_id, d.order_num
- </select>
- <select id="queryDeptList" parameterType="SysDept" resultMap="SysDeptResult">
- <include refid="selectDeptVo"/>
- where d.del_flag = '0'
- <if test="deptId != null or parentId!=null">
- <trim prefixOverrides="or" prefix=" and (" suffix=")">
- <if test="parentId != null and parentId != null">
- or parent_id = #{parentId}
- </if>
- <if test="deptId != null and deptId != null">
- or dept_id = #{deptId}
- </if>
- </trim>
- </if>
- <!-- 数据范围过滤 -->
- ${params.dataScope}
- order by d.parent_id, d.order_num
- </select>
- <select id="selectDeptListByRoleId" resultType="Integer">
- select d.dept_id
- from sys_dept d
- left join sys_role_dept rd on d.dept_id = rd.dept_id
- where rd.role_id = #{roleId}
- <if test="deptCheckStrictly">
- 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})
- </if>
- order by d.parent_id, d.order_num
- </select>
- <select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
- <include refid="selectDeptVo"/>
- where dept_id = #{deptId}
- </select>
- <select id="checkDeptExistUser" parameterType="Long" resultType="int">
- select count(1) from sys_user where dept_id = #{deptId} and del_flag = '0'
- </select>
- <select id="hasChildByDeptId" parameterType="Long" resultType="int">
- select count(1) from sys_dept
- where del_flag = '0' and parent_id = #{deptId} limit 1
- </select>
- <select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
- select * from sys_dept where find_in_set(#{deptId}, ancestors)
- </select>
- <select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
- select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
- </select>
- <select id="checkDeptNameUnique" resultMap="SysDeptResult">
- <include refid="selectDeptVo"/>
- where dept_name=#{deptName} and parent_id = #{parentId} limit 1
- </select>
- <!--调用存储过程-->
- <select id="getGroupInfo" resultMap="SysDeptResult">
- <include refid="selectDeptVo"/>
- <where>
- <if test="deptId != null ">
- AND dept_id = #{deptId}
- </if>
- <if test="parentId != null ">
- AND parent_id = #{parentId}
- </if>
- </where>
- </select>
- <!--添加代理人集团信息查询-->
- <select id="selectSysAgentList" parameterType="SysDept" resultMap="SysDeptResult">
- SELECT dept_id,dept_name from sys_dept where ji_bie = 1
- and dept_id not in (
- SELECT group_id from sys_agent
- <where>
- <if test="userId != null "> and user_id != #{userId}</if>
- </where>
- )
- </select>
- <!--查询代理人对应的集团下的站点信息-->
- <select id="selectDeptAgentList" parameterType="SysDept" resultMap="SysDeptResult">
- SELECT dept_id from sys_dept t
- where t.parent_id in (
- SELECT dept_id from sys_dept d join sys_agent a on d.dept_id =a.group_id
- where d.del_flag = '0'
- <if test="userId != null "> and a.user_id = #{userId}</if>
- <if test="isLngFlag != null">
- AND a.is_lng_flag = #{isLngFlag}
- </if>
- )
- and t.del_flag = '0'
- </select>
- <!--查询代理人对应的集团信息-->
- <select id="selectGroupAgentList" parameterType="SysDept" resultMap="SysDeptResult">
- SELECT dept_id,dept_name,integral_rule_flag,card_rule_flag,coupon_flag,label_flag
- from sys_dept d join sys_agent a on d.dept_id =a.group_id
- where d.del_flag = '0'
- <if test="userId != null "> and a.user_id = #{userId}</if>
- </select>
- <!--根据集团查询油站id-->
- <select id="searchDeptList" parameterType="SysDept" resultMap="SysDeptResult">
- SELECT dept_id,dept_name from sys_dept
- where del_flag = '0'
- <if test="parentId != null and parentId != 0">
- AND parent_id = #{parentId}
- </if>
- </select>
- <select id="selectGroupAndDeptList" parameterType="SysDept" resultMap="SysDeptResult">
- SELECT dept_id,dept_name
- from sys_dept
- where del_flag = '0'
- <if test="orDeptId != null">
- AND ( dept_id = #{orDeptId} or parent_id = #{orDeptId} )
- </if>
- </select>
- <!--查询集团及共享信息-->
- <select id="selectShareGroup" parameterType="SysDept" resultMap="SysDeptResult">
- 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,
- d.coupon_flag,d.label_flag,d.print_device_type,d.coupon_enabled_flag,d.refund_examin_status
- from sys_dept d
- where d.del_flag = '0'
- <if test="integralRuleFlag != null">
- AND integral_rule_flag = #{integralRuleFlag}
- </if>
- <if test="couponFlag != null">
- AND coupon_flag = #{couponFlag}
- </if>
- <if test="cardRuleFlag != null">
- AND card_rule_flag = #{cardRuleFlag}
- </if>
- <if test="cardRuleFlag != null">
- AND card_rule_flag = #{cardRuleFlag}
- </if>
- <if test="deptId != null">
- AND dept_id = #{deptId}
- </if>
- <if test="deptId != null">
- AND dept_id = #{deptId}
- </if>
- <if test="jiBie != null">
- AND ji_bie = #{jiBie}
- </if>
- <if test="orDeptId != null">
- AND ( dept_id = #{orDeptId} or parent_id = #{orDeptId} )
- </if>
- <if test="deptName != null and deptName != ''">
- AND dept_name like concat('%', #{deptName}, '%')
- </if>
- <if test="status != null and status != ''">
- AND status = #{status}
- </if>
- <if test="deptIdList != null ">
- and dept_id in
- <foreach item="item" index="index" collection="deptIdList"
- open="(" separator="," close=")">
- #{item}
- </foreach>
- </if>
- </select>
- <!--查询所有不共享的站点-->
- <select id="selectNotShareDept" parameterType="SysDept" resultMap="SysDeptResult">
- 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,
- d.coupon_flag,d.label_flag,d.print_device_type,d.coupon_enabled_flag,d.refund_examin_status
- from sys_dept d
- where d.del_flag = "0"
- and d.parent_id in (
- SELECT dept_id from sys_dept t
- where t.ji_bie ='1' and del_flag = "0"
- <if test="integralRuleFlag != null">
- AND integral_rule_flag = #{integralRuleFlag}
- </if>
- <if test="couponFlag != null">
- AND coupon_flag = #{couponFlag}
- </if>
- <if test="cardRuleFlag != null">
- AND card_rule_flag = #{cardRuleFlag}
- </if>
- )
- </select>
- <insert id="insertDept" parameterType="SysDept">
- insert into sys_dept(
- <if test="deptId != null and deptId != 0">dept_id,</if>
- <if test="parentId != null and parentId != 0">parent_id,</if>
- <if test="deptName != null and deptName != ''">dept_name,</if>
- <if test="ancestors != null and ancestors != ''">ancestors,</if>
- <if test="orderNum != null and orderNum != ''">order_num,</if>
- <if test="leader != null and leader != ''">leader,</if>
- <if test="phone != null and phone != ''">phone,</if>
- <if test="email != null and email != ''">email,</if>
- <if test="status != null">status,</if>
- <if test="createBy != null and createBy != ''">create_by,</if>
- <if test="jiBie != null">ji_bie,</if>
- <if test="deptAddress != null">dept_address,</if>
- <if test="oilGunNum != null">oil_gun_num,</if>
- <if test="stationPic != null">station_pic,</if>
- <if test="stationLongitude!= null">station_longitude,</if>
- <if test="stationLatitude != null">station_latitude,</if>
- <if test="mno != null">mno,</if>
- <if test="appId != null">app_id,</if>
- <if test="appSecret != null">app_secret,</if>
- <if test="discountSetting != null">discount_setting,</if>
- <if test="cardEnabledFlag != null">card_enabled_flag,</if>
- <if test="gzhAppId != null">gzh_app_id,</if>
- <if test="gzhAppSecret != null">gzh_app_secret,</if>
- <if test="aliAppId != null">ali_app_id,</if>
- <if test="aliPublicKey != null">ali_public_key,</if>
- <if test="aliPrivateKey != null">ali_private_key,</if>
- <if test="aliEncryptKey != null">ali_encrypt_key,</if>
- <if test="image1 != null">image1,</if>
- <if test="image2 != null">image2,</if>
- <if test="image3 != null">image3,</if>
- <if test="image4 != null">image4,</if>
- <if test="image5 != null">image5,</if>
- <if test="wsPrintFlag != null">ws_print_flag,</if>
- <if test="printSetting != null">print_setting,</if>
- <if test="notice != null">notice,</if>
- <if test="integralPrintFlag != null">integral_print_flag,</if>
- <if test="integralFlag != null">integral_flag,</if>
- <if test="integralRuleFlag != null">integral_rule_flag,</if>
- <if test="cardRuleFlag != null">card_rule_flag,</if>
- <if test="couponFlag != null">coupon_flag,</if>
- <if test="labelFlag != null">label_flag,</if>
- <if test="printDeviceType != null">print_device_type,</if>
- <if test="balance != null">balance,</if>
- <if test="city != null">city,</if>
- <if test="isLngFlag != null">is_lng_flag,</if>
- <if test="merchantNo != null">merchant_no,</if>
- <if test="terminalId != null">terminal_id,</if>
- <if test="yunKey != null">yun_key,</if>
- <if test="couponEnabledFlag != null">coupon_enabled_flag,</if>
- <if test="mnoArray != null">mno_array,</if>
- <if test="mnoProportion != null">mno_proportion,</if>
- <if test="mnoStatus != null">mno_status,</if>
- <if test="isAlipayFlag != null">is_alipay_flag,</if>
- <if test="refundExaminStatus != null">refund_examin_status,</if>
- <if test="thirdPayment != null">third_payment,</if>
- <if test="tlAppId != null">tl_app_id,</if>
- <if test="tlOilStationNo != null">tl_oil_station_no,</if>
- <if test="tlSysId != null">tl_sys_id,</if>
- <if test="tlAppKey != null">tl_app_key,</if>
- create_time
- )values(
- <if test="deptId != null and deptId != 0">#{deptId},</if>
- <if test="parentId != null and parentId != 0">#{parentId},</if>
- <if test="deptName != null and deptName != ''">#{deptName},</if>
- <if test="ancestors != null and ancestors != ''">#{ancestors},</if>
- <if test="orderNum != null and orderNum != ''">#{orderNum},</if>
- <if test="leader != null and leader != ''">#{leader},</if>
- <if test="phone != null and phone != ''">#{phone},</if>
- <if test="email != null and email != ''">#{email},</if>
- <if test="status != null">#{status},</if>
- <if test="createBy != null and createBy != ''">#{createBy},</if>
- <if test="jiBie != null">#{jiBie},</if>
- <if test="deptAddress != null">#{deptAddress},</if>
- <if test="oilGunNum != null">#{oilGunNum},</if>
- <if test="stationPic != null">#{stationPic},</if>
- <if test="stationLongitude!= null">#{stationLongitude},</if>
- <if test="stationLatitude != null">#{stationLatitude},</if>
- <if test="mno != null">#{mno},</if>
- <if test="appId != null">#{appId},</if>
- <if test="appSecret != null">#{appSecret},</if>
- <if test="discountSetting != null">#{discountSetting},</if>
- <if test="cardEnabledFlag != null">#{cardEnabledFlag},</if>
- <if test="gzhAppId != null">#{gzhAppId},</if>
- <if test="gzhAppSecret != null">#{gzhAppSecret},</if>
- <if test="aliAppId != null">#{aliAppId},</if>
- <if test="aliPublicKey != null">#{aliPublicKey},</if>
- <if test="aliPrivateKey != null">#{aliPrivateKey},</if>
- <if test="aliEncryptKey != null">#{aliEncryptKey},</if>
- <if test="image1 != null">#{image1},</if>
- <if test="image2 != null">#{image2},</if>
- <if test="image3 != null">#{image3},</if>
- <if test="image4 != null">#{image4},</if>
- <if test="image5 != null">#{image5},</if>
- <if test="wsPrintFlag != null">#{wsPrintFlag},</if>
- <if test="printSetting != null">#{printSetting},</if>
- <if test="notice != null">#{notice},</if>
- <if test="integralPrintFlag != null">#{integralPrintFlag},</if>
- <if test="integralFlag != null">#{integralFlag},</if>
- <if test="integralRuleFlag != null">#{integralRuleFlag},</if>
- <if test="cardRuleFlag != null">#{cardRuleFlag},</if>
- <if test="couponFlag != null">#{couponFlag},</if>
- <if test="labelFlag != null">#{labelFlag},</if>
- <if test="printDeviceType != null">#{printDeviceType},</if>
- <if test="balance != null">#{balance},</if>
- <if test="city != null">#{city},</if>
- <if test="isLngFlag != null">#{isLngFlag},</if>
- <if test="merchantNo != null">#{merchantNo},</if>
- <if test="terminalId != null">#{terminalId},</if>
- <if test="yunKey != null">#{yunKey},</if>
- <if test="couponEnabledFlag != null">#{couponEnabledFlag},</if>
- <if test="mnoArray != null">#{mnoArray},</if>
- <if test="mnoProportion != null">#{mnoProportion},</if>
- <if test="mnoStatus != null">#{mnoStatus},</if>
- <if test="isAlipayFlag != null">#{isAlipayFlag},</if>
- <if test="refundExaminStatus != null">#{refundExaminStatus},</if>
- <if test="thirdPayment != null">#{thirdPayment},</if>
- <if test="tlAppId != null">#{tlAppId},</if>
- <if test="tlOilStationNo != null">#{tlOilStationNo},</if>
- <if test="tlSysId != null">#{tlSysId},</if>
- <if test="tlAppKey != null">#{tlAppKey},</if>
- sysdate()
- )
- </insert>
- <update id="updateDept" parameterType="SysDept">
- update sys_dept
- <set>
- <if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
- <if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
- <if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
- <if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
- <if test="leader != null">leader = #{leader},</if>
- <if test="phone != null">phone = #{phone},</if>
- <if test="email != null">email = #{email},</if>
- <if test="status != null and status != ''">status = #{status},</if>
- <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
- <if test="jiBie != null">ji_bie = #{jiBie},</if>
- <if test="deptAddress!= null">dept_address = #{deptAddress},</if>
- <if test="oilGunNum != null">oil_gun_num = #{oilGunNum},</if>
- <if test="stationPic != null">station_pic = #{stationPic},</if>
- <if test="stationLongitude!= null">station_longitude = #{stationLongitude},</if>
- <if test="stationLatitude != null">station_latitude = #{stationLatitude},</if>
- <if test="mno != null">mno = #{mno},</if>
- <if test="appId != null">app_id = #{appId},</if>
- <if test="appSecret != null">app_secret = #{appSecret},</if>
- <if test="discountSetting != null">discount_setting= #{discountSetting},</if>
- <if test="cardEnabledFlag != null">card_enabled_flag= #{cardEnabledFlag},</if>
- <if test="gzhAppId != null">gzh_app_id= #{gzhAppId},</if>
- <if test="gzhAppSecret != null">gzh_app_secret= #{gzhAppSecret},</if>
- <if test="aliAppId != null">ali_app_id= #{aliAppId},</if>
- <if test="aliPublicKey != null">ali_public_key= #{aliPublicKey},</if>
- <if test="aliPrivateKey != null">ali_private_key= #{aliPrivateKey},</if>
- <if test="aliEncryptKey != null">ali_encrypt_key= #{aliEncryptKey},</if>
- <if test="image1 != null">image1= #{image1},</if>
- <if test="image2 != null">image2= #{image2},</if>
- <if test="image3 != null">image3= #{image3},</if>
- <if test="image4 != null">image4= #{image4},</if>
- <if test="image5 != null">image5= #{image5},</if>
- <if test="wsPrintFlag != null">ws_print_flag= #{wsPrintFlag},</if>
- <if test="printSetting != null">print_setting= #{printSetting},</if>
- <if test="notice != null">notice= #{notice},</if>
- <if test="integralPrintFlag != null">integral_print_flag= #{integralPrintFlag},</if>
- <if test="integralFlag != null">integral_flag= #{integralFlag},</if>
- <if test="integralRuleFlag != null">integral_rule_flag= #{integralRuleFlag},</if>
- <if test="cardRuleFlag != null">card_rule_flag= #{cardRuleFlag},</if>
- <if test="couponFlag != null">coupon_flag= #{couponFlag},</if>
- <if test="labelFlag != null">label_flag= #{labelFlag},</if>
- <if test="printDeviceType != null">print_device_type= #{printDeviceType},</if>
- <if test="balance != null">balance= #{balance},</if>
- <if test="city != null">city= #{city},</if>
- <if test="isLngFlag != null">is_lng_flag= #{isLngFlag},</if>
- <if test="merchantNo != null">merchant_no= #{merchantNo},</if>
- <if test="terminalId != null">terminal_id= #{terminalId},</if>
- <if test="yunKey != null">yun_key= #{yunKey},</if>
- <if test="couponEnabledFlag != null">coupon_enabled_flag= #{couponEnabledFlag},</if>
- <if test="mnoArray != null">mno_array= #{mnoArray},</if>
- <if test="mnoProportion != null">mno_proportion= #{mnoProportion},</if>
- <if test="mnoStatus != null">mno_status= #{mnoStatus},</if>
- <if test="isAlipayFlag != null">is_alipay_flag= #{isAlipayFlag},</if>
- <if test="thirdPayment != null">third_payment= #{thirdPayment},</if>
- <if test="refundExaminStatus != null">refund_examin_status= #{refundExaminStatus},</if>
- <if test="tlAppId != null">tl_app_id= #{tlAppId},</if>
- <if test="tlOilStationNo != null">tl_oil_station_no= #{tlOilStationNo},</if>
- <if test="tlSysId != null">tl_sys_id= #{tlSysId},</if>
- <if test="tlAppKey != null">tl_app_key= #{tlAppKey},</if>
- update_time = sysdate()
- </set>
- where dept_id = #{deptId}
- </update>
- <update id="updateDeptChildren" parameterType="java.util.List">
- update sys_dept set ancestors =
- <foreach collection="depts" item="item" index="index"
- separator=" " open="case dept_id" close="end">
- when #{item.deptId} then #{item.ancestors}
- </foreach>
- where dept_id in
- <foreach collection="depts" item="item" index="index"
- separator="," open="(" close=")">
- #{item.deptId}
- </foreach>
- </update>
- <update id="updateDeptStatus" parameterType="SysDept">
- update sys_dept
- <set>
- <if test="status != null and status != ''">status = #{status},</if>
- <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
- update_time = sysdate()
- </set>
- where dept_id in (${ancestors})
- </update>
- <delete id="deleteDeptById" parameterType="Long">
- update sys_dept set del_flag = '2' where dept_id = #{deptId}
- </delete>
- </mapper>
|