|
|
|
@ -29,29 +29,56 @@ |
|
|
|
|
|
|
|
<!-- 订单结算 --> |
|
|
|
<select id="ordercs" resultType="cn.chjyj.szwh.vo.SettleVo" parameterType="java.util.Map"> |
|
|
|
SELECT u.islicode as islicode,u.`name`,u.publicAccount, |
|
|
|
u.bankName,u.userType,o.close_status FROM order_user u |
|
|
|
INNER JOIN `order` o ON u.batchcode=o.batchcode |
|
|
|
<where> |
|
|
|
<if test="map!=null"> |
|
|
|
<foreach collection="map" item="v" index="k" separator="and"> |
|
|
|
<if test="v != null and v != '' and k!='u.name'"> |
|
|
|
${k} = #{v} |
|
|
|
</if> |
|
|
|
<if test="k=='u.publicAccount'"> |
|
|
|
u.publicAccount like concat('%',#{v},'%') |
|
|
|
</if> |
|
|
|
<if test="k=='u.name'"> |
|
|
|
u.`name` like concat('%',#{v},'%') |
|
|
|
</if> |
|
|
|
</foreach> |
|
|
|
SELECT u.islicode as islicode,u.`name`,u.publicAccount, |
|
|
|
u.bankName,u.userType,o.close_status FROM order_user u |
|
|
|
INNER JOIN `order` o ON u.batchcode=o.batchcode |
|
|
|
<where> |
|
|
|
<if test="map!=null"> |
|
|
|
<foreach collection="map" item="v" index="k" separator="and"> |
|
|
|
<if test="v != null and v != '' and k!='u.name'"> |
|
|
|
${k} = #{v} |
|
|
|
</if> |
|
|
|
<if test="k=='u.publicAccount'"> |
|
|
|
u.publicAccount like concat('%',#{v},'%') |
|
|
|
</if> |
|
|
|
<if test="k=='u.name'"> |
|
|
|
u.`name` like concat('%',#{v},'%') |
|
|
|
</if> |
|
|
|
</foreach> |
|
|
|
|
|
|
|
</if> |
|
|
|
<if test="map==null"> |
|
|
|
u.id IN (SELECT MAX(id) FROM order_user GROUP BY islicode) |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
ORDER BY u.id DESC |
|
|
|
</if> |
|
|
|
<if test="map==null"> |
|
|
|
u.id IN (SELECT MAX(id) FROM order_user GROUP BY islicode) |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
ORDER BY u.id DESC |
|
|
|
Limit #{start},#{limit} |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 统计结算数量 --> |
|
|
|
<select id="countOrderCs" parameterType="java.util.Map" resultType="java.lang.Integer"> |
|
|
|
SELECT count(*) |
|
|
|
FROM order_user u |
|
|
|
INNER JOIN `order` o ON u.batchcode=o.batchcode |
|
|
|
<where> |
|
|
|
<if test="map!=null"> |
|
|
|
<foreach collection="map" item="v" index="k" separator="and"> |
|
|
|
<if test="v != null and v != '' and k!='u.name'"> |
|
|
|
${k} = #{v} |
|
|
|
</if> |
|
|
|
<if test="k=='u.publicAccount'"> |
|
|
|
u.publicAccount like concat('%',#{v},'%') |
|
|
|
</if> |
|
|
|
<if test="k=='u.name'"> |
|
|
|
u.`name` like concat('%',#{v},'%') |
|
|
|
</if> |
|
|
|
</foreach> |
|
|
|
|
|
|
|
</if> |
|
|
|
<if test="map==null"> |
|
|
|
u.id IN (SELECT MAX(id) FROM order_user GROUP BY islicode) |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
|
|
|
|
<!--查询用户--> |
|
|
|
|