123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199 |
- <?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.minpay.db.table.own.mapper.BranchManageMapper">
- <select id="queryBranchByLevel" resultType="hashmap" parameterType="java.util.Map">
- SELECT
- BRH_ID AS "branchId",
- BRH_NAME AS "name",
- BRH_LEVEL AS "level",
- BRH_PARENTID AS "parentId",
- BRH_REGIONID AS "regionId",
- BRH_DESC AS "desc",
- BRH_ADDRESS AS "address",
- BRH_STT AS "stt",
- BRH_PERSON AS "person",
- BRH_PHONE AS "phone",
- BRH_SHORTNAME AS "shortName",
- brh_name AS "branchName",
- usr_name AS "usrName",
- COUNT(USR_BRANCHID) AS "count"
- FROM IM_BRANCH
- LEFT JOIN im_user
- ON im_user.USR_BRANCHID = im_branch.BRH_ID
- where 1=1
- <if test=" bId !=null and bId != ''">
- and BRH_ID in(SELECT BRH_ID FROM im_branch WHERE BRH_ID= #{bId,jdbcType=VARCHAR} OR BRH_PARENTID = #{bId,jdbcType=VARCHAR} )
- </if>
-
- <if test=" branchId !=null and branchId != ''">
- and BRH_ID = #{branchId,jdbcType=VARCHAR}
- </if>
- <if test=" branchName !=null and branchName != ''">
- and BRH_NAME like concat('%' , #{branchName,jdbcType=VARCHAR},'%')
- </if>
- <if test=" branchStatus !=null and branchStatus != ''">
- and BRH_STT = #{branchStatus,jdbcType=VARCHAR}
- </if>
- <if test=" branchType !=null and branchType != ''">
- and BRH_TYPE = #{branchType,jdbcType=VARCHAR}
- </if>
- GROUP BY BRH_ID
- ORDER BY BRH_LEVEL, BRH_ID
- </select>
-
- <select id="queryAllBranch" resultType="hashmap" parameterType="java.util.Map">
- SELECT
- BRH_ID AS "branchId",
- BRH_NAME AS "name",
- BRH_LEVEL AS "level",
- BRH_PARENTID AS "parentId",
- BRH_REGIONID AS "regionId",
- BRH_DESC AS "desc",
- BRH_ADDRESS AS "address",
- BRH_STT AS "stt",
- BRH_PERSON AS "person",
- BRH_PHONE AS "phone",
- BRH_SHORTNAME AS "shortName",
- brh_name AS "branchName",
- usr_name AS "usrName",
- COUNT(USR_BRANCHID) AS "count"
- FROM IM_BRANCH
- LEFT JOIN im_user
- ON im_user.USR_BRANCHID = im_branch.BRH_ID
- where 1=1
- and BRH_STT != "2"
- <!-- and BRH_ID in(SELECT brh_id FROM im_branch WHERE FIND_IN_SET(brh_id, getChildBranch({bId,jdbcType=VARCHAR})) ) 0 -->
- <if test=" branchId !=null and branchId != ''">
- and BRH_ID = #{branchId,jdbcType=VARCHAR}
- </if>
- <if test=" branchName !=null and branchName != ''">
- and BRH_NAME like concat('%' , #{branchName,jdbcType=VARCHAR},'%')
- </if>
- <if test=" branchStatus !=null and branchStatus != ''">
- and BRH_STT = #{branchStatus,jdbcType=VARCHAR}
- </if>
- <if test=" agentId !=null and agentId != ''">
- and BRH_PARENTID = #{agentId,jdbcType=VARCHAR}
- </if>
- <if test=" branchType !=null and branchType != ''">
- and BRH_TYPE = #{branchType,jdbcType=VARCHAR}
- </if>
- <if test=" person !=null and person != ''">
- and BRH_PERSON like concat('%' , #{person,jdbcType=VARCHAR},'%')
- </if>
- <if test=" phone !=null and phone != ''">
- and BRH_PHONE like concat('%' , #{phone,jdbcType=VARCHAR},'%')
- </if>
- GROUP BY BRH_ID
- ORDER BY BRH_ID desc
- </select>
- <select id="queryAllSchool" resultType="hashmap" parameterType="java.util.Map">
- SELECT BRH_ID AS "branchId",
- BRH_NAME AS "name",
- BRH_LEVEL AS "level",
- BRH_PARENTID AS "parentId",
- BRH_REGIONID AS "regionId",
- BRH_DESC AS "desc",
- BRH_ADDRESS AS "address",
- BRH_STT AS "stt",
- BRH_PERSON AS "person",
- BRH_PHONE AS "phone",
- BRH_SHORTNAME AS "shortName",
- BRH_TYPE AS "branchType",
- BRH_IMG AS "img",
- BRH_CONTENT AS "content",
- BRH_NAME AS "branchName",
- BRH_PROVINCE AS "province",
- BRH_CITY AS "city",
- BRH_AREA AS "area",
- MCD_CODE as "code"
- FROM IM_BRANCH
- LEFT JOIN ms_invite_code ON MCD_BRANCHID = BRH_ID
- where 1=1
- <!-- and BRH_ID in(SELECT brh_id FROM im_branch WHERE FIND_IN_SET(brh_id, getChildBranch({bId,jdbcType=VARCHAR})) ) 0 -->
-
- <if test=" branchName !=null and branchName != ''">
- and BRH_NAME like concat('%' , #{branchName,jdbcType=VARCHAR},'%')
- </if>
- <if test=" branchStatus !=null and branchStatus != ''">
- and BRH_STT = #{branchStatus,jdbcType=VARCHAR}
- </if>
- <if test=" type !=null and type != ''">
- and BRH_TYPE = #{type,jdbcType=VARCHAR}
- </if>
- <if test=" agentId !=null and agentId != ''">
- and BRH_PARENTID = #{agentId,jdbcType=VARCHAR}
- </if>
- <if test=" branchId !=null and branchId != ''">
- and BRH_ID = #{branchId,jdbcType=VARCHAR}
- </if>
- ORDER BY BRH_ID desc
- </select>
-
- <select id="queryBranchNo" resultType="hashmap" parameterType="java.util.Map">
- SELECT BRH_ID AS "branchNo",
- BRH_NAME AS "branchName"
- FROM IM_BRANCH
- WHERE BRH_LEVEL = '1'
- </select>
- <select id="queryBranchNoByPointNo" resultType="hashmap" parameterType="java.util.Map">
- SELECT BRH_ID AS "branchNo",
- BRH_NAME AS "branchName"
- FROM IM_BRANCH
- WHERE
- <if test=" pointNo !=null and pointNo != ''">
- BRH_ID = #{pointNo,jdbcType=VARCHAR}
-
- </if>
- </select>
- <select id="getUnInstallSchool" resultType="hashmap" parameterType="java.util.Map">
- SELECT BRH_ID AS "branchNo",
- BRH_NAME AS "branchName",
- BRH_TYPE AS "type",
- BRH_LEVEL AS "level"
- FROM IM_BRANCH
- WHERE BRH_TYPE = '02'
- AND BRH_READY = #{ready,jdbcType=VARCHAR}
- AND BRH_STT = #{state,jdbcType=VARCHAR}
- AND BRH_ID NOT IN (
- SELECT MWT_BRHID
- FROM ms_worker_task )
- </select>
-
- <select id="getChildBranch" resultType="hashmap" parameterType="java.util.Map">
- SELECT BRH_ID AS "branchId",
- BRH_NAME AS "branchName"
- FROM IM_BRANCH
- WHERE
- BRH_ID = #{branchId,jdbcType=VARCHAR} OR
- BRH_PARENTID = #{branchId,jdbcType=VARCHAR}
- ORDER BY BRH_LEVEL, BRH_ID
- </select>
-
- <select id="getChildBranchById" resultType="hashmap" parameterType="java.util.Map">
- SELECT BRH_ID AS "branchId",
- BRH_NAME AS "branchName"
- FROM IM_BRANCH
- WHERE BRH_PARENTID = #{branchId,jdbcType=VARCHAR}
- ORDER BY BRH_LEVEL, BRH_ID
- </select>
-
- <update id="updateBranchUrl" parameterType="java.util.Map">
- UPDATE im_branch SET
- BRH_URL = (#{url,jdbcType=VARCHAR})
- WHERE
- <if test="branchId != null and branchId != ''">
- BRH_ID= (#{branchId,jdbcType=VARCHAR})
- </if>
- </update>
- <update id="updateBranchUrlState" parameterType="java.util.Map">
- UPDATE im_branch SET
- <if test="urlState != null and urlState != ''">
- BRH_URLSTATE = (#{urlState,jdbcType=VARCHAR})
- </if>
- WHERE
- <if test="branchId != null and branchId != ''">
- BRH_ID= (#{branchId,jdbcType=VARCHAR})
- </if>
- </update>
- </mapper>
|