|
@@ -15,6 +15,11 @@
|
|
|
<result column="update_time_" property="updateTime" />
|
|
|
<result column="create_time_" property="createTime" />
|
|
|
</resultMap>
|
|
|
+
|
|
|
+ <resultMap type="com.ym.mec.biz.dal.dto.MusicGroupDeliveryRecordDto" id="MusicGroupDeliveryRecordDto" extends="MusicGroupDeliveryRecord">
|
|
|
+ <result column="address_name_" property="musicGroupShippingAddress" />
|
|
|
+ <result column="operator_name_" property="operatorUserName" />
|
|
|
+ </resultMap>
|
|
|
|
|
|
<!-- 根据主键查询一条记录 -->
|
|
|
<select id="get" resultMap="MusicGroupDeliveryRecord">
|
|
@@ -98,18 +103,46 @@
|
|
|
<include refid="global.limit" />
|
|
|
</select>
|
|
|
|
|
|
+ <!-- 分页查询 -->
|
|
|
+ <select id="queryPageList" resultMap="MusicGroupDeliveryRecordDto"
|
|
|
+ parameterType="map">
|
|
|
+ SELECT mgdr.*,u.real_name_ operator_name_,a.address_name_ FROM music_group_delivery_record mgdr
|
|
|
+ left join sys_user u on u.id_ = mgdr.operator_user_id_
|
|
|
+ left join
|
|
|
+ (
|
|
|
+ SELECT sa.*,concat(pa.name_,ca.name_,coa.name_,sa.detail_address_) address_name_ FROM music_group_shipping_address sa
|
|
|
+ left join sys_area pa on sa.region_province_id_ = pa.id_
|
|
|
+ left join sys_area ca on sa.region_city_id_ = ca.id_
|
|
|
+ left join sys_area coa on sa.region_county_id_ = coa.id_
|
|
|
+ where sa.del_flag_ = 0 and sa.music_group_id_ = #{musicGroupId}
|
|
|
+ ) a on a.id_ = mgdr.music_group_shipping_address_id_
|
|
|
+ <where>
|
|
|
+ <if test="musicGroupId != null and musicGroupId != ''">
|
|
|
+ and mgdr.music_group_id_ = #{musicGroupId}
|
|
|
+ </if>
|
|
|
+ <if test="expressCompany != null and expressCompany != ''">
|
|
|
+ and mgdr.express_company_ = #{expressCompany}
|
|
|
+ </if>
|
|
|
+ <if test="expressBillNo != null and expressBillNo != ''">
|
|
|
+ and mgdr.express_bill_no_ = #{expressBillNo}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ORDER BY id_
|
|
|
+ <include refid="global.limit" />
|
|
|
+ </select>
|
|
|
+
|
|
|
<!-- 查询当前表的总记录数 -->
|
|
|
<select id="queryCount" resultType="int">
|
|
|
- SELECT COUNT(*) FROM music_group_delivery_record
|
|
|
+ SELECT COUNT(mgdr.id_) FROM music_group_delivery_record mgdr
|
|
|
<where>
|
|
|
<if test="musicGroupId != null and musicGroupId != ''">
|
|
|
- and music_group_id_ = #{musicGroupId}
|
|
|
+ and mgdr.music_group_id_ = #{musicGroupId}
|
|
|
</if>
|
|
|
<if test="expressCompany != null and expressCompany != ''">
|
|
|
- and express_company_ = #{expressCompany}
|
|
|
+ and mgdr.express_company_ = #{expressCompany}
|
|
|
</if>
|
|
|
<if test="expressBillNo != null and expressBillNo != ''">
|
|
|
- and express_bill_no_ = #{expressBillNo}
|
|
|
+ and mgdr.express_bill_no_ = #{expressBillNo}
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|