|
|
@@ -996,10 +996,10 @@
|
|
|
AND tms.flgValid
|
|
|
</if>
|
|
|
<if test="objCode != null and objCode != ''">
|
|
|
- AND tms.sup_code LIKE concat('%', #{objCode}, '%')
|
|
|
+ AND tms.sup_code LIKE concat('%',my_ex.likequery(#{objCode}),'%')
|
|
|
</if>
|
|
|
<if test="objName != null and objName != ''">
|
|
|
- AND tms.sup_name LIKE concat('%', #{objName}, '%')
|
|
|
+ AND tms.sup_name LIKE concat('%',my_ex.likequery(#{objCode}),'%')
|
|
|
</if>
|
|
|
</where>
|
|
|
union all
|
|
|
@@ -1013,18 +1013,15 @@
|
|
|
cus.address_full as "addressFull"
|
|
|
from dkic_b.t_mst_customer cus
|
|
|
<where>
|
|
|
- <if test="flgValid">
|
|
|
- AND cus.flgValid
|
|
|
- </if>
|
|
|
- <if test="objCode != null and objCode != ''">
|
|
|
- AND cus.cus_code LIKE concat('%', #{objCode}, '%')
|
|
|
- </if>
|
|
|
- <if test="objName != null and objName != ''">
|
|
|
- AND cus.cus_name LIKE concat('%', #{objName}, '%')
|
|
|
- </if>
|
|
|
- <if test="flgValid">
|
|
|
- AND cus.flgValid
|
|
|
- </if>
|
|
|
+ <if test="flgValid">
|
|
|
+ AND cus.flgValid
|
|
|
+ </if>
|
|
|
+ <if test="objCode != null and objCode != ''">
|
|
|
+ AND cus.cus_code LIKE concat('%',my_ex.likequery(#{objCode}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="objName != null and objName != ''">
|
|
|
+ AND cus.cus_name LIKE concat('%',my_ex.likequery(#{objName}),'%')
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
<!--获取供应商和客户数据分页-->
|
|
|
@@ -1040,15 +1037,15 @@
|
|
|
null as "addressFull"
|
|
|
from dkic_b.t_mst_supplier tms
|
|
|
<where >
|
|
|
- <if test="flgValid">
|
|
|
- AND tms.flgValid
|
|
|
- </if>
|
|
|
- <if test="objCode != null and objCode != ''">
|
|
|
- AND tms.sup_code LIKE concat('%', #{objCode}, '%')
|
|
|
- </if>
|
|
|
- <if test="objName != null and objName != ''">
|
|
|
- AND tms.sup_name LIKE concat('%', #{objName}, '%')
|
|
|
- </if>
|
|
|
+ <if test="flgValid">
|
|
|
+ AND tms.flgValid
|
|
|
+ </if>
|
|
|
+ <if test="objCode != null and objCode != ''">
|
|
|
+ AND tms.sup_code LIKE concat('%',my_ex.likequery(#{objCode}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="objName != null and objName != ''">
|
|
|
+ AND tms.sup_name LIKE concat('%',my_ex.likequery(#{objCode}),'%')
|
|
|
+ </if>
|
|
|
</where>
|
|
|
union all
|
|
|
select cus.cus_id as "objId",
|
|
|
@@ -1061,18 +1058,18 @@
|
|
|
cus.address_full as "addressFull"
|
|
|
from dkic_b.t_mst_customer cus
|
|
|
<where>
|
|
|
- <if test="flgValid">
|
|
|
- AND cus.flgValid
|
|
|
- </if>
|
|
|
- <if test="objCode != null and objCode != ''">
|
|
|
- AND cus.cus_code LIKE concat('%', #{objCode}, '%')
|
|
|
- </if>
|
|
|
- <if test="objName != null and objName != ''">
|
|
|
- AND cus.cus_name LIKE concat('%', #{objName}, '%')
|
|
|
- </if>
|
|
|
- <if test="flgValid">
|
|
|
- AND cus.flgValid
|
|
|
- </if>
|
|
|
+ <if test="flgValid">
|
|
|
+ AND cus.flgValid
|
|
|
+ </if>
|
|
|
+ <if test="objCode != null and objCode != ''">
|
|
|
+ AND cus.cus_code LIKE concat('%',my_ex.likequery(#{objCode}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="objName != null and objName != ''">
|
|
|
+ AND cus.cus_name LIKE concat('%',my_ex.likequery(#{objName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="flgValid">
|
|
|
+ AND cus.flgValid
|
|
|
+ </if>
|
|
|
</where>
|
|
|
) tt
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
@@ -1096,10 +1093,10 @@
|
|
|
AND tms.flgValid
|
|
|
</if>
|
|
|
<if test="objCode != null and objCode != ''">
|
|
|
- AND tms.sup_code LIKE concat('%', #{objCode}, '%')
|
|
|
+ AND tms.sup_code LIKE concat('%',my_ex.likequery(#{objCode}),'%')
|
|
|
</if>
|
|
|
<if test="objName != null and objName != ''">
|
|
|
- AND tms.sup_name LIKE concat('%', #{objName}, '%')
|
|
|
+ AND tms.sup_name LIKE concat('%',my_ex.likequery(#{objCode}),'%')
|
|
|
</if>
|
|
|
</where>
|
|
|
union all
|
|
|
@@ -1117,16 +1114,143 @@
|
|
|
AND cus.flgValid
|
|
|
</if>
|
|
|
<if test="objCode != null and objCode != ''">
|
|
|
- AND cus.cus_code LIKE concat('%', #{objCode}, '%')
|
|
|
+ AND cus.cus_code LIKE concat('%',my_ex.likequery(#{objCode}),'%')
|
|
|
</if>
|
|
|
<if test="objName != null and objName != ''">
|
|
|
- AND cus.cus_name LIKE concat('%', #{objName}, '%')
|
|
|
- </if>
|
|
|
- <if test="flgValid">
|
|
|
- AND cus.flgValid
|
|
|
+ AND cus.cus_name LIKE concat('%',my_ex.likequery(#{objName}),'%')
|
|
|
</if>
|
|
|
</where>
|
|
|
) tt
|
|
|
</select>
|
|
|
|
|
|
+
|
|
|
+ <!-- 获取用户 -->
|
|
|
+ <select id="getUser" resultType="java.util.Map">
|
|
|
+ select u.user_name as "userName"
|
|
|
+ , u.user_code as "userCode"
|
|
|
+ , u.user_id as "userId"
|
|
|
+ , u.org_id as "orgId"
|
|
|
+ , o.org_name as "orgName"
|
|
|
+ , c.cp_name as "cpName"
|
|
|
+ from core.t_dk_user u
|
|
|
+ left join dkic_b.t_mst_org o on o.org_id = u.org_id
|
|
|
+ left join dkic_a.t_a_company c on c.cp_id = o.sale2_id
|
|
|
+ where
|
|
|
+ u.cp_id = #{cpId}
|
|
|
+ <if test="userCode !=null and userCode !=''">
|
|
|
+ AND u.user_code LIKE concat('%',my_ex.likequery(#{userCode}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="userName !=null and userName !=''">
|
|
|
+ AND u.user_name LIKE concat('%',my_ex.likequery(#{userName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="orgId !=null">
|
|
|
+ AND u.org_id = #{orgId}
|
|
|
+ </if>
|
|
|
+ <if test="orgName !=null and orgName !=''">
|
|
|
+ AND o.org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 获取用户分页 -->
|
|
|
+ <select id="getUserByPage" resultType="java.util.Map">
|
|
|
+ select u.user_name as "userName"
|
|
|
+ , u.user_code as "userCode"
|
|
|
+ , u.user_id as "userId"
|
|
|
+ , u.org_id as "orgId"
|
|
|
+ , o.org_name as "orgName"
|
|
|
+ , c.cp_name as "cpName"
|
|
|
+ from core.t_dk_user u
|
|
|
+ left join dkic_b.t_mst_org o on o.org_id = u.org_id
|
|
|
+ left join dkic_a.t_a_company c on c.cp_id = o.sale2_id
|
|
|
+ where
|
|
|
+ u.cp_id = #{cpId}
|
|
|
+ <if test="userCode !=null and userCode !=''">
|
|
|
+ AND u.user_code LIKE concat('%',my_ex.likequery(#{userCode}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="userName !=null and userName !=''">
|
|
|
+ AND u.user_name LIKE concat('%',my_ex.likequery(#{userName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="orgId !=null">
|
|
|
+ AND u.org_id = #{orgId}
|
|
|
+ </if>
|
|
|
+ <if test="orgName !=null and orgName !=''">
|
|
|
+ AND o.org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 获取用户分页个数-->
|
|
|
+ <select id="getUserCount" resultType="java.lang.Long">
|
|
|
+ select count(1)
|
|
|
+ from core.t_dk_user u
|
|
|
+ left join dkic_b.t_mst_org o on o.org_id = u.org_id
|
|
|
+ left join dkic_a.t_a_company c on c.cp_id = o.sale2_id
|
|
|
+ where
|
|
|
+ u.cp_id = #{cpId}
|
|
|
+ <if test="userCode !=null and userCode !=''">
|
|
|
+ AND u.user_code LIKE concat('%',my_ex.likequery(#{userCode}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="userName !=null and userName !=''">
|
|
|
+ AND u.user_name LIKE concat('%',my_ex.likequery(#{userName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="orgId !=null">
|
|
|
+ AND u.org_id = #{orgId}
|
|
|
+ </if>
|
|
|
+ <if test="orgName !=null and orgName !=''">
|
|
|
+ AND o.org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 获取组织机构 -->
|
|
|
+ <select id="getOrganization" resultType="java.util.Map">
|
|
|
+ select o.org_id as "orgId"
|
|
|
+ , o.org_code as "orgCode"
|
|
|
+ , o.org_name as "orgName"
|
|
|
+ from dkic_b.t_mst_org o
|
|
|
+ where
|
|
|
+ o.flg_valid
|
|
|
+ and o.cp_id = #{cpId}
|
|
|
+ <if test="orgCode !=null and orgCode !=''">
|
|
|
+ AND o.org_code LIKE concat('%',my_ex.likequery(#{orgCode}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="orgName !=null and orgName !=''">
|
|
|
+ AND o.org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
|
|
|
+ </if>
|
|
|
+ order by o.level_code
|
|
|
+ </select>
|
|
|
+ <!-- 获取组织机构分页 -->
|
|
|
+ <select id="getOrganizationByPage" resultType="java.util.Map">
|
|
|
+ select o.org_id as "orgId"
|
|
|
+ , o.org_code as "orgCode"
|
|
|
+ , o.org_name as "orgName"
|
|
|
+ from dkic_b.t_mst_org o
|
|
|
+ where
|
|
|
+ o.flg_valid
|
|
|
+ and o.cp_id = #{cpId}
|
|
|
+ <if test="orgCode !=null and orgCode !=''">
|
|
|
+ AND o.org_code LIKE concat('%',my_ex.likequery(#{orgCode}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="orgName !=null and orgName !=''">
|
|
|
+ AND o.org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
|
|
|
+ </if>
|
|
|
+ order by o.level_code
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
+ limit #{end} offset #{start}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <!-- 获取组织机构分个数-->
|
|
|
+ <select id="getOrganizationCount" resultType="java.lang.Long">
|
|
|
+ SELECT count(1)
|
|
|
+ from dkic_b.t_mst_org o
|
|
|
+ where
|
|
|
+ o.flg_valid
|
|
|
+ and o.cp_id = #{cpId}
|
|
|
+ <if test="orgCode !=null and orgCode !=''">
|
|
|
+ AND o.org_code LIKE concat('%',my_ex.likequery(#{orgCode}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="orgName !=null and orgName !=''">
|
|
|
+ AND o.org_name LIKE concat('%',my_ex.likequery(#{orgName}),'%')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|