|
@@ -3,390 +3,379 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
|
|
<mapper namespace="com.qunzhixinxi.hnqz.admin.mapper.WmDaAgentMapper">
|
|
|
- <resultMap id="wmDaAgentMap" type="com.qunzhixinxi.hnqz.admin.api.entity.WmDaAgent">
|
|
|
- <id property="id" column="id"/>
|
|
|
- <result property="gsmc" column="gsmc"/>
|
|
|
- <result property="yyzz" column="yyzz"/>
|
|
|
- <result property="sbjnzm" column="sbjnzm"/>
|
|
|
- <result property="frsfzzmZm" column="frsfzzm_zm"/>
|
|
|
- <result property="frsfzzmBm" column="frsfzzm_bm"/>
|
|
|
- <result property="frsfzzmSc" column="frsfzzm_sc"/>
|
|
|
- <result property="zjType" column="zj_type"/>
|
|
|
- <result property="zjNumber" column="zj_number"/>
|
|
|
- <result property="jsAccount" column="js_account"/>
|
|
|
- <result property="isExamine" column="is_examine"/>
|
|
|
- <result property="extDrugEnt" column="ext_drug_ent"/>
|
|
|
- <result property="temp1" column="temp1"/>
|
|
|
- <result property="temp2" column="temp2"/>
|
|
|
- <result property="deptId" column="dept_id"/>
|
|
|
- <result property="delFlag" column="del_flag"/>
|
|
|
- <result property="enableFlag" column="enable_flag"/>
|
|
|
- <result property="tenantId" column="tenant_id"/>
|
|
|
- <result property="createTime" column="create_time"/>
|
|
|
- <result property="createUser" column="create_user"/>
|
|
|
- <result property="updateTime" column="update_time"/>
|
|
|
- <result property="updateUser" column="update_user"/>
|
|
|
- <result property="drugEntId" column="drug_ent_id"/>
|
|
|
- <result property="pgqx" column="pgqx"/>
|
|
|
- <result property="qylx" column="qylx"/>
|
|
|
- <result property="management" column="management"/>
|
|
|
- <result property="serviceContract" column="ser_cnt"/>
|
|
|
- <result property="serviceDeadline" column="ddl"/>
|
|
|
- <result property="taxRecordIn12m" column="tax_in_12m"/>
|
|
|
- <result property="marketServicesAgreement" column="mkt_ser_agr"/>
|
|
|
- <result property="publicitySystemQueryResults" column="pub_sys_qry_res"/>
|
|
|
- <result property="skuIds" column="sku_id"/>
|
|
|
- <result property="deptLevel" column="dept_level"/>
|
|
|
-
|
|
|
- </resultMap>
|
|
|
- <insert id="insert1" parameterType="com.qunzhixinxi.hnqz.admin.api.entity.WmDaAgent">
|
|
|
- insert into wm_da_agent (gsmc, yyzz,
|
|
|
- sbjnzm, frsfzzm_zm, frsfzzm_bm,
|
|
|
- frsfzzm_sc, zj_type, zj_number,
|
|
|
- js_account, is_examine, ext_drug_ent,
|
|
|
- temp1, temp2, dept_id,
|
|
|
- del_flag, enable_flag, tenant_id,
|
|
|
- create_time, create_user, update_time,
|
|
|
- update_user, drug_ent_id, pgqx, qylx
|
|
|
+ <resultMap id="wmDaAgentMap" type="com.qunzhixinxi.hnqz.admin.api.entity.WmDaAgent">
|
|
|
+ <id property="id" column="id"/>
|
|
|
+ <result property="gsmc" column="gsmc"/>
|
|
|
+ <result property="yyzz" column="yyzz"/>
|
|
|
+ <result property="sbjnzm" column="sbjnzm"/>
|
|
|
+ <result property="frsfzzmZm" column="frsfzzm_zm"/>
|
|
|
+ <result property="frsfzzmBm" column="frsfzzm_bm"/>
|
|
|
+ <result property="frsfzzmSc" column="frsfzzm_sc"/>
|
|
|
+ <result property="zjType" column="zj_type"/>
|
|
|
+ <result property="zjNumber" column="zj_number"/>
|
|
|
+ <result property="jsAccount" column="js_account"/>
|
|
|
+ <result property="isExamine" column="is_examine"/>
|
|
|
+ <result property="extDrugEnt" column="ext_drug_ent"/>
|
|
|
+ <result property="temp1" column="temp1"/>
|
|
|
+ <result property="temp2" column="temp2"/>
|
|
|
+ <result property="deptId" column="dept_id"/>
|
|
|
+ <result property="delFlag" column="del_flag"/>
|
|
|
+ <result property="enableFlag" column="enable_flag"/>
|
|
|
+ <result property="tenantId" column="tenant_id"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="createUser" column="create_user"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ <result property="updateUser" column="update_user"/>
|
|
|
+ <result property="drugEntId" column="drug_ent_id"/>
|
|
|
+ <result property="pgqx" column="pgqx"/>
|
|
|
+ <result property="qylx" column="qylx"/>
|
|
|
+ <result property="management" column="management"/>
|
|
|
+ <result property="serviceContract" column="ser_cnt"/>
|
|
|
+ <result property="serviceDeadline" column="ddl"/>
|
|
|
+ <result property="taxRecordIn12m" column="tax_in_12m"/>
|
|
|
+ <result property="marketServicesAgreement" column="mkt_ser_agr"/>
|
|
|
+ <result property="publicitySystemQueryResults" column="pub_sys_qry_res"/>
|
|
|
+ <result property="skuIds" column="sku_id"/>
|
|
|
+ <result property="deptLevel" column="dept_level"/>
|
|
|
+
|
|
|
+ </resultMap>
|
|
|
+ <insert id="insert1" parameterType="com.qunzhixinxi.hnqz.admin.api.entity.WmDaAgent">
|
|
|
+ INSERT INTO wm_da_agent (gsmc, yyzz,
|
|
|
+ sbjnzm, frsfzzm_zm, frsfzzm_bm,
|
|
|
+ frsfzzm_sc, zj_type, zj_number,
|
|
|
+ js_account, is_examine, ext_drug_ent,
|
|
|
+ temp1, temp2, dept_id,
|
|
|
+ del_flag, enable_flag, tenant_id,
|
|
|
+ create_time, create_user, update_time,
|
|
|
+ update_user, drug_ent_id, pgqx, qylx)
|
|
|
+ VALUES (#{gsmc,jdbcType=VARCHAR}, #{yyzz,jdbcType=VARCHAR},
|
|
|
+ #{sbjnzm,jdbcType=VARCHAR}, #{frsfzzmZm,jdbcType=VARCHAR}, #{frsfzzmBm,jdbcType=VARCHAR},
|
|
|
+ #{frsfzzmSc,jdbcType=VARCHAR}, #{zjType,jdbcType=VARCHAR}, #{zjNumber,jdbcType=VARCHAR},
|
|
|
+ #{jsAccount,jdbcType=VARCHAR}, #{isExamine,jdbcType=VARCHAR}, #{extDrugEnt,jdbcType=VARCHAR},
|
|
|
+ #{temp1,jdbcType=VARCHAR}, #{temp2,jdbcType=VARCHAR}, #{deptId},
|
|
|
+ #{delFlag,jdbcType=VARCHAR}, #{enableFlag,jdbcType=VARCHAR},
|
|
|
+ #{tenantId,jdbcType=BIGINT}, #{createTime,jdbcType=VARCHAR},
|
|
|
+ #{createUser,jdbcType=BIGINT}, #{updateTime,jdbcType=VARCHAR}, #{updateUser,jdbcType=VARCHAR},
|
|
|
+ #{drugEntId,jdbcType=VARCHAR}, #{pgqx,jdbcType=VARCHAR}, #{qylx,jdbcType=VARCHAR})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!-- 分页查询派工企业 -->
|
|
|
+ <select id="selectWmManagementPage" resultMap="wmDaAgentMap">
|
|
|
+ SELECT distinct
|
|
|
+ a.*, d.dept_permissions, d.level as dept_level, d.financial_review_type
|
|
|
+ FROM wm_da_agent a
|
|
|
+ LEFT JOIN sys_dept d ON d.dept_id = a.dept_id
|
|
|
+ <if test="query.csmUserIdList != null and query.csmUserIdList.size() > 0">
|
|
|
+ left join sys_dept_csm dc on dc.dept_id = a.dept_id
|
|
|
+ </if>
|
|
|
+ <where>
|
|
|
+ AND d.dept_id IS NOT NULL
|
|
|
+ AND (d.level = 3 OR d.level = 4 OR d.level = 5)
|
|
|
+ <if test="query.gsmc != null and query.gsmc !=''">
|
|
|
+ AND gsmc LIKE CONCAT('%',#{query.gsmc},'%')
|
|
|
+ </if>
|
|
|
+ <if test="query.zjNumber != null and query.zjNumber !=''">
|
|
|
+ AND zj_number LIKE CONCAT('%',#{query.zjNumber},'%')
|
|
|
+ </if>
|
|
|
+ <if test="query.pgqx != null and query.pgqx!=''">
|
|
|
+ AND pgqx = #{query.pgqx,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="query.updateTime != null and query.updateTime !=''">
|
|
|
+ AND update_time = #{query.updateTime,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="query.createTime != null and query.createTime!='' ">
|
|
|
+ AND create_time = #{query.createTime,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="query.yyzz != null and query.yyzz!='' ">
|
|
|
+ AND yyzz = #{query.yyzz,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="query.sbjnzm != null and query.sbjnzm!='' ">
|
|
|
+ AND sbjnzm = #{query.sbjnzm,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="query.frsfzzmZm != null and query.frsfzzmZm!='' ">
|
|
|
+ AND frsfzzm_zm = #{query.frsfzzmZm,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="query.frsfzzmBm != null and query.frsfzzmBm!='' ">
|
|
|
+ AND frsfzzm_bm = #{query.frsfzzmBm,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="query.frsfzzmSc != null and query.frsfzzmSc!=''">
|
|
|
+ AND frsfzzm_sc = #{query.frsfzzmSc,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="query.extDrugEnt != null and query.extDrugEnt!=''">
|
|
|
+ AND ext_drug_ent = #{query.extDrugEnt,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="query.qylx != null and query.qylx!=''">
|
|
|
+ AND qylx = #{query.qylx,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="query.csmUserIdList != null and query.csmUserIdList.size() > 0">
|
|
|
+ and dc.user_id in (
|
|
|
+ <foreach collection="query.csmUserIdList" item="userId" index="index" separator=",">
|
|
|
+ #{userId}
|
|
|
+ </foreach>
|
|
|
)
|
|
|
- values (#{gsmc,jdbcType=VARCHAR}, #{yyzz,jdbcType=VARCHAR},
|
|
|
- #{sbjnzm,jdbcType=VARCHAR}, #{frsfzzmZm,jdbcType=VARCHAR}, #{frsfzzmBm,jdbcType=VARCHAR},
|
|
|
- #{frsfzzmSc,jdbcType=VARCHAR}, #{zjType,jdbcType=VARCHAR}, #{zjNumber,jdbcType=VARCHAR},
|
|
|
- #{jsAccount,jdbcType=VARCHAR}, #{isExamine,jdbcType=VARCHAR}, #{extDrugEnt,jdbcType=VARCHAR},
|
|
|
- #{temp1,jdbcType=VARCHAR}, #{temp2,jdbcType=VARCHAR}, #{deptId},
|
|
|
- #{delFlag,jdbcType=VARCHAR}, #{enableFlag,jdbcType=VARCHAR},
|
|
|
- #{tenantId,jdbcType=BIGINT},#{createTime,jdbcType=VARCHAR},
|
|
|
- #{createUser,jdbcType=BIGINT}, #{updateTime,jdbcType=VARCHAR}, #{updateUser,jdbcType=VARCHAR},
|
|
|
- #{drugEntId,jdbcType=VARCHAR}, #{pgqx,jdbcType=VARCHAR}, #{qylx,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="query.entIds != null and query.entIds.size() > 0">
|
|
|
+ and d.dept_id in (
|
|
|
+ <foreach collection="query.entIds" item="entId" index="index" separator=",">
|
|
|
+ #{entId}
|
|
|
+ </foreach>
|
|
|
)
|
|
|
- </insert>
|
|
|
-
|
|
|
- <!-- 分页查询派工企业 -->
|
|
|
- <select id="selectWmManagementPage" resultMap="wmDaAgentMap">
|
|
|
- SELECT distinct
|
|
|
- a.*, d.dept_permissions, d.level as dept_level, d.financial_review_type
|
|
|
- FROM wm_da_agent a
|
|
|
- LEFT JOIN sys_dept d ON d.dept_id = a.dept_id
|
|
|
- <if test="query.csmUserIdList != null and query.csmUserIdList.size() > 0">
|
|
|
- left join sys_dept_csm dc on dc.dept_id = a.dept_id
|
|
|
- </if>
|
|
|
- <where>
|
|
|
- AND d.dept_id IS NOT NULL
|
|
|
- AND (d.level = 3 OR d.level = 4 OR d.level = 5)
|
|
|
- <if test="query.gsmc != null and query.gsmc !=''">
|
|
|
- AND gsmc LIKE CONCAT('%',#{query.gsmc},'%')
|
|
|
- </if>
|
|
|
- <if test="query.zjNumber != null and query.zjNumber !=''">
|
|
|
- AND zj_number LIKE CONCAT('%',#{query.zjNumber},'%')
|
|
|
- </if>
|
|
|
- <if test="query.pgqx != null and query.pgqx!=''">
|
|
|
- AND pgqx = #{query.pgqx,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="query.updateTime != null and query.updateTime !=''">
|
|
|
- AND update_time = #{query.updateTime,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="query.createTime != null and query.createTime!='' ">
|
|
|
- AND create_time = #{query.createTime,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="query.yyzz != null and query.yyzz!='' ">
|
|
|
- AND yyzz = #{query.yyzz,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="query.sbjnzm != null and query.sbjnzm!='' ">
|
|
|
- AND sbjnzm = #{query.sbjnzm,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="query.frsfzzmZm != null and query.frsfzzmZm!='' ">
|
|
|
- AND frsfzzm_zm = #{query.frsfzzmZm,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="query.frsfzzmBm != null and query.frsfzzmBm!='' ">
|
|
|
- AND frsfzzm_bm = #{query.frsfzzmBm,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="query.frsfzzmSc != null and query.frsfzzmSc!=''">
|
|
|
- AND frsfzzm_sc = #{query.frsfzzmSc,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="query.extDrugEnt != null and query.extDrugEnt!=''">
|
|
|
- AND ext_drug_ent = #{query.extDrugEnt,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="query.qylx != null and query.qylx!=''">
|
|
|
- AND qylx = #{query.qylx,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="query.csmUserIdList != null and query.csmUserIdList.size() > 0">
|
|
|
- and dc.user_id in (
|
|
|
- <foreach collection="query.csmUserIdList" item="userId" index="index" separator=",">
|
|
|
- #{userId}
|
|
|
- </foreach>
|
|
|
- )
|
|
|
- </if>
|
|
|
- <if test="query.entIds != null and query.entIds.size() > 0">
|
|
|
- and d.dept_id in (
|
|
|
- <foreach collection="query.entIds" item="entId" index="index" separator=",">
|
|
|
- #{entId}
|
|
|
- </foreach>
|
|
|
- )
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- ORDER BY id DESC
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectWmManagementList" resultMap="wmDaAgentMap">
|
|
|
- select
|
|
|
- *
|
|
|
- from wm_da_agent where 1=1
|
|
|
- <if test="query.gsmc != null and query.gsmc !=''">
|
|
|
- AND gsmc like CONCAT('%',#{query.gsmc},'%')
|
|
|
- </if>
|
|
|
- <if test="query.zjNumber != null and query.zjNumber !=''">
|
|
|
- AND zj_number like CONCAT('%',#{query.zjNumber},'%')
|
|
|
- </if>
|
|
|
- <if test="query.pgqx != null and query.pgqx!=''">
|
|
|
- AND pgqx = #{query.pgqx,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="query.updateTime != null and query.updateTime !=''">
|
|
|
- AND update_time = #{query.updateTime,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="query.createTime != null and query.createTime!='' ">
|
|
|
- AND create_time = #{query.createTime,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="query.yyzz != null and query.yyzz!='' ">
|
|
|
- AND yyzz = #{query.yyzz,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="query.sbjnzm != null and query.sbjnzm!='' ">
|
|
|
- AND sbjnzm = #{query.sbjnzm,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="query.frsfzzmZm != null and query.frsfzzmZm!='' ">
|
|
|
- AND frsfzzm_zm = #{query.frsfzzmZm,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="query.frsfzzmBm != null and query.frsfzzmBm!='' ">
|
|
|
- AND frsfzzm_bm = #{query.frsfzzmBm,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="query.frsfzzmSc != null and query.frsfzzmSc!=''">
|
|
|
- AND frsfzzm_sc = #{query.frsfzzmSc,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="query.extDrugEnt != null and query.extDrugEnt!=''">
|
|
|
- AND ext_drug_ent = #{query.extDrugEnt,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- <if test="query.qylx != null and query.qylx!=''">
|
|
|
- AND qylx = #{query.qylx,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- order by id desc
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectExtDrugEntList" resultMap="wmDaAgentMap">
|
|
|
- select
|
|
|
- ext_drug_ent
|
|
|
- from wm_da_agent
|
|
|
- where
|
|
|
- gsmc = #{query.gsmc,jdbcType=VARCHAR}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectByGsmcList" resultMap="wmDaAgentMap">
|
|
|
- select
|
|
|
- *
|
|
|
- from wm_da_agent
|
|
|
- where
|
|
|
- gsmc = #{query.gsmc,jdbcType=VARCHAR}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectByGsmc" resultMap="wmDaAgentMap">
|
|
|
- select
|
|
|
- *
|
|
|
- from wm_da_agent
|
|
|
- where
|
|
|
- gsmc = #{query.gsmc,jdbcType=VARCHAR}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectDeptId" resultMap="wmDaAgentMap">
|
|
|
- select
|
|
|
- a.*,
|
|
|
- d.level as dept_level,
|
|
|
- d.dept_permissions
|
|
|
- from wm_da_agent a
|
|
|
- left join sys_dept d on a.dept_id = d.dept_id
|
|
|
- where
|
|
|
- a.dept_id = #{deptId}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectDeptByIds" resultMap="wmDaAgentMap">
|
|
|
- select
|
|
|
- a.*,
|
|
|
- d.level as dept_level,
|
|
|
- d.dept_permissions
|
|
|
- from wm_da_agent a
|
|
|
- left join sys_dept d on a.dept_id = d.dept_id
|
|
|
- <where>
|
|
|
- a.dept_id in
|
|
|
- <foreach collection="deptIds" item="id" open="(" separator="," close=")">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
- <if test="entName != null">
|
|
|
- and a.dept_name like concat('%', #{entName} ,'%')
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectDeptId1" resultType="map">
|
|
|
- select
|
|
|
- id,
|
|
|
- gsmc as name
|
|
|
- from wm_da_agent
|
|
|
- where
|
|
|
- dept_id = #{deptId}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectExtDrugEnt" resultMap="wmDaAgentMap">
|
|
|
- select
|
|
|
- *
|
|
|
- from wm_da_agent
|
|
|
- where
|
|
|
- ext_drug_ent = #{extDrugEnt,jdbcType=VARCHAR}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectByDeptId" resultMap="wmDaAgentMap">
|
|
|
- select
|
|
|
- *
|
|
|
- from wm_da_agent
|
|
|
- where dept_id = #{deptId}
|
|
|
- </select>
|
|
|
-
|
|
|
-
|
|
|
- <select id="selectByDeptIds" resultMap="wmDaAgentMap" parameterType="java.lang.Integer">
|
|
|
- select
|
|
|
- *
|
|
|
- from wm_da_agent
|
|
|
- where dept_id = #{deptId}
|
|
|
- </select>
|
|
|
-
|
|
|
-
|
|
|
- <select id="selectByDrugIds" resultMap="wmDaAgentMap" parameterType="java.util.HashMap">
|
|
|
- select d.*
|
|
|
- from wm_da_agent d
|
|
|
- left join wm_relation r on r.down_id=d.id
|
|
|
- where r.up_id = #{upId,jdbcType=INTEGER}
|
|
|
- UNION
|
|
|
- select * from wm_da_agent where id= #{Id,jdbcType=INTEGER}
|
|
|
-
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectByDrugId" resultMap="wmDaAgentMap" parameterType="java.util.HashMap">
|
|
|
- select d.id,d.gsmc
|
|
|
- from wm_da_agent d
|
|
|
- left join wm_relation r on r.down_id=d.id
|
|
|
- left join wm_da_drug_ent o on r.up_id=o.id
|
|
|
- where r.up_id = #{upId,jdbcType=INTEGER}
|
|
|
- UNION
|
|
|
- select id,entname from wm_da_drug_ent where id= #{Id,jdbcType=INTEGER}
|
|
|
-
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectByRelationId" resultMap="wmDaAgentMap" parameterType="java.lang.Integer">
|
|
|
- select *
|
|
|
- from
|
|
|
- wm_da_agent
|
|
|
- where id= #{Id,jdbcType=INTEGER}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectByRelationIds" resultMap="wmDaAgentMap" parameterType="java.util.HashMap">
|
|
|
- select d.*
|
|
|
- from wm_da_agent d
|
|
|
- left join wm_relation r on r.down_id=d.dept_id
|
|
|
- where r.up_id = #{upId,jdbcType=INTEGER}
|
|
|
-
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectEntNameByDrugIds" resultMap="wmDaAgentMap" parameterType="java.util.HashMap">
|
|
|
- select d.id,d.entname
|
|
|
- from wm_da_drug_ent d
|
|
|
- left join wm_relation r on r.down_id=d.id
|
|
|
- left join wm_da_drug_ent o on r.up_id=o.id
|
|
|
- where r.up_id = #{upId,jdbcType=INTEGER}
|
|
|
- UNION
|
|
|
- select id,gsmc from wm_da_agent where id= #{Id,jdbcType=INTEGER}
|
|
|
-
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectByUserDeptId" resultMap="wmDaAgentMap" parameterType="java.lang.Integer">
|
|
|
- select
|
|
|
- *
|
|
|
- from wm_da_agent
|
|
|
- where dept_id = #{deptId}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectWmDaDrugEntByDeptIds" resultMap="wmDaAgentMap" parameterType="java.util.HashMap">
|
|
|
- select d.*
|
|
|
- from wm_da_agent d
|
|
|
- left join wm_relation r on r.down_id=d.dept_id
|
|
|
- where r.up_id = #{upId,jdbcType=INTEGER}
|
|
|
- UNION
|
|
|
- select * from wm_da_agent where dept_id= #{deptId}
|
|
|
-
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectWmDaDrugEntByDeptId" resultMap="wmDaAgentMap" parameterType="java.util.HashMap">
|
|
|
-
|
|
|
- select d.id,d.dept_id, d.gsmc
|
|
|
- from wm_da_agent d
|
|
|
- left join wm_relation r on r.down_id=d.dept_id
|
|
|
- left join wm_da_drug_ent o on r.up_id=o.dept_id
|
|
|
- where r.up_id = #{upId,jdbcType=INTEGER}
|
|
|
- UNION
|
|
|
- select id,dept_id,entname from wm_da_drug_ent where dept_id= #{deptId,jdbcType=INTEGER}
|
|
|
-
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectWmDaAgentByRelationId" resultMap="wmDaAgentMap" parameterType="java.lang.Integer">
|
|
|
- select *
|
|
|
- from
|
|
|
- wm_da_agent
|
|
|
- where dept_id= #{deptId,jdbcType=INTEGER}
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectWmDaAgentByRelationIds" resultMap="wmDaAgentMap" parameterType="java.util.HashMap">
|
|
|
- select d.*
|
|
|
- from wm_da_agent d
|
|
|
- left join wm_relation r on r.down_id=d.dept_id
|
|
|
- where r.up_id = #{upId,jdbcType=INTEGER}
|
|
|
-
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectWmDaAgentByDeptId" resultMap="wmDaAgentMap" parameterType="java.util.HashMap">
|
|
|
- select d.id,
|
|
|
- d.gsmc,
|
|
|
- d.dept_id,
|
|
|
- d.enable_flag
|
|
|
- from wm_da_agent d
|
|
|
- left join wm_relation r on r.down_id=d.dept_id
|
|
|
- left join wm_da_drug_ent o on r.up_id=o.dept_id
|
|
|
- where r.up_id = #{upId,jdbcType=INTEGER}
|
|
|
- UNION
|
|
|
- select id,entname,dept_id,enable_flag from wm_da_drug_ent where dept_id= #{deptId,jdbcType=INTEGER}
|
|
|
-
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectWmDaAgentByDeptIds" resultMap="wmDaAgentMap" parameterType="java.lang.String">
|
|
|
- select *
|
|
|
- from
|
|
|
- wm_da_agent
|
|
|
- where dept_id= #{deptId}
|
|
|
- </select>
|
|
|
-
|
|
|
- <!-- 根据sys_dept表的level字段查询 -->
|
|
|
- <select id="listAgentByDeptLevel" resultMap="wmDaAgentMap">
|
|
|
- SELECT a.*
|
|
|
- FROM wm_da_agent a
|
|
|
- LEFT JOIN sys_dept d ON d.dept_id = a.dept_id
|
|
|
- WHERE a.del_flag = 0
|
|
|
- AND a.enable_flag = 0
|
|
|
- AND d.level = #{deptLevel}
|
|
|
- </select>
|
|
|
-
|
|
|
- <!-- 根据deptRelation查询 -->
|
|
|
- <select id="listAgentByDeptRelation" resultMap="wmDaAgentMap">
|
|
|
- SELECT
|
|
|
- *
|
|
|
- FROM
|
|
|
- wm_da_agent a
|
|
|
- LEFT JOIN sys_dept_relation r ON r.descendant = a.dept_id
|
|
|
- WHERE
|
|
|
- r.ancestor = #{deptId, jdbcType=INTEGER}
|
|
|
- </select>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ORDER BY id DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectWmManagementList" resultMap="wmDaAgentMap">
|
|
|
+ select
|
|
|
+ *
|
|
|
+ from wm_da_agent where 1=1
|
|
|
+ <if test="query.gsmc != null and query.gsmc !=''">
|
|
|
+ AND gsmc like CONCAT('%',#{query.gsmc},'%')
|
|
|
+ </if>
|
|
|
+ <if test="query.zjNumber != null and query.zjNumber !=''">
|
|
|
+ AND zj_number like CONCAT('%',#{query.zjNumber},'%')
|
|
|
+ </if>
|
|
|
+ <if test="query.pgqx != null and query.pgqx!=''">
|
|
|
+ AND pgqx = #{query.pgqx,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="query.updateTime != null and query.updateTime !=''">
|
|
|
+ AND update_time = #{query.updateTime,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="query.createTime != null and query.createTime!='' ">
|
|
|
+ AND create_time = #{query.createTime,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="query.yyzz != null and query.yyzz!='' ">
|
|
|
+ AND yyzz = #{query.yyzz,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="query.sbjnzm != null and query.sbjnzm!='' ">
|
|
|
+ AND sbjnzm = #{query.sbjnzm,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="query.frsfzzmZm != null and query.frsfzzmZm!='' ">
|
|
|
+ AND frsfzzm_zm = #{query.frsfzzmZm,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="query.frsfzzmBm != null and query.frsfzzmBm!='' ">
|
|
|
+ AND frsfzzm_bm = #{query.frsfzzmBm,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="query.frsfzzmSc != null and query.frsfzzmSc!=''">
|
|
|
+ AND frsfzzm_sc = #{query.frsfzzmSc,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="query.extDrugEnt != null and query.extDrugEnt!=''">
|
|
|
+ AND ext_drug_ent = #{query.extDrugEnt,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="query.qylx != null and query.qylx!=''">
|
|
|
+ AND qylx = #{query.qylx,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ order by id desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectExtDrugEntList" resultMap="wmDaAgentMap">
|
|
|
+ SELECT ext_drug_ent
|
|
|
+ FROM wm_da_agent
|
|
|
+ WHERE gsmc = #{query.gsmc,jdbcType=VARCHAR}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectByGsmcList" resultMap="wmDaAgentMap">
|
|
|
+ SELECT *
|
|
|
+ FROM wm_da_agent
|
|
|
+ WHERE gsmc = #{query.gsmc,jdbcType=VARCHAR}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectByGsmc" resultMap="wmDaAgentMap">
|
|
|
+ SELECT *
|
|
|
+ FROM wm_da_agent
|
|
|
+ WHERE gsmc = #{query.gsmc,jdbcType=VARCHAR}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectDeptId" resultMap="wmDaAgentMap">
|
|
|
+ SELECT a.*,
|
|
|
+ d.level AS dept_level,
|
|
|
+ d.dept_permissions
|
|
|
+ FROM wm_da_agent a
|
|
|
+ LEFT JOIN sys_dept d ON a.dept_id = d.dept_id
|
|
|
+ WHERE a.dept_id = #{deptId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectDeptByIds" resultMap="wmDaAgentMap">
|
|
|
+ select
|
|
|
+ a.*,
|
|
|
+ d.level as dept_level,
|
|
|
+ d.dept_permissions
|
|
|
+ from wm_da_agent a
|
|
|
+ left join sys_dept d on a.dept_id = d.dept_id
|
|
|
+ <where>
|
|
|
+ a.dept_id in
|
|
|
+ <foreach collection="deptIds" item="id" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ <if test="entName != null">
|
|
|
+ and a.dept_name like concat('%', #{entName} ,'%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectDeptId1" resultType="map">
|
|
|
+ SELECT id,
|
|
|
+ gsmc AS name
|
|
|
+ FROM wm_da_agent
|
|
|
+ WHERE dept_id = #{deptId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectExtDrugEnt" resultMap="wmDaAgentMap">
|
|
|
+ SELECT *
|
|
|
+ FROM wm_da_agent
|
|
|
+ WHERE ext_drug_ent = #{extDrugEnt,jdbcType=VARCHAR}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectByDeptId" resultMap="wmDaAgentMap">
|
|
|
+ SELECT *
|
|
|
+ FROM wm_da_agent
|
|
|
+ WHERE dept_id = #{deptId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="selectByDeptIds" resultMap="wmDaAgentMap" parameterType="java.lang.Integer">
|
|
|
+ SELECT *
|
|
|
+ FROM wm_da_agent
|
|
|
+ WHERE dept_id = #{deptId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="selectByDrugIds" resultMap="wmDaAgentMap" parameterType="java.util.HashMap">
|
|
|
+ SELECT d.*
|
|
|
+ FROM wm_da_agent d
|
|
|
+ LEFT JOIN wm_relation r ON r.down_id = d.id
|
|
|
+ WHERE r.up_id = #{upId,jdbcType=INTEGER}
|
|
|
+ UNION
|
|
|
+ SELECT *
|
|
|
+ FROM wm_da_agent
|
|
|
+ WHERE id = #{Id,jdbcType=INTEGER}
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectByDrugId" resultMap="wmDaAgentMap" parameterType="java.util.HashMap">
|
|
|
+ SELECT d.id, d.gsmc
|
|
|
+ FROM wm_da_agent d
|
|
|
+ LEFT JOIN wm_relation r ON r.down_id = d.id
|
|
|
+ LEFT JOIN wm_da_drug_ent o ON r.up_id = o.id
|
|
|
+ WHERE r.up_id = #{upId,jdbcType=INTEGER}
|
|
|
+ UNION
|
|
|
+ SELECT id, entname
|
|
|
+ FROM wm_da_drug_ent
|
|
|
+ WHERE id = #{Id,jdbcType=INTEGER}
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectByRelationId" resultMap="wmDaAgentMap" parameterType="java.lang.Integer">
|
|
|
+ SELECT *
|
|
|
+ FROM wm_da_agent
|
|
|
+ WHERE id = #{Id,jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectByRelationIds" resultMap="wmDaAgentMap" parameterType="java.util.HashMap">
|
|
|
+ SELECT d.*
|
|
|
+ FROM wm_da_agent d
|
|
|
+ LEFT JOIN wm_relation r ON r.down_id = d.dept_id
|
|
|
+ WHERE r.up_id = #{upId,jdbcType=INTEGER}
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectEntNameByDrugIds" resultMap="wmDaAgentMap" parameterType="java.util.HashMap">
|
|
|
+ SELECT d.id, d.entname
|
|
|
+ FROM wm_da_drug_ent d
|
|
|
+ LEFT JOIN wm_relation r ON r.down_id = d.id
|
|
|
+ LEFT JOIN wm_da_drug_ent o ON r.up_id = o.id
|
|
|
+ WHERE r.up_id = #{upId,jdbcType=INTEGER}
|
|
|
+ UNION
|
|
|
+ SELECT id, gsmc
|
|
|
+ FROM wm_da_agent
|
|
|
+ WHERE id = #{Id,jdbcType=INTEGER}
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectByUserDeptId" resultMap="wmDaAgentMap" parameterType="java.lang.Integer">
|
|
|
+ SELECT *
|
|
|
+ FROM wm_da_agent
|
|
|
+ WHERE dept_id = #{deptId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectWmDaDrugEntByDeptIds" resultMap="wmDaAgentMap" parameterType="java.util.HashMap">
|
|
|
+ SELECT d.*
|
|
|
+ FROM wm_da_agent d
|
|
|
+ LEFT JOIN wm_relation r ON r.down_id = d.dept_id
|
|
|
+ WHERE r.up_id = #{upId,jdbcType=INTEGER}
|
|
|
+ UNION
|
|
|
+ SELECT *
|
|
|
+ FROM wm_da_agent
|
|
|
+ WHERE dept_id = #{deptId}
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectWmDaDrugEntByDeptId" resultMap="wmDaAgentMap" parameterType="java.util.HashMap">
|
|
|
+
|
|
|
+ SELECT d.id, d.dept_id, d.gsmc
|
|
|
+ FROM wm_da_agent d
|
|
|
+ LEFT JOIN wm_relation r ON r.down_id = d.dept_id
|
|
|
+ LEFT JOIN wm_da_drug_ent o ON r.up_id = o.dept_id
|
|
|
+ WHERE r.up_id = #{upId,jdbcType=INTEGER}
|
|
|
+ UNION
|
|
|
+ SELECT id, dept_id, entname
|
|
|
+ FROM wm_da_drug_ent
|
|
|
+ WHERE dept_id = #{deptId,jdbcType=INTEGER}
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectWmDaAgentByRelationId" resultMap="wmDaAgentMap" parameterType="java.lang.Integer">
|
|
|
+ SELECT *
|
|
|
+ FROM wm_da_agent
|
|
|
+ WHERE dept_id = #{deptId,jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectWmDaAgentByRelationIds" resultMap="wmDaAgentMap" parameterType="java.util.HashMap">
|
|
|
+ SELECT d.*
|
|
|
+ FROM wm_da_agent d
|
|
|
+ LEFT JOIN wm_relation r ON r.down_id = d.dept_id
|
|
|
+ WHERE r.up_id = #{upId,jdbcType=INTEGER}
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectWmDaAgentByDeptId" resultMap="wmDaAgentMap" parameterType="java.util.HashMap">
|
|
|
+ SELECT d.id,
|
|
|
+ d.gsmc,
|
|
|
+ d.dept_id,
|
|
|
+ d.enable_flag
|
|
|
+ FROM wm_da_agent d
|
|
|
+ LEFT JOIN wm_relation r ON r.down_id = d.dept_id
|
|
|
+ LEFT JOIN wm_da_drug_ent o ON r.up_id = o.dept_id
|
|
|
+ WHERE r.up_id = #{upId,jdbcType=INTEGER}
|
|
|
+ UNION
|
|
|
+ SELECT id, entname, dept_id, enable_flag
|
|
|
+ FROM wm_da_drug_ent
|
|
|
+ WHERE dept_id = #{deptId,jdbcType=INTEGER}
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectWmDaAgentByDeptIds" resultMap="wmDaAgentMap" parameterType="java.lang.String">
|
|
|
+ SELECT *
|
|
|
+ FROM wm_da_agent
|
|
|
+ WHERE dept_id = #{deptId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 根据sys_dept表的level字段查询 -->
|
|
|
+ <select id="listAgentByDeptLevel" resultMap="wmDaAgentMap">
|
|
|
+ SELECT a.*
|
|
|
+ FROM wm_da_agent a
|
|
|
+ LEFT JOIN sys_dept d ON d.dept_id = a.dept_id
|
|
|
+ WHERE a.del_flag = 0
|
|
|
+ AND a.enable_flag = 0
|
|
|
+ AND d.level = #{deptLevel}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 根据deptRelation查询 -->
|
|
|
+ <select id="listAgentByDeptRelation" resultMap="wmDaAgentMap">
|
|
|
+ SELECT *
|
|
|
+ FROM wm_da_agent a
|
|
|
+ LEFT JOIN sys_dept_relation r ON r.descendant = a.dept_id
|
|
|
+ WHERE r.ancestor = #{deptId, jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|