| | |
| | | <include refid="queryWhereSql"/> |
| | | </select> |
| | | |
| | | <insert id="insertOpeWarehouseReserve" parameterType="com.nanometer.smartlab.entity.OpeWarehouseReserve"> |
| | | insert into ope_warehouse_reserve(id, reagent_id, article_number, reserve, valid_flag, update_time,warehouseId,container_id,user_id) |
| | | values (#{id}, #{reagentId}, #{articleNumber}, #{reserve}, 1, now(),#{warehouseId},#{containerId},#{userId}) |
| | | <insert id="insertOpeWarehouseReserve" parameterType="com.nanometer.smartlab.entity.OpeWarehouseReserve" useGeneratedKeys = "true" keyProperty = "id"> |
| | | insert into ope_warehouse_reserve(reagent_id, article_number, reserve, valid_flag, update_time,warehouseId,container_id,user_id) |
| | | values (#{reagentId}, #{articleNumber}, #{reserve}, 1, now(),#{warehouseId},#{containerId},#{userId}) |
| | | </insert> |
| | | <insert id="insertOpeWarehouseReserve2" parameterType="com.nanometer.smartlab.entity.OpeWarehouseReserve"> |
| | | insert into ope_warehouse_reserve(id, reagent_id, article_number, reserve, valid_flag, update_time,warehouseId,apply_code,order_code,container_id,user_id) |
| | | values (#{id}, #{reagentId}, #{articleNumber}, #{reserve}, 1, now(),#{warehouseId},#{applyCode},#{orderCode},#{containerId},#{userId}) |
| | | <insert id="insertOpeWarehouseReserve2" parameterType="com.nanometer.smartlab.entity.OpeWarehouseReserve" useGeneratedKeys = "true" keyProperty = "id"> |
| | | insert into ope_warehouse_reserve(reagent_id, article_number, reserve, valid_flag, update_time,warehouseId,apply_code,order_code,container_id,user_id) |
| | | values ( #{reagentId}, #{articleNumber}, #{reserve}, 1, now(),#{warehouseId},#{applyCode},#{orderCode},#{containerId},#{userId}) |
| | | </insert> |
| | | |
| | | <update id="updateOpeWarehouseReserve" parameterType="com.nanometer.smartlab.entity.OpeWarehouseReserve"> |
| | | update ope_warehouse_reserve |
| | | <set> |
| | | reagent_id=#{reagentId}, |
| | | reserve=#{reserve}, |
| | | update_time=now(), |
| | | container_id=#{containerId}, |
| | | <if test="articleNumber != null and articleNumber !=''"> |
| | | article_number=#{articleNumber}, |
| | | </if> |
| | | <if test="warehouseId != null and warehouseId !=''"> |
| | | warehouseId=#{warehouseId}, |
| | | </if> |
| | | <if test="userId != null and userId !=''"> |
| | | user_id=#{userId}, |
| | | </if> |
| | | reagent_id=#{reagentId}, |
| | | reserve=#{reserve}, |
| | | update_time=now(), |
| | | <if test="articleNumber != null and articleNumber !=''"> |
| | | article_number=#{articleNumber}, |
| | | </if> |
| | | <if test="warehouseId != null and warehouseId !=''"> |
| | | warehouseId=#{warehouseId}, |
| | | </if> |
| | | <if test="containerId != null and containerId !=''"> |
| | | container_id=#{containerId}, |
| | | </if> |
| | | <if test="userId != null and userId !=''"> |
| | | user_id=#{userId}, |
| | | </if> |
| | | </set> |
| | | where id=#{id} |
| | | </update> |
| | |
| | | |
| | | order by oa.update_time,oa.reserve |
| | | </select> |
| | | <select id="countByReagentId" resultType="java.lang.Integer"> |
| | | select ifnull(sum(owr.reserve),0) |
| | | from ope_warehouse_reserve as owr |
| | | where owr.reserve > 0 |
| | | and owr.reagent_id = #{id} |
| | | and owr.valid_flag = 1 |
| | | group by owr.reagent_id |
| | | </select> |
| | | <select id="getRowData" resultMap="OpeWarehouseReserve"> |
| | | |
| | | <include refid="queryColumns"/> |
| | | from ope_warehouse_reserve as oa |
| | | <include refid="queryJoins"/> |
| | | where oa.id = #{id} |
| | | </select> |
| | | |
| | | <update id="updateByReId" parameterType="java.util.Map"> |
| | | update ope_warehouse_reserve set reagent_id=#{newReId} where reagent_id=#{oldReId} |
| | |
| | | |
| | | <update id="updateCount" parameterType="java.util.Map"> |
| | | update ope_warehouse_reserve set reserve=reserve+1 where reagent_id=#{reagentId} and article_number=#{articleNumber} |
| | | and valid_flag = 1 |
| | | </update> |
| | | <update id="updateBtReserve"> |
| | | UPDATE ope_warehouse_reserve |