| | |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <select id="selectItems" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from pr_order_item |
| | | where order_id = #{orderId,jdbcType=BIGINT} and deleted !=1 |
| | | <!--算出完成率 Base_Column_List--> |
| | | SELECT aa.*, concat(round(((complete_number/number) * 100 ),2), '%') as complete_rate from ( |
| | | select oi.id,oi.order_id,oi.pro_id,oi.number, sum(IFNULL(pap.output_number,0)) as complete_number |
| | | from (SELECT * from pr_order_item where order_id = #{orderId,jdbcType=BIGINT} and deleted !=1 ) oi |
| | | LEFT JOIN pr_assembly_plan pap |
| | | ON oi.order_id = pap.order_id AND oi.pro_id = pap.pro_id |
| | | GROUP BY oi.id,oi.order_id,oi.pro_id,oi.number) aa |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from pr_order_item |
| | |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoPr.PrOrderItem"> |
| | | <!--@mbg.generated--> |
| | | update pr_order_item |
| | | <set> |
| | | <if test="orderId != null"> |
| | |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <delete id="deleteLogicById"> |
| | | update pr_order_item set deleted = 1 where id = #{id} |
| | | </delete> |
| | | <select id="selectSome" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from pr_order_item p |
| | | where p.deleted!=1 |
| | | <trim prefix="and " suffixOverrides="and"> |
| | | <if test="orderId != null and orderId != ''"> |
| | | p.order_id = #{orderId,jdbcType=BIGINT} and |
| | | </if> |
| | | </trim> |
| | | order by id desc |
| | | <trim prefix="limit " > |
| | | <if test="start != null and count != null"> |
| | | #{start}, #{count} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | |
| | | <select id="selectSomeCount" resultType="java.lang.Long"> |
| | | select count(1) |
| | | from pr_order_item p |
| | | where p.deleted!=1 |
| | | <trim prefix="and " suffixOverrides="and"> |
| | | <if test="orderId != null and orderId != ''"> |
| | | p.order_id = #{orderId,jdbcType=BIGINT} and |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | </mapper> |