Fancy
2024-08-22 4d1a30da0ec4d37694baeb129a9a21aa29c157b7
pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml
@@ -192,6 +192,21 @@
    </trim>
    order by id desc
  </select>
    <select id="selectByOrderId" resultType="com.dy.pmsGlobal.pojoPlt.PltProduct">
        SELECT
        <include refid="Join_Column_List">
            <property name="alias" value="p"/>
        </include>
        FROM
        <if test="orderId != null and orderId != ''">
            (select * from pr_order_item WHERE deleted!=1 AND order_id = #{orderId,jdbcType=BIGINT}) poi,
        </if>
        (select * from plt_product  where  deleted!=1) p
        <if test="orderId != null and orderId != ''">
            WHERE poi.pro_id = p.id
        </if>
        order by id desc
    </select>
  <select id="selectMaxCode" resultType="java.lang.String">
    select max(code) from plt_product
  </select>
@@ -201,5 +216,11 @@
            and id != #{id}
        </if>
    </select>
    <select id="selectByCode" resultType="com.dy.pmsGlobal.pojoPlt.PltProduct">
        select
        <include refid="Base_Column_List" />
        from plt_product p
        where p.deleted!=1 and p.code = #{code}
    </select>
</mapper>