| | |
| | | group by a.matnr,a.[year],a.[month],a.[day],a.kun,a.up_down |
| | | ) t |
| | | </select> |
| | | <select id="selectSameDetl" resultType="java.lang.String"> |
| | | SELECT |
| | | ld.loc_no |
| | | FROM asr_loc_detl ld |
| | | LEFT JOIN asr_loc_mast lm ON ld.loc_no = lm.loc_no |
| | | LEFT JOIN ( |
| | | select |
| | | loc_no, |
| | | count(1) as count |
| | | from asr_loc_detl |
| | | where 1=1 |
| | | group by loc_no |
| | | ) dual on dual.loc_no = lm.loc_no |
| | | WHERE 1 = 1 |
| | | <if test="matnr != null and matnr != ''"> |
| | | AND ld.matnr = #{matnr} |
| | | </if> |
| | | <if test="batch != null and batch != ''"> |
| | | AND ld.batch = #{batch} |
| | | </if> |
| | | <if test="grade != null and grade != ''"> |
| | | AND ld.brand = #{grade} |
| | | </if> |
| | | AND (lm.loc_sts = 'F') |
| | | AND dual.count = 1 |
| | | ORDER BY lm.modi_time ASC |
| | | </select> |
| | | |
| | | </mapper> |