| | |
| | | <include refid="viewWorkInConditionSql"></include> |
| | | Order by a.io_time desc |
| | | </select> |
| | | <sql id="viewWorkInTtlConditionSql"> |
| | | |
| | | <if test="matnr!=null and matnr!='' "> |
| | | and matnr like '%' + #{matnr} + '%' |
| | | </if> |
| | | <if test="maktx!=null and maktx!='' "> |
| | | and (maktx like '%' + #{maktx} + '%' |
| | | or matnr like '%' + #{maktx} + '%' |
| | | or maktx like '%' + #{maktx} + '%' |
| | | or specs like '%' + #{maktx} + '%' |
| | | or anfme like '%' + #{maktx} + '%' |
| | | or batch like '%' + #{maktx} + '%' |
| | | or brand like '%' + #{maktx} + '%' |
| | | or unit like '%' + #{maktx} + '%' |
| | | ) |
| | | </if> |
| | | <if test="begin_date!=null and begin_date!='' "> |
| | | <![CDATA[ |
| | | and io_date >= #{begin_date} |
| | | ]]> |
| | | </if> |
| | | <if test="end_date!=null and end_date!='' "> |
| | | <![CDATA[ |
| | | and io_date <= #{end_date} |
| | | ]]> |
| | | </if> |
| | | </sql> |
| | | <sql id="viewWorkOutTtlConditionSql"> |
| | | |
| | | <if test="matnr!=null and matnr!='' "> |
| | | and matnr like '%' + #{matnr} + '%' |
| | | </if> |
| | | <if test="maktx!=null and maktx!='' "> |
| | | and (maktx like '%' + #{maktx} + '%' |
| | | or matnr like '%' + #{maktx} + '%' |
| | | or maktx like '%' + #{maktx} + '%' |
| | | or specs like '%' + #{maktx} + '%' |
| | | or anfme like '%' + #{maktx} + '%' |
| | | or batch like '%' + #{maktx} + '%' |
| | | or brand like '%' + #{maktx} + '%' |
| | | or unit like '%' + #{maktx} + '%' |
| | | ) |
| | | </if> |
| | | <if test="begin_date!=null and begin_date!='' "> |
| | | <![CDATA[ |
| | | and io_date >= #{begin_date} |
| | | ]]> |
| | | </if> |
| | | <if test="end_date!=null and end_date!='' "> |
| | | <![CDATA[ |
| | | and io_date <= #{end_date} |
| | | ]]> |
| | | </if> |
| | | </sql> |
| | | <select id="queryViewWorkInTtlList" parameterType="com.zy.asrs.entity.ViewWorkInAllBean" resultType="com.zy.asrs.entity.ViewWorkInAllBean"> |
| | | select |
| | | * |
| | | from ( |
| | | select |
| | | ROW_NUMBER() OVER(Order by t.io_date desc) as row |
| | | , * |
| | | from ( |
| | | select * |
| | | from asr_wrkin_ttl_view |
| | | where 1=1 |
| | | <include refid="viewWorkInTtlConditionSql"></include> |
| | | ) t |
| | | ) a where 1=1 and a.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | </select> |
| | | |
| | | <select id="getViewWorkInTtlCount" parameterType="com.zy.asrs.entity.ViewWorkInAllBean" resultType="Integer"> |
| | | select count(1) |
| | | from asr_wrkin_ttl_view a |
| | | where 1=1 |
| | | <include refid="viewWorkInTtlConditionSql"></include> |
| | | </select> |
| | | <select id="getViewWorkInTtlAll" parameterType="com.zy.asrs.entity.ViewWorkInAllBean" resultType="com.zy.asrs.entity.ViewWorkInAllBean"> |
| | | select * from asr_wrkin_ttl_view |
| | | where 1=1 |
| | | <include refid="viewWorkInTtlConditionSql"></include> |
| | | </select> |
| | | |
| | | <select id="queryViewWorkOutTtlList" parameterType="com.zy.asrs.entity.ViewWorkInAllBean" resultType="com.zy.asrs.entity.ViewWorkInAllBean"> |
| | | select |
| | | * |
| | | from ( |
| | | select |
| | | ROW_NUMBER() OVER(Order by t.io_date desc) as row |
| | | , * |
| | | from ( |
| | | select * |
| | | from asr_wrkout_ttl_view |
| | | where 1=1 |
| | | <include refid="viewWorkInTtlConditionSql"></include> |
| | | ) t |
| | | ) a where 1=1 and a.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | </select> |
| | | <select id="getViewWorkOutTtlCount" parameterType="com.zy.asrs.entity.ViewWorkInAllBean" resultType="Integer"> |
| | | select count(1) |
| | | from asr_wrkout_ttl_view a |
| | | where 1=1 |
| | | <include refid="viewWorkInTtlConditionSql"></include> |
| | | </select> |
| | | <select id="getViewWorkOutTtlAll" parameterType="com.zy.asrs.entity.ViewWorkInAllBean" resultType="com.zy.asrs.entity.ViewWorkInAllBean"> |
| | | select * |
| | | from asr_wrkout_ttl_view a |
| | | where 1=1 |
| | | <include refid="viewWorkInTtlConditionSql"></include> |
| | | Order by a.io_date desc |
| | | </select> |
| | | </mapper> |