| | |
| | | )t |
| | | ${ew.customSqlSegment} |
| | | </select> |
| | | |
| | | <select id="listStockByMatnrIds" resultType="java.util.HashMap"> |
| | | SELECT |
| | | li.matnr_id AS matnrId, |
| | | COALESCE(SUM(li.anfme), 0) AS stockQty, |
| | | GROUP_CONCAT(DISTINCT li.loc_code ORDER BY li.loc_code) AS locCodes |
| | | <if test="locUseStatus == null or locUseStatus == ''"> |
| | | , GROUP_CONCAT(DISTINCT l.use_status ORDER BY l.use_status) AS locStatuses |
| | | </if> |
| | | FROM man_loc_item li |
| | | INNER JOIN man_loc l ON l.id = li.loc_id |
| | | WHERE li.matnr_id IN |
| | | <foreach collection="matnrIds" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | <if test="locUseStatus != null and locUseStatus != ''"> |
| | | AND l.use_status = #{locUseStatus} |
| | | </if> |
| | | GROUP BY li.matnr_id |
| | | </select> |
| | | </mapper> |