|
|
@@ -14,8 +14,9 @@
|
|
|
msl.service_categories, msl.remarks, msl.flg_valid, msl.cp_id,
|
|
|
msl.op_create_time, msl.op_create_user_id, msl.op_update_time,
|
|
|
msl.op_update_user_id, msl.op_app_code, msl.op_timestamp,
|
|
|
- msl.op_db_user ,tmgb.brand_name
|
|
|
+ msl.op_db_user ,tmgb.brand_name,tmgb.brand_id
|
|
|
</sql>
|
|
|
+
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
<resultMap id="BaseResultMap" type="com.dk.mdm.model.pojo.mst.Supplier">
|
|
|
<id column="sup_id" property="supId"/>
|
|
|
@@ -26,12 +27,22 @@
|
|
|
<result column="contact_phone" property="contactPhone"/>
|
|
|
<result column="org_id" property="orgId" typeHandler="UuidTypeHandler"/>
|
|
|
<result column="staff_id" property="staffId" typeHandler="UuidTypeHandler"/>
|
|
|
- <result column="service_categories" property="serviceCategories"/>
|
|
|
+ <result column="service_categories" property="serviceCategories" typeHandler="StringListTypeHandler"/>
|
|
|
<result column="remarks" property="remarks"/>
|
|
|
<result column="flg_valid" property="flgValid"/>
|
|
|
<result column="cp_id" property="cpId"/>
|
|
|
<result column="brand_name" property="brandName"/>
|
|
|
+ <result column="brand_id" property="brandId"/>
|
|
|
+ <result column="staff_name" property="staffName"/>
|
|
|
+ <result column="org_name" property="orgName"/>
|
|
|
<result column="sum_residue" property="sumResidue"/>
|
|
|
+ <result column="op_create_time" property="opCreateTime" typeHandler="TimestampTypeHandler"/>
|
|
|
+ <result column="op_create_user_id" property="opCreateUserId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="op_update_time" property="opUpdateTime" typeHandler="TimestampTypeHandler"/>
|
|
|
+ <result column="op_update_user_id" property="opUpdateUserId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="op_app_code" property="opAppCode"/>
|
|
|
+ <result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
|
|
|
+ <result column="op_db_user" property="opDbUser"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<!-- 通用条件列 -->
|
|
|
@@ -149,6 +160,11 @@
|
|
|
<if test="opDbUser != null and opDbUser != ''">
|
|
|
AND msl.op_db_user = #{opDbUser}
|
|
|
</if>
|
|
|
+ <if test="searchText !=null">
|
|
|
+ AND ( msl.sup_name LIKE concat('%', #{searchText}, '%')
|
|
|
+ or msl.contact_name LIKE concat('%', #{searchText}, '%')
|
|
|
+ or msl.contact_phone LIKE concat('%', #{searchText}, '%'))
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
|
|
|
@@ -164,11 +180,15 @@
|
|
|
<select id="selectByCond" resultMap="BaseResultMap">
|
|
|
SELECT
|
|
|
<include refid="msl_Base_Column_List"/>
|
|
|
+ ,tms.staff_name
|
|
|
+ ,tmo.org_name
|
|
|
FROM dkic_b.t_mst_supplier msl
|
|
|
LEFT JOIN dkic_b.t_mst_supplier_brand mslb ON msl.sup_id = mslb.sup_id
|
|
|
LEFT JOIN dkic_b.t_mst_goods_brand tmgb ON tmgb.brand_id = mslb.brand_id
|
|
|
-
|
|
|
+ LEFT JOIN dkic_b.t_mst_staff tms ON tms.staff_id = msl.staff_id
|
|
|
+ LEFT JOIN dkic_b.t_mst_org tmo ON tmo.org_id = msl.org_id
|
|
|
<include refid="msl_Condition"/>
|
|
|
+ ORDER BY msl.op_create_time desc
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
limit #{end} offset #{start}
|
|
|
</if>
|
|
|
@@ -185,9 +205,15 @@
|
|
|
<!-- 根据主键查询表t_mst_supplier的一行数据 -->
|
|
|
<select id="selectById" resultMap="BaseResultMap">
|
|
|
SELECT
|
|
|
- <include refid="Base_Column_List"/>
|
|
|
- FROM t_mst_supplier
|
|
|
- WHERE sup_id = #{supId}::uuid
|
|
|
+ <include refid="msl_Base_Column_List"/>
|
|
|
+ ,tms.staff_name
|
|
|
+ ,tmo.org_name
|
|
|
+ FROM dkic_b.t_mst_supplier msl
|
|
|
+ LEFT JOIN dkic_b.t_mst_supplier_brand mslb ON msl.sup_id = mslb.sup_id
|
|
|
+ LEFT JOIN dkic_b.t_mst_goods_brand tmgb ON tmgb.brand_id = mslb.brand_id
|
|
|
+ LEFT JOIN dkic_b.t_mst_staff tms ON tms.staff_id = msl.staff_id
|
|
|
+ LEFT JOIN dkic_b.t_mst_org tmo ON tmo.org_id = msl.org_id
|
|
|
+ WHERE msl.sup_id = #{supId}::uuid
|
|
|
</select>
|
|
|
|
|
|
<!-- 根据主键锁定表t_mst_supplier的一行数据 -->
|
|
|
@@ -207,6 +233,13 @@
|
|
|
<include refid="idsForeach"/>
|
|
|
for update
|
|
|
</select>
|
|
|
+ <select id="selectUuid" resultType="java.lang.String">
|
|
|
+ select sys.f_uuid_seq()
|
|
|
+
|
|
|
+ </select>
|
|
|
+ <select id="selectSupCode" resultType="java.lang.String">
|
|
|
+ select dkic_b.f_create_code( #{cpId},#{supId}::uuid,'供应商')
|
|
|
+ </select>
|
|
|
|
|
|
<insert id="insertBatch">
|
|
|
insert into t_mst_supplier
|
|
|
@@ -244,4 +277,21 @@
|
|
|
)
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
+
|
|
|
+ <insert id="insertSupplierBrand">
|
|
|
+ insert into dkic_b.t_mst_supplier_brand
|
|
|
+ (
|
|
|
+ sup_id,
|
|
|
+ brand_id
|
|
|
+ )
|
|
|
+ values
|
|
|
+ (
|
|
|
+ #{supId}::uuid,
|
|
|
+ #{brandId}::uuid
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+ <delete id="batchDelete">
|
|
|
+ DELETE FROM dkic_b.t_mst_supplier_brand
|
|
|
+ WHERE sup_id = #{supId}::uuid;
|
|
|
+ </delete>
|
|
|
</mapper>
|